Home Devices
New Blog Posts: Merging Reports - Part 1 and Part 2

Print to PDF

edited March 2009 in Devices
Hello all,

When I set DeviceType=dtPDF I get the error 'List index out of bonds (0)'
but everything works great with DeviceType=dtScreen or DeviceType=dtPrinter.

Whe had no problems with the same code back in Delphi7 and RB9.

Thans in Advance,
Antonio

Comments

  • edited March 2009
    Just forgot to mention that I´m using TurBoDelphi and RB 10.07


  • edited March 2009
    Hi Antonio,

    Are you using the built-in PDF device or a third party device? Is there
    anywhere in your code you could be unregistering a file device?

    In my testing with the latest version of ReportBuilder and Delphi 2006, the
    following code compiled and exported a report to PDF successfully. Try
    updating your version of ReportBuilder to 10.09 and see if that helps the
    issue. Contact info@digital-metaphors.com for updating instructions.

    ppReport1.AllowPrintToFile := True;
    ppReport1.DeviceType := dtPDF;
    ppReport1.Print;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2009
    Hi Nico,

    I´m using the built-in PDF device. I had TExtraDevices but already
    uninstalled it.
    I'll try to update to RB10.09 and see if that helps.

    My code is:
    Report.TextFileName := SomeFile;
    Report.DeviceType := dtPDF;
    Report.AllowPrintToFile:=TRUE;
    Report.ShowPrintDialog:=FALSE;
    Report.ShowCancelDialog:=FALSE;
    Report.print.

    I do not have writen code that could unregister a file device but I would
    apreciate a hint on how can that occur and how can I debug such cases.

    António



  • edited March 2009
    Nico,

    Just found what the problem is.
    The report has a DBmemo with DBmemo.TextAligment=taFullJustified.
    if I change to DBmemo.TextAligment=taLeftJustified the problems does not
    occurs.
    This seams to be a bugy behavior of the RB.

    As a workarround I can change this property just when I need to export to
    PDF but the final result is not as it should be.
    Is this problem fixed in RB Enterprisee 11.03 ?
    How can I test it?

    Best regards,
    António



  • edited March 2009
    Hi Antonio,

    We do not currently have any issues with exporting full justified text to
    PDF in RB 11.03. The bug you are seeing was however fixed for 10.08 so
    upgrading to the latest RB 10 version (10.09) will fix the problem.

    I do suggest that you take a look at some of the new features the PDF device
    was given for RB 11 including vector graphic support (high quality RichText,
    Barcode, Teechart, MetaFile, etc.), embedded fonts and enhanced character
    encoding.

    http://www.digital-metaphors.com/rbWiki/General/What's_New/RB_11

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.