Rendering on Pdf produces a bad file

1 Answer 27 Views
Rendering
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Deltaohm asked on 20 Mar 2024, 03:46 PM | edited on 20 Mar 2024, 03:59 PM

Hi,
I'm using a trial version of Telerik reporting.
I designed a trdp project file and I included it in my application.
The data source is a json string that I change at runtime.

I tried to export on pdf and I get no error from the call to RenderReport, but saving the bytes of RenderingResult.DocumentBytes on a pdf file I get a unreadeable file, it is a real pdf file (I see it on hexadecimal editor) but very short.

I tried to export on csv, html, and rtf and I get a valid and  good file.

Could be a trial limitation?

Thank you

Luigi

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 25 Mar 2024, 09:25 AM

Hello Luigi,

Let me start by clarifying that the Telerik Reporting Trial is fully functional. The only difference with the Dev version is the red trial message in the generated reports.

Regarding the issue with the PDF export, if I understood correctly, in the other formats, the report is rendered as expected. Is the JSON data properly shown in these report documents? Did you check the KB article The Reports Are not Rendered or Generated Report Documents are Corrupted When the Data Set Comes Back Empty?

What are you opening your PDF files with? Did you try with an alternative PDF reader, for example, a browser? Can you send such a PDF document for local tests?

Does the PDF show as expected if you export it from a Report Viewer?

Please, consider opening a support ticket and sending us a runnable report definition, including sample JSON data for reproducing the issue and investigating further.

Regards,
Todor
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
commented on 25 Mar 2024, 10:54 AM

Thank you Todor,

I answer to your questions:

Json is not empty and it is not corrupted, it is a valid file

I tried to open Pdf with Adobe and other application and browser too

If I export from Designer I get a good pdf

I attach the template and the json to generate the report and the rtf and pdf resulting.

Luigi

Todor
Telerik team
commented on 28 Mar 2024, 09:50 AM

Hi Luigi,

I tested the report and indeed, it works as expected when exporting from the Standalone Report Designer.

Note that when exporting with code, the JSON file that is referenced relatively in the JsonDataSource will be resolved with respect to the report location. I have linked a muted video showing how your report was successfully rendered with code when the data file was accessible.

You may attach a Trace Listener or check the error in the RenderingResult object for details on the problem.

Tags
Rendering
Asked by
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Answers by
Todor
Telerik team
Share this question
or