PDF EXPORT System.ArgumentOutOfRangeException

When I export it to pdf, I get this error.
Please explain solution for this problem.

Report report = new Report();
report.LoadPrepared((System.IO.Stream)dpOutput["@REPORT";].data);
FastReport.Export.Pdf.PDFExport pdf = new FastReport.Export.Pdf.PDFExport();
report.Export(pdf, "c:\\return.pdf");

System.ArgumentOutOfRangeException: 인덱스가 범위를 벗어났습니다. 인덱스는 음수가 아니어야 하며 컬렉션의 크기보다 작아야 합니다.
매개 변수 이름: index
위치: System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
위치: System.ThrowHelper.ThrowArgumentOutOfRangeException()
위치: System.Collections.Generic.List`1.set_Item(Int32 index, T value)
위치: FastReport.Export.Pdf.PDFExport.WriteFont(ExportTTFFont pdfFont)
위치: FastReport.Export.Pdf.PDFExport.AddPDFFooter()
위치: FastReport.Export.Pdf.PDFExport.Finish()
위치: FastReport.Export.ExportBase.Export(Report report, Stream stream)
위치: FastReport.Export.ExportBase.Export(Report report, String fileName)
위치: FastReport.Export.ExportBase.Export(Report report)
위치: FastReport.Preview.PreviewControl.Export_Click(Object sender, EventArgs e)

Comments

  • edited 9:11AM
    make sure drive c is allowed to create file (folder security in windows o/s), try another drive, d:\xxx.pdf
  • The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method. Indexing an empty list will always throw an exception. Use a method like Add to append the item to the end of the list, or Insert to place the item in the middle of the list somewhere, etc. You cannot index into a C# list if that offset doesn't exist.

    Typically, an ArgumentOutOfRangeException results from developer error. Instead of handling the exception in a try/catch block, you should eliminate the cause of the exception or, if the argument is returned by a method call or input by the user before being passed to the method that throws the exception, you should validate arguments before passing them to the method.

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.