Clear Filters
Clear Filters

Report Generator by raw pdf object for .net project

3 views (last 30 days)
Hi
I need some advice in regards to useing report genertor in a .net application, via creating a dll file from the coder app.
I am following the example outlined below, but creating a pdf instead of a html.
The aim is to have the report generoted in my .net AzureFunction App.
But if was to crete a dll using the coder genertor app, where would the pdf gets saved, therefore i am thinking is it possible for the report genertor to simple output a pdf based object (raw data). Then using the raw data outputed from the dll file i could save it as .pdf locally on any platform that is accessing my .net project.
Is this possible?
Thanks

Answers (1)

Shaik
Shaik on 16 May 2023
Hi Joshi,
Yes, it is possible to generate a PDF using the Report Generator and save it locally in your .NET application. Instead of directly saving the PDF file within the DLL generated by the code generator, you can modify your approach to return the PDF data as a raw object from the DLL. This allows you to handle the PDF data in your .NET application and save it locally as needed.
Here's a general outline of the approach you can follow:
  1. Generate the PDF using the Report Generator: Use the code generator app to create a DLL that generates the PDF report. Ensure that the DLL returns the PDF data as a raw object, such as a byte array or a memory stream, instead of directly saving it to a file.
  2. Integrate the DLL into your .NET application: Import the DLL into your .NET application and invoke the appropriate methods to generate the PDF. Capture the PDF data returned by the DLL into a variable within your .NET application.
  3. Save the PDF locally: Once you have the PDF data in your .NET application, you can save it locally using the System.IO.File class. Specify the file path and use the WriteAllBytes or WriteAllBytesAsync method to save the PDF data to the desired location on the local file system.
  1 Comment
Dharmesh Joshi
Dharmesh Joshi on 16 May 2023
Thank You for your reply
Have you tried this before?
So from Matlab, how do you output the raw object instead of the PDF file?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!