Exporting report i have a PDf of 0 byte

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

    • Post Options:
    • Link

    Posted 18 July 2024, 9: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 19 July 2024, 3:26 am 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 22 July 2024, 4:13 am 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 22 July 2024, 4:31 am 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 22 July 2024, 4:55 am 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 23 July 2024, 2:19 am 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 23 July 2024, 3:26 am EST - Updated 23 July 2024, 4:37 am EST

    This ‘run’ :slight_smile:

    thank you.

  • Posted 23 July 2024, 5:01 am 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