how to update the report dynamically using ReportDefinition.cs from webservice
I want to update the report attributes dynamically ie when user select the category field and series filed at runtime i want to update the rdl according to that for this i have created chart type report at design time and deployed it in the sql server 2005 now i have created ReportDefinition.cs from ReportDefinitionSchema.xsd i am able to get rdl like byte[] array form Report Server webservice and serialize it to a Report object following is my code List<ItemsChoiceType37> _reportItems = new List<ItemsChoiceType37>(_report.ItemsElementName); // Locate the index for the Description property int index = _reportItems.IndexOf( ItemsChoiceType37.Body); when quick watch the _report i can see the chart type rdl category and series data.But i not aware of how to access those things by code. i am getting the body type object from _report.Items[index] But when _report.Items[index].Items it is not allowing that operation in the ReportDefinition.cs there are class like BodyType , ReportItemsType,Chart Type.I think if am able to create this objects i can directly access those xml element attributes.but i dont know how to do it as i am extreamly new to this . please help
July 29th, 2009 4:48pm

Hi,Reporting Services doesnt support any function to update the xml element attributes in RDL file directly. To work around the issue, you could use ReportingService2005.GetReportDefinition method to get the report definition. After modifying the report definition, use the ReportingService2005.SetReportDefinition method to reset thedefinition for the report.Reference documents:ReportingService2005.GetReportDefinition Methodhttp://technet.microsoft.com/en-us/library/reportservice2005.reportingservice2005.getreportdefinition.aspxReportingService2005.SetReportDefinition Methodhttp://technet.microsoft.com/en-us/library/reportservice2005.reportingservice2005.setreportdefinition.aspxTutorial: Generating RDL Using the .NET Frameworkhttp://technet.microsoft.com/en-us/library/ms170667(SQL.90).aspxIf there are any more questions, please let me know.Thanks.***Xiao Min Tan***Microsoft Online Community***
Free Windows Admin Tool Kit Click here and download it now
July 31st, 2009 1:18pm

I am able to get the reportdefnition using // Retrieve the report defintion // from the report server byte[] bytes = _reportService.GetReportDefinition(reportPath); if (bytes != null) { XmlSerializer serializer = new XmlSerializer(typeof(Report)); // Load the report bytes into a memory stream using (MemoryStream stream = new MemoryStream(bytes)) { // Deserialize the report stream to an // instance of the Report class _report = ( Report)serializer.Deserialize(stream); } }when i quick watch _report i can see all my report elemnts.but i am not sure abt further stepHow do i access category adn series data of a chart report and update those values ?actually these values are slected by end users and i am passing it as paramaeters and i want to update the rdl with the new valuesin this cs class generated i can see bodytype class and chart type class .how to access those ..please help
July 31st, 2009 6:03pm

Hi,The only way is to search for the element targets in your report stream and replace their values.If there are any more questions, please let me know.Thanks.***Xiao Min Tan***Microsoft Online Community***
Free Windows Admin Tool Kit Click here and download it now
August 3rd, 2009 1:20pm

Hello, Unfortunately, the getreportdefinition method was deprecated in the 2010 namespace. Do you know of an equivalent method to use when using the 2010 web services API? Thanks, Ben Lezin
March 11th, 2011 8:04pm

You can use the GetItemDefinition method with the 2010 version.
Free Windows Admin Tool Kit Click here and download it now
March 18th, 2011 10:47pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics