I have created one report in standalone report designer (Report.trdp), using object data source (my custom CLR type). It´s possible to programmatically load the report file and set the data source like a report created in Visual Studio (Report.cs)?
Idea of code:
6 Answers, 1 is accepted
It is possible to modify the report definition. First, you will need to deserialize the report XML to a report object, as elaborated in the Deserialize Report Definition from XML file help article.
First thank you for reply,i realized that .trdp is a zip with two xml files inside. I used the file definition.xml in the deserialization and now i have a report object. But, the binding of the data not occurs correctly.
Is any wrong?
When working with TRDP reports you can use the ReportPackager class to unpackage the report. For more information, please check the Report Unpackaging help article. The ReportPackager.Unpackage Method will return a Telerik.Reporting.Report object which you can use and modify.
In case the report does not bind correctly to your List<T>, please elaborate further on the error message, so we can provide any suggestions.
Hello, I have a similar question.
If I unpackage a trdp report a get a Report object. And I can add an object to his DataSource.
But I cannot access its other items that I created when designing it, e.g. a table or a textBox...
e.g report.table1.DataSource // table1 is not defined
Is it possible to give parameters to a trdp report?
You can use the Find method to search for nested items. An example is illustrated here.
On a side note, you may be interested in data-binding approaches like Use DataObject as a datasource for nested data items (Table, List, Crosstab, Graph)Steps: and How to Databind to Collection Properties. The Standalone Report Designer can load data from business objects by extending its configuration - Extending Report Designer.
Telerik by Progress
hola,quisiera saber como usar el metodo ReportPackager y especificamente en donde usuaria el codigo para desempaquetado.