Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick Report Bitmap problem 1

Status
Not open for further replies.

BorlandDave

Programmer
Jun 13, 2005
86
0
0
GB
Not sure if this is a very good place to post my question, but I'll give it a try anyway.

I've got a quick report form with various TQRLabels and a TQRImage. The TQRImage is to have a screen-dump bitmap assigned to it. I have coded this as follows...

Graphics::TBitmap *FormImage = GetFormImage();
QRImage1->Picture->Assign(FormImage );

However, when printed, the form displays all the TQRLabels but not the TQRImage. But I have tested the program on other computers and it works fine. Seems to be an intermittant problem.

Can anyone help?
 
I've not used QR for screen dumps so I can't say how that works but just out of curiosity, what version(s) of Windows are on the computers that work and on the computers that don't work? Could it be a service pack issue?


James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
Maybe... the computers that don't work are XP SP2 and 2000 SP4. It works on an XP SP1 computer. If this is the problem, what is the way round it?
 
You could try Quick Reports site ( They have their knowledge base available for download.


James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
Just a quick look around on Google and I have dicovered that the problem most likley is SP2 and not Quick Reports. Numerous people have had problems printing images after installing SP2 and not just with Quick Reports. The two most common answers seem to be updating printer drivers and download a MS patch.

Seems that SP2 by default doesn't print web page images with Active-X installed but there are some bugs that make SP2 look at other images as though they had Active-X installed when they don't.


James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
Would you mind posting a link regarding the SP2 patch? I've been searching round google and can't find anything.

Cheers.
 
It's going to depend on the error you get in the error log file. Here are a few sites that might or might not help:

Without knowing the specific error, it's hard to say. Have you tried posting or searching for the general question of "SP2 printing errors" in the Windows XP forum here?


James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
Ok, here's a funny thing...

I've changed the program to call Preview() instead of Print() to bring up the preview window. The preview shows up correctly with all labels and the image in tact.

When simply clicking straight on the print icon, the problem remaines with all labels printing ok but not the image. BUT... if I click the save icon and save the report to a tempory location, and then open it straight back up again, and then click the print icon... the report prints out in its entirety!

Is this a problem with quick report which is out of my hands, or is there something I can do to correct it.

Cheers.
 
Bizarre, very bizarre. I wonder is QR is doing something that SP2 doesn't like. I didn't see anything at their site about it. Can you print from the preview?


James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
I can only print from the preview if I first save the report, then open it back up again, then print it. If I try to print from the initial preview, the image does not print.

I'm thinking maybe I could create a custom preview window which would do this process invisible. When the user clicks print, the program saves-opens-prints. I know this is hardly a satisfactory fix, but would get the job done for now.
 
Ummm... I'm struggling to find the code to save/open quick report files :)
 
BTW which version of QR are you using?


James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
To force the metafile print you can set the report.qrprinter.master property to nil in the BeforePrint event of the summary band. If you don't need a summary and, you can set PrintBand to false in that event."

How can I set report.qrprinter.master property to nil when I'm using C++ and nil is a delphi-only keyword?
 
Appologies for the consecutive posts, but I thought I'd keep up-to-date with my progress incase anyone else has this problem. So far I've managed to print the reports properly using the following code...

QuickRep1->Prepare();
QuickRep1->QRPrinter->Save("C:\\Temp.qrp");
QuickRep1->QRPrinter->Load("C:\\Temp.qrp");
QuickRep1->QRPrinter->PreviewModal();
remove("C:\\Temp.qrp");

But... I've since realised the contents of my TRichEdit fields are printing blank. I could swap out all my TRichEdit fields for TPanels, but I'll have a go at fixing the problem first. I'll post in this thread how I get on.
 
Good luck!


James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
Well it turns out there is a bug with the GetFormImage() function. It unfortunately renders some form controls blank. So this is out of my hands until Borland fixes the problem! So I've resorted to the long-winded plan-B of swapping all my TRichEdit controls for TPanels.

My printing now works as it should. Thanks for the help 2ffat, its much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top