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

Problem printing to dot matrix printer

edited October 2005 in General

I have a problem printing to a dot matrix printer:

We have 2 users sharing the same dot matrix printer to print 2 diferent
forms on continous page:

User 1 use one application with name "A.exe" and a form with the following
sizes:
SMALL form:
Width: 8.5 inches
Height: 5.5 inches
Detail Band Height: 4.9583 inches

User 2 use one application with name "B.exe" and a form with the following
sizes:
BIG form:
Width: 8.5 inches
Height: 9.375 inches
Detail Band Height: 7.7812 inches

Problem:
If at the beginning of the day the User 1 print the SMALL form with the
"A.exe" application when
User 2 print the BIG form with the "B.exe" application RB, sends an
infinite loop of blank
pages. We have to click on the cancel button and then terminate the
print job.

No problem:
If at the beginning of the day the User 2 print the BIG form with the
"B.exe" application when the
User 1 print the SMALL form with the "A.exe" application RB send the
reports correctly and then the next
report of any one of the two reports in any order are print correctly.

Note1: We are using Delphi 5, Report Builder 7.04, Windows Xp Professional &
Pinter Epson LX-300.

Note 2: The name of the apliccation have to be different "A.exe" & "B.exe";
if the name is the same
the problem does not happen.

What can I do to solve the problem?

Thanks

Ing. Jairzinhio Pacheco Villarreal

Comments

  • edited October 2005
    Hi Jairzinhio,

    We have not seen this behavior before directly related to ReportBuilder. It
    seems as though some of the resourses created in your first application are
    not being propertly disposed of when the application is closed. Either this
    or something is not resetting correctly in your printer driver. How do your
    applications interact with ReportBuilder? Are you making simple calls to
    Report.Print or are you manually creating the report objects. Are you
    loadng templates? Is your application following the guidelines described in
    the Continuous Paper article (below)?

    ----------------------------------------------------
    Article: Printing to Continuous Paper
    ----------------------------------------------------

    1. Layout

    For continuous printing (for example a receipt) use Title/Summary and
    removing the Header/Footer. Set the PrintHeight of each to phDynamic. Layout
    the DetailBand to print a single line item. Set the margins to 0 or to the
    smallest that the printer driver will support (some printers have an
    unprintable area).

    With this configuration The Report will generate a Title followed by a
    variable number of Detail bands that span pages if needed, and then finally
    print a Summary at the end.

    2. Pagination

    a. dtPrinter

    Some printer drivers have a continuous paper size setting. If not then try
    setting the paper size to be very small - perhaps the size of the tallest
    band in the layout. Or try setting the page height to be the size of a
    detail band. Note that some printer drivers will only accept page sizes
    within a certain range of paper sizes.

    b. dtReportTextFile

    With the above layout, the report text file will generate the page breaks
    properly, however the device will fill up a page with blank lines. You can
    control the number of lines per page by configuring the CharacterGrid
    property in the Report.BeforePrint event:

    example:


    procedure TForm1.ppReport1BeforePrint(Sender: TObject);
    var
    lDevice: TppReportTextFileDevice;
    begin

    if (ppReport1.FileDevice <> nil) and (ppReport1.FileDevice is
    TppReportTextFileDevice)then
    begin
    lDevice := TppReportTextFileDevice(ppReport1.FileDevice);

    {120 characters per line, 66 lines per page}
    lDevice.CharacterGrid(120, 66);
    end;

    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2005
    The application "A.exe" & "B.exe" are the same application with two
    buttons "small" & "big" then

    I built the "A.Exe" and then copy paste the "A.exe" and rename to the copy
    to "B.Exe"
    then I run the A.exe and click the Button "small" (Report1.Print) then run
    the
    application "B.exe" and click the button "big" (Report2.Print). Then it
    loops.

    My application iteracts with RB very easy
    In my application I have 2 reports components with
    the two different sizes of reports. (No loading templates, no creating
    report objets, simple Report.print).

    I can send to you the application if you want.... but is easy to reproduce
    the error.

    Thanks...


  • edited November 2005
    Hi Jairzinhio,

    If possible, please send a small example demonstrating the problem along
    with step-by-step instructions on how to recreate it on my machine. Send
    the example in .zip format to support@digital-metaphors.com.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2005
    Hi!, before I send to you the application I have a cuestion.

    I made another example with Report explorer, Report designer, Report,etc.
    all that you use to End user application
    & I made the same 2 reports and the problem still happen with two
    application with different name, etc, etc, etc.

    but I notice that if I send to the prinet the "small" form (on app1.exe) and
    then go to the report explorer & I open the "big" form
    the without modify any thing I click "File ->Save" (I think this restart the
    prinetr driver) then I go to the app2.exe and send
    the "big" form & is printer very well.

    Could you tell me what is the instruction that you use in the "File--> Save"
    that restar the printer driver?

    Can I add that instruction to my application to simulate the "File-->Save"
    of the report designer?

    Thanks


  • edited November 2005
    Hi Jairzinhio,

    ReportBuilder does not interact with the printer driver directly. It simply
    makes generic Windows API calls that in turn communicate with your printer
    driver and then to your printer.

    Are you saving to file or database? You can view the source to save a
    template in the ppTmplat.pas file (SaveToSource procedure).

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.