Wednesday, March 21, 2012

Rename a linked report

I can find two ways of doing this.

1.SetProperties()

Property[] props = new Property[1];
Property setProp = new Property();
setProp.Name = "Name";
setProp.Value = "NewName";
props[0] = setProp;

rs.SetProperties(itemPath, props);

> Does this also rename the 'Path' property, becuase this is our key to accessing the reports.

2. MoveItem()
string currentPath = "/Reports/OldName";
string targetPath = "/Reports/NewName";
rs.MoveItem(currentPath, targetPath);

Which should i use and why.. thanks..

Hello dreadjr or other in the forums,

I know your post was a few months back, but were you able to figure out the best way to rename a report?

I'm having a similar problem. I have a report that has linked reports linked to it, and I'm trying to rename the "main" report so that the linked reports stay linked to the newly renamed report.

I tried the MoveItem and it appear to not work correctly. The "main" report was renamed but the linked reports seemed to lose their links to the "main" report. I'll try the other method you mentioned.

Any help is appreciated.

Thanks.

|||

Hello All,

Well, I tried changing the Name using the SetProperties method. This doesn't work. An exception is throw because the Name property is read-only. Apparently, you cannot change this programmatically using SetProperties.

Anyway, any help? Again, I'm trying to rename a report that has other linked reports linked to it, while keeping the link in place so that, after the name change, the linked reports are linked to the report with the new name. This appears to work in Report Manager, but I need to make it work in a custom application.

Thanks!

No comments:

Post a Comment