View document but all to be saved as PDF

Posted by: pgollnic on 11 March 2019, 5:14 am EST

    • Post Options:
    • Link

    Posted 11 March 2019, 5:14 am EST

    I would like to be able to have my user view the report using the Webviewer control (works great) BUT ALSO want to save a copy of that report to the server as a rendered pdf document. HOW?? Using V11.1 and getting ready (month or two) TO UPGRADE TO V13.XXX

    HELP

    gollnick

  • Posted 11 March 2019, 7:34 pm EST

    Hello,

    I would recommend you to use "PDF Rendering Extension " to save the report as a PDF document on the server-side. Please refer to the following documentation link for more information.

    http://help.grapecity.com/activereports/webhelp/AR11/webframe.html#Rendering%20to%20PDF.html

    Please feel free to revert, if you have any question regarding this.

    Thanks.

  • Posted 13 March 2019, 6:54 am EST

    Hello … I have added the code as per the C# example. On this line

    pageReport.Document.Render(pdfRenderingExtension, outputProvider, pdfSetting);

    Getting this error…

    C:\Inetpub\wwwroot\Web_LandSnapNew\Web_Print_Viewer.aspx.vr(18127,2): error VR2546: Could not find a match for method ‘pageReport.Document.Render’ for the given parameter types: GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension, GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider, GrapeCity.ActiveReports.Export.Pdf.Page.Settings.

    Why??

    thanks

    gollnick

    ps… is there a WORKING example of this anyplace??

  • Posted 13 March 2019, 5:39 pm EST

    Hello,

    Could you please tell share that which report type are you using?

    Thanks.

  • Posted 13 March 2019, 11:32 pm EST

    //// Provide settings for your rendering output.

    pdfSetting = new GrapeCity.ActiveReports.Export.Pdf.Page.Settings();

    //

    // Reduce the report size and report generation time.

    pdfSetting.OptimizeStatic = true;

    //

    // Set the rendering extension and render the report.

    pdfRenderingExtension = new GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension();

    outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectoryPdf, System.IO.Path.GetFileNameWithoutExtension(outputDirectoryPdf.Name));

    //

    // Overwrite output file if it already exists

    outputProvider.OverwriteOutputFile = true;

    //

    pageReport.Document.Render(pdfRenderingExtension, outputProvider, pdfSetting);

  • Posted 14 March 2019, 12:15 am EST

    Hello,

    Please refer to the attached sample to implement the same.

    Thanks.WebApplication5.zip

  • Posted 15 March 2019, 5:34 am EST

    Well that is all well and good and it runs but all it does is create a pdf of the report format. I want to see a report generated with data bound to it in the webviewer. Then have the option to take THAT report and save it and then render it to a PDF file with all my data (not just the report shell)

  • Posted 17 March 2019, 11:06 pm EST

    Hello,

    Could you please explain the meaning of “Then have the option to take THAT report and save it”. You can save the rendered report in WebViewer into pdf format using the following line of code:

    
     protected void Page_Load(object sender, EventArgs e)
            {
               
                  
                    System.IO.FileInfo rptPath = new System.IO.FileInfo(Server.MapPath("") + @"\PageReport1.rdlx");
                    pageReport = new GrapeCity.ActiveReports.PageReport(rptPath);
                    WebViewer1.Report = pageReport;
                   // Create an output directory.
                System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"C:\MyPDF");
                outputDirectory.Create();
    
                // Provide settings for your rendering output.
                GrapeCity.ActiveReports.Export.Pdf.Page.Settings pdfSetting = new GrapeCity.ActiveReports.Export.Pdf.Page.Settings();
    
                // Reduce the report size and report generation time.
                pdfSetting.OptimizeStatic = true;
    
                // Set the rendering extension and render the report.
                GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension pdfRenderingExtension = new GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension();
                GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name));
    
                // Overwrite output file if it already exists
                outputProvider.OverwriteOutputFile = true;
               
                (WebViewer1.Report as GrapeCity.ActiveReports.PageReport).Document.Render(pdfRenderingExtension, outputProvider, pdfSetting);
            }
    
    
    

    Could you please explain in what format you want to save the report than convert it to the PDF File.

    Thanks.

Need extra support?

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

Learn More

Forum Channels