Argument Out of Range exporting to PDF from Preview

Hi,

I'm using VS2002 with VB Net. I have a report master-detail with 2 pages. The report is perfectly with following code:

       Report.Load(RutaTemporal)

       ' Set connection string

       Report.Dictionary.Connections(0).ConnectionString = DAL.CnSQL

       DSCabecera = Report.GetDataSource("TblCabecera")

       DSDetalle = Report.GetDataSource("TblDetalle")

       DSCabecera.Enabled = True

       DSDetalle.Enabled = True

       Report.Prepare()

Report.ShowPrepared()

The report is correctly shown, with the 2 pages expected.

In the "Preview", I select "Save --> Adobe Acrobat" and I select a file in the "Download" folder. When I accept, I get following message:


FastReport .NET v2023.2.17

El índice estaba fuera del intervalo. Debe ser un valor no negativo e inferior al tamaño de la colección.

Nombre del parámetro: index

  en System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)

  en System.Collections.Generic.List`1.set_Item(Int32 index, T value)

  en FastReport.Export.Pdf.PDFExport.WriteFont(ExportTTFFont pdfFont)

  en FastReport.Export.Pdf.PDFExport.AddPDFFooter()

  en FastReport.Export.Pdf.PDFExport.Finish()

  en FastReport.Export.ExportBase.Export(Report report, Stream stream)

  en FastReport.Export.ExportBase.Export(Report report, String fileName)

  en FastReport.Export.ExportBase.Export(Report report, List`1 pages)

  en FastReport.Preview.PreviewControl.Export_Click(Object sender, EventArgs e)


Furthermore, I can see on top "Exporting page 1 of 2".

I've checked in the Report and I didn't see anything unusual (obviously it shoud be, but I don't see). Any idea about how to proceed?


Best regards,

Venancio Lasquibar

Comments

  • Hi,

    I found the reason. In one of the datasets used, some rows had "NULL" values for some columns,although that values weren't shown in the report.

    I've modified the dataset to coalesce the NULL values, and the error disappeared.

    Best regards,

  • Hello!

    We have identified a stack-related ArgumentOutOfRangeException in PDFExport. WriteFont(ExportTTFFont) on empty / DBNull rows when exporting from the preview. We tested this on the latest version of FastReport.Core 2026.2.8 using a 2-page DataSet containing DBNull and empty rows; the error has been resolved and the PDF is generated correctly.

    Please update FastReport.Net / FastReport.Core to version 2026.2.8, or (if updating is temporarily not possible) retain your current SQL cleanup using COALESCE(..., “”) in your queries.

This discussion has been closed.