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

GET REPORT OUTPUT WITHOUT PRINTING REPORT

edited January 2002 in General
Hello All:

I cannot use ReportBuilder to print custom reports under Windows 2000/XP
due to buggy printer drivers.

I have written a routine which uses the API to bypass the printer driver
via escape codes and sends the report directly to the printer.

I can loop through the report and get the datafields and positions. That
works great. However, I cannot do that with TppVariables.

How can I get the output of the TppVariables without sending the report
to the Printer ???

Is there any other way to do this other than sending the report to a
file ???


Thank you


Neil Huhta
Profit Monster Data Systems LLC

Comments

  • edited January 2002
    You are looping through the report output TppPages, or do you have your own
    report engine?

    You are bypassing the printer driver with escape codes? We are intereseted
    in seeing how this is done.

    You can create a device and print the pages to a cache in memory, without
    sending them to the preview:

    procedure PrintToCache;
    var
    lDevice: TppDevice;
    begin

    lDevice := TppDevice.Create(Self);
    lDevice.PageSetting := psLastPage;
    lDevice.Publisher := ppReport1.Publisher;

    ppReport1.CachePages := True;
    ppReport1.PrintToDevices;

    lDevice.Free;
    end;

    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2002
    Jim:

    I have developed a routine which allows you to specify the escape codes
    which control horizontal movement and vertical movement. Next you specify a
    precision such as 1/60 for vertical and 1/216 for horizontal. In addition,
    you need to specify some font and justification info.

    The routine connects to the printer through the WriteSpool/PrintSpool
    API's and loops through the report printing the objects.

    Basically, the top and left margin are truncated to the nearest
    precision supported by the escape codes for the printer, the print head is
    positioned, the font is set, and the DBText is printed.

    Since most dot matrix printers support very fine precision and IBM/Epson
    emulations are very prevelent, it is possible to print custom paper sizes on
    many printers which would choke the printer drivers.

    I am still in development with it, but I'll send you some code in the
    next few days. You could take these routines, incorporate them into
    ReportBuilder, and offer a RawPrint option for all text based reports. The
    user would need to be able to build a small library of escape codes ( say
    5-8 codes per printer type ). The user would then indicate which set of
    codes was to be used and away they go.

    Let me know what you think.


    Neil Huhta
  • edited January 2002
    How are your generating the pages of the report?

    We aren't very familiar with escape sequences. When you get it working let
    us know how it works out.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.