Home General

Intermittent Endless Pages Printing

edited August 2001 in General
Hello All:

We just upgraded to Delphi 5/ReportBuilder 6.01. The conversion has gone
well. However, some of our customers are having a problem in one area - the
inventory report. Prior to the upgrade, we never had a problem with this
client.

The inventory report is entirely created in code. When we test the
inventory report, it does not produce endless pages on any combination of
our printers or computers. The report previews great - it just wont print at
the printer.

However, it is happening at one of our client's sites on all of their
computers.

We have read the tech memo on endless printer pages. My guess is that
somehow, the bands and the margins are exceeding the papersize.

The report has a headerband height 0.95
detailband height 0.13 - 0.50 controlled by
the user
footerband height 0.60



Our routine creates a ppReportcomonents, the bands, then places labels
and DBText components on the bands, then prints the report.

We never actually specify the papertype of paper size ( we let the
creation place in default values ). Our code is listed below.

Can anybody offer any suggestions ???


Neil Huhta





begin
MyReport:=TppReport.Create(Self);
MyReport.DataPipeLine:= MyPipeLine;
If Uppercase(TBMemReportsPreview.Value)='D' Then
MyReport.Device:=dvprinter;
If Uppercase(TBMemReportsOrientation.Value)='P' Then
MyReport.PrinterSetup.Orientation:=poPortrait
Else
MyReport.PrinterSetup.Orientation:=poLandScape;


TheHeaderBand:=TppHeaderBand.Create(Self);
TheHeaderBand.Report:=MyReport;
TheHeaderBand.Height:=0.95;
TheHeaderBand.Name:='NHHeaderBand'+Inttostr(NumReports);


MyWidth:=MyReport.PrinterSetup.PaperWidth-MyReport.PrinterSetup.MarginLeft-
MyReport.PrinterSetup.MarginRight;

MyLabel:= TppLabel.Create(Self);
MyLabel.Band:=TheHeaderBand;
MyLabel.Font.Name:='Courier New';
MyLabel.Font.Size:=10;
MyLabel.Font.Style:=MyLabel.Font.Style+[fsBold];
MyLabel.Caption:=Datamodule1.TBCompanyDealerName.Value;
MyLabel.Left:=(MyWidth-MyLabel.Width)/2;
MyLabel.Top:=0.05;

TheDetailBand:=TppDetailBand.Create(Self);
TheDetailBand.Report:=MyReport;
TheDetailBand.Height:=0.25;
If (TBMemReportsBandHeight.Value>0) Then
begin
If TBMemReportsBandHeight.Value>=0.1299 Then
TheDetailBand.Height:=TBMemReportsBandHeight.Value
Else
TheDetailBand.Height:=0.13;
end;
TheDetailBand.Name:='NHDetailBand'+Inttostr(NumReports);


TheFooterBand:=TppSummaryBand.Create(Self);
TheFooterBand.Report:=MyReport;
TheFooterBand.Height:=0.60;
TheFooterBand.Name:='NHFooterBand'+Inttostr(NumReports);
MyReport.Name:='NHReport'+IntToStr(NumReports);
Available:=MaxAvail;

end;

Comments

  • edited August 2001
    Check the printer driver's unprintable area. Perhaps this is larger than the
    margins you are trying to use in the report.

    Have you changed this inventory report from your previous version that the
    client was using? If a static height component in the detail band doesn't
    fit on any available page, then you'll get infinite pages. Do you have any
    components which could cause this? Where do you set the height of the
    dbTexts? Are there any shapes/lines created in the band? Sounds like the
    detail band has a static height which is too large to fit on a single page.
    The best guess probably is that the margins you are using in your
    calculations are too small than what is actually needed for this printer.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.