TExtraDevices 2.53 and RB 7 for D5
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
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
This discussion has been closed.
Comments
Can you try another device to see if it happens for all devices.
James Waler
Waler Ltd
http://www.waler.com
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
QuoteReport.AllowPrintToFile := True;
QuoteReport.DeviceType := 'PDFFile';
QuoteReport.TextFileName := 'test.pdf';
QuoteReport.ShowPrintDialog := False;
QuoteReport.Print;
Jim
James Waler
Waler Ltd
http://www.waler.com
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
James Waler
Waler Ltd
http://www.waler.com
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
James Waler
Waler Ltd
http://www.waler.com
(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
James Waler
Waler Ltd
http://www.waler.com