Export PDF with VB.net

edited 4:26PM in FastReport .NET
Hi,

I try to run this code in VB.net 2005

Dim export As FastReport.Export.Pdf.PDFExport = New FastReport.Export.Pdf.PDFExport()
report1.Export(export, "storeTransaction_")

It gives me error Object reference set to null!!

What I'm doing wrong?

Thanks

Comments

  • edited 4:26PM
    Hello,

    Did you prepared the report first?

    report1.Prepare()
    Dim export As FastReport.Export.Pdf.PDFExport = New FastReport.Export.Pdf.PDFExport()
    report1.Export(export, "storeTransaction_")
  • edited 4:26PM
    Thank you, Yes, it's working now after adding repot1.Prepare,

    but the report dosn't show some data when I export it to PDF (it shows OK when I view the report though)

    Any help with that?

    Thank you,
  • edited July 2009
    What exactly it doesn't show?
  • edited 4:26PM
    I have some data placed in ShapeObject, all fields and text is not displayed in the PDF file, it's being displayed in the Report Perview though.

  • edited July 2009
    Probably your Shape object is in front of the data. Right-click it and select "Send to back" menu item.
  • edited 4:26PM
    Hi,

    I removed the ShapeObject around the data/text and the PDF was created OK.

    It seems that exporting to PDF has some problems with ShapeObject. Is that confirmed??

    Thanks,
  • edited 4:26PM
    Thanks,

    Yes, I set the ShapeObject to (send to back) and it works perfect now.

    Great feature.

    Thanks again,

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.