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

TExtraDevices 2.53 and RB 7 for D5

edited January 2003 in Devices
Hi,

I just recent upgrade to RB7 and Waler TExtraDevices 2.53. I am create a
report which I am export to an PDF File. If I just do the standard print, I
can export to any format like PDF and everythjing works just fine. If I try
using the following code (which used to work), I get an access violation
(00455105 at address 000002CC) when the Print command is passed:

QuoteFilename := GetDeskTopDir + 'Quote' +
OrderReportQueryQuoteNum.AsString + '_' +
OrderReportQueryQuoteRevision.AsString + '.pdf';
QuoteReport.DeviceType := 'PDFFile';
If FileExists(QuoteFilename) then
DeleteFile(QuoteFilename);
QuoteReport.TextFileName := QuoteFilename;
QuoteReport.ShowPrintDialog := False;
QuoteReport.Print;

The funny thing is, the PDF is still created, except the user has to click
cancel to the print process window. Any suggestion what could be wrong?

Thanks,
Tom Glunz
COMvantage Solutions
tom1970@attbi.com

Comments

  • edited January 2003
    Does it happen with just this report or any report?
    Can you try another device to see if it happens for all devices.

    James Waler
    Waler Ltd
    http://www.waler.com
  • edited January 2003
    James,

    The same thing happens with another report and with other devices. I tried
    with HTMLFile and ExcelFile- same results. If I print to screen then tell
    it one of these devices, everything works fine. Any other ideas?

    Thanks,
    Tom Glunz
    COMvantage Solutions
    tom1970@attbi.com

  • edited January 2003
    Try this to see if it has something to do with the file creation/naming:

    QuoteReport.AllowPrintToFile := True;
    QuoteReport.DeviceType := 'PDFFile';
    QuoteReport.TextFileName := 'test.pdf';
    QuoteReport.ShowPrintDialog := False;
    QuoteReport.Print;


    Jim
    James Waler
    Waler Ltd
    http://www.waler.com
  • edited January 2003
    James,

    I tried that and that didn't seem to work. It seems like it is the specific
    report because I create a simple report on the same form and that worked w/o
    the access violation. If I had the source to RB I would probably know a
    little more or I might even wrap the access violation in a try/except just
    so its hidden since it doesn't appear to effect the creation of the PDF (or
    other device). I just findf it strange that I don't get the A.V. if I
    preview the report and send it to a Export device for the preview dialog.
    Any other suggestions?

    I could send you my source to the project if that would help.

    Thanks,
    Tom Glunz
    COMvantage Solutions
    tom1970@attbi.com

  • edited January 2003
    Send me the report as a RB "print to archive" file for testing.

    James Waler
    Waler Ltd
    http://www.waler.com
  • edited January 2003
    FWIW I'm having a similar (or the same?) problem with TExtradevices 2.53,
    RB 7.01 and D6 SP2. No errors if I preview first then print to file. A/V's
    on PDF, Excel etc. if I don't preview first. The base file gets created but
    with nothing in it. It's as tho the plugin can't re-open the file again?

    Thanks - Jon Gray


  • edited January 2003
    Can you send me a demo project which has the AV?

    James Waler
    Waler Ltd
    http://www.waler.com
  • edited January 2003
    I attempted to create a demo project but it worked flawlessly of course!
    (Slick even) So I traced/stepped the error I was getting back from within
    my project and here are more details of what is creating the exception:

    "Project foobar.exe raised exception class EFCreateError with message
    "Cannot create file foobar.PDF'. Process stopped..."

    The debugger stops on line 1502 of TXtraDev: "MemStream :=
    TMemoryStream.Create;"

    The base foobar.pdf gets created with no pages in it. Again, everything
    works fine if previewed first.



    I could provide the whole project but I'm not sure you would want it.

    Delphi 6 SP2 / Waler 2.53 / RBuilder 7.01 with stock viewer and print
    dialog running client/server via rsClientReport loading the report from a
    database.

    Hope this helps! - Jon Gray


  • edited February 2003
    Send me the project!

    James Waler
    Waler Ltd
    http://www.waler.com
  • edited February 2003
    The project has been sent to your support Email address.

This discussion has been closed.