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

Report to be Saved in 2 formats

1 Answer 160 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Veteran
Steve asked on 04 Feb 2021, 05:20 AM

I have a .net app which uses Telerik Reporting to render a report produced in the Standalone Report Designer, it has a number of data sources and the running of those data sources takes 2-3 minutes.  The data source is SQL server.

When running the report in the Report Designer all works well.

In the .net app I need to save the report as an image, so I can place it in an email as a summary but then I also want to save as an XLSX spreadsheet and attach that spreadsheet, after adding a lot more data, pivot tables etc the e-mail. 

So currently I'm rendering the report twice, the first which is rendered to XLSX format and then again as JPEG file.

So the data is being extracted from SQL twice, once with each render so it doubles the time taken and also the load on SQL. 

Is there a way to generate the report and then export that report as XLSX file and then again as a JPEG?

1 Answer, 1 is accepted

Sort by
0
Mads
Telerik team
answered on 08 Feb 2021, 05:08 PM

Hi Steve,

In the Reporting solution there is not any feature to use the same data twice for different rendering tasks. With the SQL Data-source it will fetch the rows again each time. 

One approach I could think of is moving the SQL query outside of the Reporting engine. By letting .NET do the query, database caching can be utilized so that it does not query twice, but saves the result in a cache when the first query is executed, then uses that cache instead of retrieving data from the database. To then bring that data into the Report, an Object Data-source or Entity Data-source can be used which bases the report on model classes from the application leaves the actual data-retrieval to .NET. 

I am sorry I could not provide a solution that does not require you to swap the data-source or directly convert one report export format to another. Let me know if you have any questions.

Regards, Mads Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Report Designer (standalone)
Asked by
Steve
Top achievements
Rank 1
Veteran
Answers by
Mads
Telerik team
Share this question
or