Blank page Report.saveasPDF

Hi, I´m having some problems with the code below, when the report doesn’t return any information the pdf is stored as a blank file.

I need to call a report N times to create reports for contacts, when the report returs information it works fine but when the report returns no information the function saveasPDF create an blank pdf.

Did someone have this issue already?

IF OMDsalesinvoiceA4.SAVEASPDF(AttachPath) THEN
      BEGIN
...      

KR,

Iã Mendes

I am not sure that it happens or not but there is a workaround if you have that issue.
Try this -

  1. After you SaveasPDF you have the filepath.
  2. Create a blob variable and using outstream write the PDF output in the blob variable.
  3. Then Using Blob.Hasvalue u can identify that the PDF have some pritable output or not.
  4. If Hasvalue returns true that means pdf is not blank.
    ** Refer Codeunit 449 for how to save in Blob.

I´m doing that and the BLOB.HasValue returns true…