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!
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment