|
1) I create a report (an invoice template) locally and upload to the server to a known location.
2) When required by the user (calling an API action) I have to get the report, combine it with some data and render it to PDF on the server.
3) Then send the PDF to the client browser as a download (but not to the report viewer/editor, just the PDF file)
Steps 1 and 3 are clear to me, but I really lost on the libraries I have to install and imports I must do on the API controller to render the report, that is step 2.
|
We can achieve your requirement by using ReportWriter control to export the report into PDF, Excel, Word, PPT and HTML directly without displaying in viewer. To load ReportWriter control, we have to refer the below shared dependent assemblies. We can get the below dependent assemblies by installing our latest Essential studio build for ASP.NET MVC and ASP.NET Web platform which is available for download under the following link.
For Nuget packages, please refer to the below UG documentation for Nuget package update.
please find the list of Syncfusion dependent assemblies,
Please find the below UG documents for more detail,
You can obtain the complete ASP.NET MVC ReportWriter sample in below build installed location,
%userprofile%\AppData\Local\Syncfusion\EssentialStudio\version\ MVC\Samples\web
| |
|
It's also unclear for me how can I pass the data to the report as simple object, and not coming from a DataSource, since this data is built at runtime and isn't stored anywhere. |
We can add/pass the datasource value for the Report in ReportWriter by using DataSources property as shown in below code example,
We have prepared a sample in ASP.NET MVC platform and it can be downloaded from below location,
Please find the below UG documents for more detail,
|