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

HP Officejet Pro série 8000 - A809 Blues and RB9.03

edited January 2010 in General
Hi,

I compiled a D7 application with RB9.03 that is working perfectly against an HP
600. The user has to change his printer and got an HP Officejet Pro serie 8000 -
A809.
All the reports, except one, are printing without any problems.
This one report in particular has a custom defined page.
PaperHeight = 89.916
PaperWidth = 177.8
Units = utMillimeters
PaperName = Custom
Orientation = poLandscape

The printer tray has to be adjusted to fit this paper. The only difference is
the HP 8000 the tray guide is centered (in HP600 the tray guide was set all the
way to the right).
The HP 8000 gets the paper, the header moves as if it was printing something.
But the paper comes out blank. It gave me the impression that the printing is
taking place outside the printing area.

The report is very simple: Nothing on the Header band. Nothing on the Footer
band. 7 TppDBLabels on the detail band.

Some settings are adjusted at run-time. Ex: The user can set the
HeaderBand.Height up to 15 mm. And he can also adjust every component on the
detail band. The allowed adjustment is +/- 20mm.
I'm reading each label position from a table.
Those values have not changed from one printer to the other.
Another thing. The margins (PrinterSetup.MarginBottom,Left,Right,Top) are zero.

Any ideas what's going on?

TIA,
Clément

Here is the code :

PrtName := ReadFromIni_Printer_Default;
if PrtName<>'' then begin
rptChequeFrente.PrinterSetup.PrinterName := PrtName;
rptVerso.PrinterSetup.PrinterName := PrtName;
end;

// Getting paper.
rptChequeFrente.PrinterSetup.PaperName := ReadFromIni_Printer_DefaultPaper;
rptVerso.PrinterSetup.PaperName := ReadFromIni_Printer_DefaultPaper;

rptChequeFrente.PrinterSetup.PaperHeight :=
Layout.Fieldbyname('num_PagH').AsFloat;
rptChequeFrente.PrinterSetup.PaperWidth :=
Layout.Fieldbyname('num_PagW').AsFloat;

rptVerso.PrinterSetup.PaperHeight :=
Layout.Fieldbyname('num_PagH').AsFloat;
rptVerso.PrinterSetup.PaperWidth :=
Layout.Fieldbyname('num_PagW').AsFloat;

// Showing up the paper used. It always says Custom
rptChequeFrente.PrinterSetup.DocumentName := 'Impressão de cheque -
'+rptChequeFrente.PrinterSetup.PaperName;
rptVerso.PrinterSetup.DocumentName := 'Impressão de cheque -
'+rptVerso.PrinterSetup.PaperName;

rptVerso.PrinterSetup.MarginLeft :=
Layout.Fieldbyname('num_marEsq').AsFloat;
rptVerso.PrinterSetup.MarginTop :=
Layout.Fieldbyname('num_marSup').AsFloat;
rptVerso.PrinterSetup.MarginRight :=
Layout.Fieldbyname('num_marDir').AsFloat;
rptVerso.PrinterSetup.MarginBottom :=
Layout.Fieldbyname('num_marInf').AsFloat;

rptChequeFrente.PrinterSetup.MarginLeft :=
Layout.Fieldbyname('num_marEsq').AsFloat;
rptChequeFrente.PrinterSetup.MarginTop :=
Layout.Fieldbyname('num_marSup').AsFloat;
rptChequeFrente.PrinterSetup.MarginRight :=
Layout.Fieldbyname('num_marDir').AsFloat;
rptChequeFrente.PrinterSetup.MarginBottom :=
Layout.Fieldbyname('num_marInf').AsFloat;

rptChequeFrente.HeaderBand.Height :=
Layout.Fieldbyname('num_HeaderHeight').AsFloat;
rptVerso.HeaderBand.Height :=
Layout.Fieldbyname('num_HeaderHeight').AsFloat;

rptVerso.PrinterSetup.MarginLeft :=
Layout.FieldByName('num_OffLeftVerso').AsFloat;

ppValor.Top := Layout.Fieldbyname('num_OffTopValor').AsFloat -
ppValor.Height;
ppValor.Left := Layout.Fieldbyname('num_OffLeftValor').AsFloat;

ppExtenso.Top := Layout.Fieldbyname('num_OffTopExt').AsFloat -
Layout.FieldByName('num_ExtHeight').AsFloat;
ppExtenso.Left := Layout.Fieldbyname('num_OffLeftExt').AsFloat;
ppExtenso.Height := Layout.FieldByName('num_ExtHeight').AsFloat;
ppNominal.Top := Layout.Fieldbyname('num_OffTopNome').AsFloat -
ppNominal.Height;
ppNominal.Left := Layout.Fieldbyname('num_OffLeftNome').AsFloat;

ppCidade.Top := Layout.Fieldbyname('num_OffTopData').AsFloat -
ppCidade.Height;
ppDia.Top := Layout.Fieldbyname('num_OffTopData').AsFloat -
ppDia.Height;
ppMes.Top := Layout.Fieldbyname('num_OffTopData').AsFloat -
ppMes.Height;
ppAno.Top := Layout.Fieldbyname('num_OffTopData').AsFloat -
ppAno.Height;

ppCidade.Left := Layout.Fieldbyname('num_OffLeftCidade').AsFloat;
ppDia.Left := Layout.Fieldbyname('num_OffLeftDia').AsFloat;
ppMes.Left := Layout.Fieldbyname('num_OffLeftMes').AsFloat;
ppAno.Left := Layout.Fieldbyname('num_OffLeftAno').AsFloat;


// printing
rptChequeFrente.Print;
rptVerso.Print;

Comments

  • edited February 2010
    Hi Clément,

    1. Do not set the margins to 0. Most printers have a non-printable area
    that can cause problems if printed into.

    2. Be sure all the components are within the custom paper size. You
    mention that you are adjusting settings in code. Try making these
    adjustments manually before printing the report as a test and see if that
    helps the issue.

    3. Are you able to print to this custom size paper from any other
    applications such as Word with these same specifications?

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2010
    Hi Nico,

    Will try to set to some other value.


    I'm sure the components are inside the printable area.


    I can get the margins settings from word. I'll try that.

    Thanks
  • edited February 2010


    I used word to correct the margins. In fact, setting the top margin and left
    margin to 0,33 cm (as reported by word), the report printed normally!

    Thanks for your help!
    Clément
This discussion has been closed.