Exporting report i have a PDf of 0 byte

Posted by: luca on 18 July 2024, 12:04 am EST

    • Post Options:
    • Link

    Posted 18 July 2024, 12:04 am EST

    Hello,

    I use active report 10 and i have an ActiveReportsWeb:WebViewer with my report.

    I’d like export it by a custom button .

    In the button i tryed to insert

      [code]Dim MyPDF As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport
        Try
            MyPDF.Export(WebViewer1.Report.Document, _path_and_name)
        Catch _Error As Exception
        End Try[/code]
    

    There is the file but it is 0 bytes.

    What can i try ?

  • Posted 18 July 2024, 6:26 pm EST

    Hi,

    Please note that ActiveReports 10 is our legacy version, and we do not provide support, bug fixes, or enhancements for the same. If the issue persists in v18 (the latest version), please share with us a sample, stripped-down, runnable application replicating the issue so that we can assist you further.

    You may also check the attached WebViewer sample using ActiveReports 18, where we have added a custom button on the WebViewer and exported the current rendered report to PDF. You can learn more about WebViewer here: ASP.NET WebViewer Application

    You may use the ActiveReports File Converter tool to upgrade your existing ActiveReports 10 reports to ActiveReports 18. You may refer to the following documentation link for the detailed conversion process using the converter tool:

    P.S., in order to use the ActiveReports File Converter tool for ActiveReports 18, make sure that ActiveReports 18 is installed on your machine. You may download ActiveReports 18 from the attached link and utilize its features free for the first 30 days: Download ActiveReports 18

    After downloading, you may refer to the attached documentation link for the detailed installation process: Install ActiveReports

    Also, since there are many differences between the product requirements for ActiveReports 10 and ActiveReports 18, please refer to the product requirements for ActiveReports 18 here: Product Requirements

    In addition to that, there have been many breaking changes between the versions. Hence, it is suggested to refer to the breaking changes for each version using the following links before upgrading:

    We hope this helps and feel free to get back to us if you face any issues in the upgrade process.

    CustomPDFExport.zip

  • Posted 21 July 2024, 7:13 pm EST

    Thank you.

    I know that this is an old version but i need help for this problem and i hope the someone’d be able to help me.

  • Posted 21 July 2024, 7:31 pm EST

    Hi,

    Could you please try providing us with a sample replicating the issue so that we could assist you further? Also, please let us know if our previously attached sample helps or not.

  • Posted 21 July 2024, 7:55 pm EST

    I dont understand, the sample is in the code.

    I have a web page with a webviewer and under it there is a custom button with cod to export the report.

    The pdf created is 0 byte.

    This is the code :

    Dim MyPDF As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport
        Try
            MyPDF.Export(WebViewer1.Report.Document, _path_and_name)
        Catch _Error As Exception
            LabMsg.Text = _Error.Message
    End Try

    Which other information can i give you ?

  • Posted 22 July 2024, 5:19 pm EST

    Hi,

    Make sure to run the Section Report before exporting it. Please refer to the attached code for reference:

    Protected Sub btnExport_Click(sender As Object, e As EventArgs)
        Dim PdfExport1 As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport()
        Dim pdfFileName As String = "PDFExpt.pdf"
        Dim pdfFilePath As String = Server.MapPath("~/pdf/" & pdfFileName)
        Dim sectionReport As New SectionReport()
        sectionReport.LoadLayout(Server.MapPath(arvWebMain.ReportName))
        sectionReport.Run()
        PdfExport1.Export(sectionReport.Document, pdfFilePath)
    End Sub
    

    We hope this helps!

  • Posted 22 July 2024, 6:26 pm EST - Updated 22 July 2024, 7:37 pm EST

    This ‘run’ :slight_smile:

    thank you.

  • Posted 22 July 2024, 8:01 pm EST

    Hi,

    Glad we could help!

Need extra support?

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

Learn More

Forum Channels