test

progging - To wander about and beg; to seek food or other supplies by low arts; to seek for advantage by mean shift or tricks.
progging - Programmer slang for writing computer code.

tirsdag 30. august 2011

Print/Preview of Quick Report problem

While testing some code that creates a Quick Report with a TeeChart on it, I changed the Print() call to a PreviewModal(). All though this seems to work at first, two problems occurred.

  1. The second time I clicked to see the preview dialog, the report did not show (only some black blocks)
  2. When I closed the application, I got several error messages.
Calling Preview() instead seem to fix the problem. Not sure what the problem was but this is from the QReport documentation:
Prepare
procedure Prepare.
Use ‘Prepare’ if you want to generate a report without automatically bring up a preview window or print it.
Preview
procedure Preview
Use ‘Preview’ to generate the report and bring up an on screen preview of it. From the preview window the user can choose to print the report.
PreviewModal
procedure PreviewModal
As Preview with the following differences -
When calling PreviewModal the report is generated in a background thread. Some database drivers are not thread safe and this might cause unexpected behavior or program crashes. Only use PreviewModal in situations where it is sure that a thread safe database driver will be used.

Ingen kommentarer:

Legg inn en kommentar