Showing posts with label overwrite. Show all posts
Showing posts with label overwrite. Show all posts

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.

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.

rs.CreateReport() with overwrite set to true doesn't really overwrite

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, including all parameters and parameter
properties. 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;
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);
Any help is greatly appreciated. Thanks!Hello Imttag,
This issue may occured by the session the reporting services holding. So I
suggest you reset your IIS after you create the report.
If this still occured, you may try to delete the report first and then
recreate the report again.
Hope this helps.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Thanks for the info! However, the first idea didn't help. I ran my code to
call the CreateReport method to overwrite the report (and everything worked
fine with no errors). Then I close the browser and went back in (a
completely new session), and no changes. The report appeared to be the old
report, not the new report.
We thought about the second idea (that is, delete the old report and deploy
the new report in its place), but we have another issue with that approach.
The reports will have linked reports, and if we delete the report the linked
reports will not be linked anymore. We need to replace/overwrite the report
and keep the links in place for any linked reports.
Any help/suggestions on how to do this?
"Wei Lu [MSFT]" <weilu@.online.microsoft.com> wrote in message
news:OJiRNQjgHHA.6068@.TK2MSFTNGHUB02.phx.gbl...
> Hello Imttag,
> This issue may occured by the session the reporting services holding. So I
> suggest you reset your IIS after you create the report.
> If this still occured, you may try to delete the report first and then
> recreate the report again.
> Hope this helps.
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================> This posting is provided "AS IS" with no warranties, and confers no
rights.
>|||The issue with the default parameters not changing is considered a
feature. They favour server admins over developers. Given that an
admin might of changed the default values from those that were
originally deployed they are always preserved.
What you can do is set the default for the parameters separately after
you call SetReportDefinition to update your report. I use code similar
to that below to loop through the parameters of a report and change
the default values:
ReportParameter[] objReportParameters =objReportingServer.GetReportParameters(ReportNameGoesHere, null, true,
null, null);
foreach (ReportParameter objParameter in objReportParameters)
{
if (objParameter.Name == ParameterToChange)
objParameter.DefaultValues[0] = SomeDefaultValue;
}
Hope this helps,
Shane.
On Apr 18, 11:55 pm, "lmttag" <lmt...@.newsgroup.nospam> wrote:
> 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, including all parameters and parameter
> properties. 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;
> 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);
> Any help is greatly appreciated. Thanks!|||I forgot to mention that after you update the parameters you'll need
to call SetReportParameters to save the changes.
Regards,
Shane.
On Apr 19, 2:50 pm, shanejokeeffe <shanejokee...@.gmail.com> wrote:
> The issue with the default parameters not changing is considered a
> feature. They favour server admins over developers. Given that an
> admin might of changed the default values from those that were
> originally deployed they are always preserved.
> What you can do is set the default for the parameters separately after
> you call SetReportDefinition to update your report. I use code similar
> to that below to loop through the parameters of a report and change
> the default values:
> ReportParameter[] objReportParameters => objReportingServer.GetReportParameters(ReportNameGoesHere, null, true,
> null, null);
> foreach (ReportParameter objParameter in objReportParameters)
> {
> if (objParameter.Name == ParameterToChange)
> objParameter.DefaultValues[0] = SomeDefaultValue;
> }
> Hope this helps,
> Shane.
> On Apr 18, 11:55 pm, "lmttag" <lmt...@.newsgroup.nospam> wrote:
> > 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, including all parameters and parameter
> > properties. 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;
> > 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);
> > Any help is greatly appreciated. Thanks!|||Thanks for the info Shane!
I'll look into your suggestion. It sounds good.
"shanejokeeffe" <shanejokeeffe@.gmail.com> wrote in message
news:1176991806.345375.95070@.b75g2000hsg.googlegroups.com...
> I forgot to mention that after you update the parameters you'll need
> to call SetReportParameters to save the changes.
> Regards,
> Shane.
> On Apr 19, 2:50 pm, shanejokeeffe <shanejokee...@.gmail.com> wrote:
> > The issue with the default parameters not changing is considered a
> > feature. They favour server admins over developers. Given that an
> > admin might of changed the default values from those that were
> > originally deployed they are always preserved.
> >
> > What you can do is set the default for the parameters separately after
> > you call SetReportDefinition to update your report. I use code similar
> > to that below to loop through the parameters of a report and change
> > the default values:
> >
> > ReportParameter[] objReportParameters => > objReportingServer.GetReportParameters(ReportNameGoesHere, null, true,
> > null, null);
> >
> > foreach (ReportParameter objParameter in objReportParameters)
> > {
> > if (objParameter.Name == ParameterToChange)
> > objParameter.DefaultValues[0] = SomeDefaultValue;
> >
> > }
> >
> > Hope this helps,
> >
> > Shane.
> >
> > On Apr 18, 11:55 pm, "lmttag" <lmt...@.newsgroup.nospam> wrote:
> >
> > > 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, including all parameters and parameter
> > > properties. 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;
> >
> > > 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);
> >
> > > Any help is greatly appreciated. Thanks!
>