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

"Unable to open file: ."

edited April 2002 in General
Hi,

Could someone tell me if this should work - or if there is a better
way? Thanks..

I have a simple report, that needs to be printed 3 times, with
slightly different label for each of the 3 prints.
I only want the print dialog to appear the first time, as the other
two prints will be to the same printer.

I've tried to do this as

ppReport1.ShowPrintDialog := TRUE;
ppLabel1.Caption := 'Delivery Note - PP Copy';
pplabel2.Visible := TRUE;
ppLabel9.Visible := FALSE;
ppLabel10.Visible := TRUE;
ppReport1.Print;
ppReport1.ShowPrintDialog := FALSE;
ppLabel1.Caption := 'Delivery Note - Haulier Copy';
ppLabel9.Visible := TRUE;
ppReport1.Print;
ppLabel1.Caption := 'Delivery Note - Customer Copy';
ppReport1.Print;

The print dialog appears the first time, and the report prints
straight to the printer.
Then it shows two errors "Unable to open file ." and the second and
third copies do not print.

Any ideas, or should I be doing this another way?

Thanks,
Ian

Comments

  • edited April 2002
    Set the Report.SavePrinterSetup property to true. This should save the
    printer setup from the first print dialog and apply it to the second and
    thrid reports. This might be the problem. The report will use the default
    printer setup object each time the report is printed, unless
    SavePrinterSetup is true. The saving is not persistent, as it only exists
    until the report object is freed..


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited April 2002
    Hi,

    I saw this property and thought it would do the trick, but no - still
    get the same error.

    Any further suggestions greatly appreciated.

    Thanks,
    Ian
  • edited April 2002
    I'll send you a v6.03 patch which fixes one problem related to comparing the
    printer setup, which may be the cause.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.