This is a migrated thread and some comments may be shown as answers.

Using XML for subreport source when storing TRDX in database

1 Answer 427 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
ken
Top achievements
Rank 1
ken asked on 30 Apr 2013, 07:21 PM
We're using Version 7.0.13.220 of the Report Designer to allow users to create reports and upload them into our web application.  The TRDX files are stored in the database and at runtime are deserialized with ReportXmlSerializer.  This works well but is rather cumbersome when subreports are used.

The Report Designer provides two options for defining the source of a subreport: 1) Url or File (this embeds a reference to the subreport file and is not an option for us since we store the report definition in a single data record) or 2) XML markup.  

Currently we are requiring the user to open the subreport in notepad, copy the content, select XML markup as the subreport source, and paste the XML into the dialog. 

Are there any plans to extend the Report Designer to allow selecting the subreport file and pulling the XML to prevent the "Open in notepad" approach?  

If not is there any other way to make it easier for the end user?  I'm currently under pressure to extend our report upload process to reach into the TRDX, iterate the subreports, prompt for upload of those files and then set the subreport source to the uploaded XML.  I'd rather not build in this dependency if the Report Designer can to it instead.

On a separate note, it looks like there is a minor defect in the tool tips for vertical spacing controls in the Layout section of the designer.  They all say "horizontal spacing" rather then "vertical spacing".

Thanks

1 Answer, 1 is accepted

Sort by
0
Hrisi
Telerik team
answered on 03 May 2013, 02:52 PM
Hello Ken,

You can use UriReportSource for SubReport item and select the report file (.trdx). 
When you use such report definitions it will search the subreport .trdx file near the base path of your application. In your case you can update the main report definition to use XmlReportSource and set the binding expression to the field containing the subreport XML as stated in our documentation. This update can be made in the main report XML before you save it in the database, or in run-time when you deserialize the main report.
In this case, the users will create separate .trdx files, use UriReportSource and upload all the files to your server, you will alter the definition and then save them to the data-base. 

Finally, I want to tank you for pointing out the wrong tooltips.

Greetings,
Hrisi
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

Joshua
Top achievements
Rank 2
Iron
Veteran
Iron
commented on 06 Dec 2022, 07:30 PM

I am in the exact same situation. It looks like I am going to have users upload a zip file with all of the subreports via Uri, then I am going have the server inject the XML definition into the main report. The link to the documentation no longer exists.

Is there now a better way to do this and is there an example somewhere of how this should be done?

Dimitar
Telerik team
commented on 09 Dec 2022, 10:23 AM

Hi Joshua,

If I understand correctly, users will have access to designing reports that use SubReports in them, and they would be able to edit the SubReport ReportSource, is that correct?

If the end users are unable to get the XML of the TRDX files, then they would indeed have to upload the files as UriReportSource , and then you would need to on the server, unpackage the report and edit its SubReports' ReportSources with the corresponding XML.

Precisely, when you have the unpackaged Report object, you may utilize the Report.Items.Find method to find all SubReport objects, and then you would need to update the SubReport.ReportSource with the XML of the SubReport report via an XmlReportSource. Please keep in mind that after updating the report, you have to re-package it in order to keep the changes.

If you can have the reports' XML via a data source field or a report parameter, then you wouldn't need to do all this as instead, you could have a binding to the SubReport.ReportSource that though a user function wraps the XML in the XmlReportSource object and returns it.

For more information on the different report sources, please refer to the Report Sources - Telerik Reporting article.

If you have any further questions, please share more information regarding the scenario.

 

 

Tags
Report Designer (standalone)
Asked by
ken
Top achievements
Rank 1
Answers by
Hrisi
Telerik team
Share this question
or