Monday, March 12, 2012

rs.CreateReport() with overwrite set to true fails to update report description

When calling the RS SOAP API's CreateReport method, it doesn't seem like the report description is updated, unless I first delete the report and then recreate it.

Here's what my call looks like -
Warning[] warnings = rs.CreateReport(reportName, "/" + folder, true, buffer, null);

Is this a known issue?

Try

Dim descprop As New [Property]
desc.Name = "Description"
desc.Value = "Now is the time for all good men to come to the aid of their country."

rs.CreateReport(reportName, "/" + folder, true, buffer, desc);

Note, this is Visual Basic, you will need to convert it to your language C#

Ham

|||

Hello Arjun B,

I'm having the same problem as you described in your post.

Were you able to find a solution? If so, what were you able to do?

Thanks!

|||lmttag - try hammer's suggestion. worked for me!|||

Thanks for the reply. I tried the suggestion. However, it still didn't work.

Here's the situation... We have a report that has been deployed to production a few weeks ago. Since then the report has changed slightly; two parameters have changed--one parameter went from not being marked internal to being marked internal and the other parameter's default value changed (just a simple string change).

Now we want to programmatically deploy the updated report to production and overwrite the existing report. However, when we try this, the parameters, as shown through Report Manger, have not changed. They're the same as the original deployment. And, there is no error/exception thrown that might be causing the problem.

Here's the code snippet:

System.Byte[] definition = null;
ReportingService2005.Warning[] warnings = null;
ReportingService2005.Property property = new ReportingService2005.Property();
property.Name = "Description";
property.Value = "Updated Report Description";
ReportingService2005.Property[] properties = new ReportingService2005.Property[1];
properties[0] = property;

string name = (string)dr["Name"]; // Variable that holds the name
string file = (string)dr["FullName"]; // Variable that holds the file

System.IO.FileStream stream = System.IO.File.OpenRead(file);
definition = new System.Byte[stream.Length];
stream.Read(definition, 0, (int)stream.Length);
stream.Close();

//warnings = rs.CreateReport(name, parent, true, definition, null);
warnings = rs.CreateReport(name, parent, true, definition, properties);

Any help is greatly appreciated. Thanks!

|||

Sorry for so many post, but does it have to be the Description property? We have descriptions built into the reports, and, if we change the description property in code to get the CreateReport() method to work, then we'll lose the correct description for the report. And, we would rather not hard-code descriptions in our application that is trying to overwrite the report.

Thanks again.

No comments:

Post a Comment