How do I set the file name when saving as PDF [repost]

Posted by: dene on 25 January 2022, 7:49 am EST

    • Post Options:
    • Link

    Posted 25 January 2022, 7:49 am EST - Updated 30 September 2022, 7:29 am EST

    Hello,

    So when exporting a file I can set the name via the controller and it gets set correctly

    However when I print and then save as PDF the file name gets set like images 2 and 3

    So is there any way to set the file name when printing/saving as PDF

  • Posted 28 January 2022, 3:13 am EST

    Hi Dene,

    The name of the pdf is randomly generated if you’re loading the report in the WebViewer using the Report property.

    You can set the name of the report as the default name of the pdf file, if you load the report using viewer.ReportName property. I have also attached a sample along with.

    WebViewerPro_ASP.NET_VB.NET__1_.zip

  • Posted 28 January 2022, 7:14 am EST - Updated 30 September 2022, 7:29 am EST

    Thanks for the reply!

    So I believe the code for the viewer is here, and I see the name for the file is set correctly for the export button.





    I am guessing that ‘Download Report’ is the print button. What do I need to put in the ‘Download Report’ section to set the name?

    Or am I completely off base? We also have a designer file on the c# portion so perhaps it needs to be done in there?

    Oh also when I ran that project you sent I got the following error:

    Also apologizes for all the questions I’m pretty new to this.

  • Posted 1 February 2022, 5:54 am EST - Updated 30 September 2022, 7:29 am EST

    Hi Dene,

    The ‘Download Report’ method does not print the report. It downloads the report as a pdf. When you press the print button, the Viewer’s Print() method is called which opens up the browser’s print dialog box where the default name of the file is the Report name (see screenshot attached).



    If you are not seeing this behavior please refer to the sample attached below.

    Oh also when I ran that project you sent I got the following error:

    Please remove the version, cultureinfo and publickeytoken attributes from the entry or replace the entry with the following:

    GrapeCity.ActiveReports.SectionReport, GrapeCity.ActiveReports

    The sample I had attached in the previous reply was for WebViewer. As, I can see you are using the JSViewer, I have attached a JSViewer Sample for your reference.

    Web_Sample.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels