Doubt about quickreport

Hello guys

I have 4 bands in my report:

1 pageheader
1 pagefooter
1 Title
1 detail

I want to do this:

In my first page, only the title must appear, it must appear in all page, that is, the heigh must be all page. After printing the first page (pagefooter) in the second page I will print the pageheader, detail and pagefooter.

My first question:
How can I size my pagetitle to have all page heigh?

Maybe there are another doubts but I need to see whether I am able to solve them  by my self

thanks

LVL 1
hidrauAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hidrauAuthor Commented:
I also have another doubt that I haven't been able to solve it yet.

How can I start printing Pageheader - detais - pageFooter from the second page?

Thanks
bokistCommented:
Try to play with  Quickrep1.PageNumber and Bands.Height,  something like this :

procedure TForm1.Page_HeaderlBeforePrint(Sender: TQRCustomBand; var PrintBand: Boolean);
begin
  if Quickrep1.PageNumber >= 1  then   Quickrep1.Bands.PageHeaderBand.Height := some_height  // reduced hight
  else                                                      Quickrep1.Bands.PageHeaderBand.Height := some_height; // fill whole page  end;

procedure TForm1.DetailBeforePrint(Sender: TQRCustomBand; var PrintBand: Boolean);
begin
  PrintBand := Quickrep1.PageNumber >= 1;
end;

procedure TForm1.Page_FooterBeforePrint(Sender: TQRCustomBand; var PrintBand: Boolean);
begin
  PrintBand := Quickrep1.PageNumber >= 1;
end;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bokistCommented:
Try to play with  Quickrep1.PageNumber , something like this :

procedure TForm1.Page_HeaderlBeforePrint(Sender: TQRCustomBand; var PrintBand: Boolean);
begin
  if Quickrep1.PageNumber >= 1  then   Quickrep1.Bands.PageHeaderBand.Height := some_height  // reduced hight
  else                                                      Quickrep1.Bands.PageHeaderBand.Height := some_height; // fill whole page  end;

procedure TForm1.DetailBeforePrint(Sender: TQRCustomBand; var PrintBand: Boolean);
begin
  PrintBand := Quickrep1.PageNumber >= 1;
end;

procedure TForm1.Page_FooterBeforePrint(Sender: TQRCustomBand; var PrintBand: Boolean);
begin
  PrintBand := Quickrep1.PageNumber >= 1;
end;

PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

bokistCommented:
Sorry, by mistake I send my comment twice.
hidrauAuthor Commented:
I tried but it didn't print the header and footer and the details from the second band, it started printing from the first. Have you ever tried this?
object FRelLivroVale: TFRelLivroVale
  Left = 0
  Top = 0
  Width = 794
  Height = 1123
  Frame.Color = clBlack
  Frame.DrawTop = False
  Frame.DrawBottom = False
  Frame.DrawLeft = False
  Frame.DrawRight = False
  DataSet = ADOQuery1
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -13
  Font.Name = 'Arial'
  Font.Style = []
  Functions.Strings = (
    'PAGENUMBER'
    'COLUMNNUMBER'
    'REPORTTITLE')
  Functions.DATA = (
    '0'
    '0'
    '''''')
  Options = [FirstPageHeader, LastPageFooter]
  Page.Columns = 1
  Page.Orientation = poPortrait
  Page.PaperSize = A4
  Page.Values = (
    100.000000000000000000
    2970.000000000000000000
    100.000000000000000000
    2100.000000000000000000
    100.000000000000000000
    100.000000000000000000
    0.000000000000000000)
  PrinterSettings.Copies = 1
  PrinterSettings.Duplex = False
  PrinterSettings.FirstPage = 0
  PrinterSettings.LastPage = 0
  PrinterSettings.OutputBin = Auto
  PrintIfEmpty = True
  SnapToGrid = True
  Units = MM
  Zoom = 100
  object QRBand1: TQRBand
    Left = 38
    Top = 118
    Width = 718
    Height = 83
    Frame.Color = clBlack
    Frame.DrawTop = False
    Frame.DrawBottom = False
    Frame.DrawLeft = False
    Frame.DrawRight = False
    AlignToBottom = False
    BeforePrint = QRBand1BeforePrint
    Color = 13828095
    ForceNewColumn = False
    ForceNewPage = False
    Size.Values = (
      219.604166666666700000
      1899.708333333333000000)
    BandType = rbTitle
    object QRLabel3: TQRLabel
      Left = 288
      Top = 24
      Width = 67
      Height = 33
      Frame.Color = clBlack
      Frame.DrawTop = False
      Frame.DrawBottom = False
      Frame.DrawLeft = False
      Frame.DrawRight = False
      Size.Values = (
        87.312500000000000000
        762.000000000000000000
        63.500000000000000000
        177.270833333333300000)
      Alignment = taLeftJustify
      AlignToBand = False
      AutoSize = True
      AutoStretch = False
      Caption = 'Titulo'
      Color = clWhite
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -27
      Font.Name = 'Arial'
      Font.Style = []
      ParentFont = False
      Transparent = False
      WordWrap = True
      FontSize = 20
    end
  end
  object PGcab: TQRBand
    Left = 38
    Top = 38
    Width = 718
    Height = 80
    Frame.Color = clBlack
    Frame.DrawTop = False
    Frame.DrawBottom = False
    Frame.DrawLeft = False
    Frame.DrawRight = False
    AlignToBottom = False
    BeforePrint = PGcabBeforePrint
    Color = clBlue
    ForceNewColumn = False
    ForceNewPage = False
    Size.Values = (
      211.666666666666700000
      1899.708333333333000000)
    BandType = rbPageHeader
    object QRLabel1: TQRLabel
      Left = 288
      Top = 24
      Width = 125
      Height = 33
      Frame.Color = clBlack
      Frame.DrawTop = False
      Frame.DrawBottom = False
      Frame.DrawLeft = False
      Frame.DrawRight = False
      Size.Values = (
        87.312500000000000000
        762.000000000000000000
        63.500000000000000000
        330.729166666666700000)
      Alignment = taLeftJustify
      AlignToBand = False
      AutoSize = True
      AutoStretch = False
      Caption = 'cabeçalho'
      Color = clWhite
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -27
      Font.Name = 'Arial'
      Font.Style = []
      ParentFont = False
      Transparent = False
      WordWrap = True
      FontSize = 20
    end
  end
  object PGrod: TQRBand
    Left = 38
    Top = 230
    Width = 718
    Height = 72
    Frame.Color = clBlack
    Frame.DrawTop = False
    Frame.DrawBottom = False
    Frame.DrawLeft = False
    Frame.DrawRight = False
    AlignToBottom = False
    BeforePrint = PGrodBeforePrint
    Color = 8421631
    ForceNewColumn = False
    ForceNewPage = False
    Size.Values = (
      190.500000000000000000
      1899.708333333333000000)
    BandType = rbPageFooter
    object QRLabel2: TQRLabel
      Left = 312
      Top = 24
      Width = 96
      Height = 33
      Frame.Color = clBlack
      Frame.DrawTop = False
      Frame.DrawBottom = False
      Frame.DrawLeft = False
      Frame.DrawRight = False
      Size.Values = (
        87.312500000000000000
        825.500000000000100000
        63.500000000000000000
        254.000000000000000000)
      Alignment = taLeftJustify
      AlignToBand = False
      AutoSize = True
      AutoStretch = False
      Caption = 'Rodapé'
      Color = clWhite
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -27
      Font.Name = 'Arial'
      Font.Style = []
      ParentFont = False
      Transparent = False
      WordWrap = True
      FontSize = 20
    end
  end
  object PGdetails: TQRBand
    Left = 38
    Top = 201
    Width = 718
    Height = 29
    Frame.Color = clBlack
    Frame.DrawTop = False
    Frame.DrawBottom = False
    Frame.DrawLeft = False
    Frame.DrawRight = False
    AlignToBottom = False
    BeforePrint = PGdetailsBeforePrint
    Color = clWhite
    ForceNewColumn = False
    ForceNewPage = False
    Size.Values = (
      76.729166666666680000
      1899.708333333333000000)
    BandType = rbDetail
    object QRLabel4: TQRLabel
      Left = 8
      Top = 8
      Width = 26
      Height = 17
      Frame.Color = clBlack
      Frame.DrawTop = False
      Frame.DrawBottom = False
      Frame.DrawLeft = False
      Frame.DrawRight = False
      Size.Values = (
        44.979166666666670000
        21.166666666666670000
        21.166666666666670000
        68.791666666666680000)
      Alignment = taLeftJustify
      AlignToBand = False
      AutoSize = True
      AutoStretch = False
      Caption = 'Item'
      Color = clWhite
      Transparent = False
      WordWrap = True
      FontSize = 10
    end
    object QRDBText1: TQRDBText
      Left = 72
      Top = 8
      Width = 60
      Height = 17
      Frame.Color = clBlack
      Frame.DrawTop = False
      Frame.DrawBottom = False
      Frame.DrawLeft = False
      Frame.DrawRight = False
      Size.Values = (
        44.979166666666670000
        190.500000000000000000
        21.166666666666670000
        158.750000000000000000)
      Alignment = taLeftJustify
      AlignToBand = False
      AutoSize = True
      AutoStretch = False
      Color = clWhite
      DataSet = ADOQuery1
      DataField = 'CT_PECA'
      Transparent = False
      WordWrap = True
      FontSize = 10
    end
  end
  object ADOQuery1: TADOQuery
    Active = True
    ConnectionString = 
      'Provider=SQLNCLI.1;Password=cj2492;Persist Security Info=True;Us' +
      'er ID=sa;Initial Catalog=TRATOR;Data Source=10.10.1.15\sql2005'
    CursorType = ctStatic
    Parameters = <>
    SQL.Strings = (
      'select * from vale_contrato_itens'
      'where ct_id_contrato=25')
    Left = 608
    Top = 352
  end
end

---------------------------------------------------------------------
.pas
unit RelLivroVale;

interface

uses Windows, SysUtils, Messages, Classes, Graphics, Controls,
  StdCtrls, ExtCtrls, Forms, QuickRpt, QRCtrls, DB, ADODB;

type
  TFRelLivroVale = class(TQuickRep)
    QRBand1: TQRBand;
    PGcab: TQRBand;
    PGrod: TQRBand;
    QRLabel1: TQRLabel;
    QRLabel2: TQRLabel;
    QRLabel3: TQRLabel;
    PGdetails: TQRBand;
    QRLabel4: TQRLabel;
    QRDBText1: TQRDBText;
    ADOQuery1: TADOQuery;
    procedure QRBand1BeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);
    procedure PGdetailsBeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);
    procedure PGcabBeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);
    procedure PGrodBeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);
  private
      v: Boolean;
  public

  end;

var
  FRelLivroVale: TFRelLivroVale;

implementation

{$R *.DFM}

procedure TFRelLivroVale.QRBand1BeforePrint(Sender: TQRCustomBand; var PrintBand: Boolean);
begin
  QRBand1.Height := 800; // This is my pageTitle
end;

procedure TFRelLivroVale.PGdetailsBeforePrint(Sender: TQRCustomBand; var PrintBand: Boolean);
begin
  V := FRelLivroVale.PageNumber >1;
  PrintBand := V
end;

procedure TFRelLivroVale.PGcabBeforePrint(Sender: TQRCustomBand;
  var PrintBand: Boolean);
begin
  V := FRelLivroVale.PageNumber >1;
  PrintBand := V
end;

procedure TFRelLivroVale.PGrodBeforePrint(Sender: TQRCustomBand;
  var PrintBand: Boolean);
begin
  V := FRelLivroVale.PageNumber >1;
  PrintBand :=   V
end;

end.

Open in new window

hidrauAuthor Commented:
I tried to use >=1 and the last > 1

bokistCommented:
Sorry, where I'm now  Delphi is not installed  - I will test the code tomorrow morning.
hidrauAuthor Commented:
Ok, I will wait friend, do you believe that I have tried many things and nothing up to now
hidrauAuthor Commented:
Hi bokist:

I figured out how to make it :)

I used your clue and I added in the event of after print of the title this option:

quickreport1.newpage

And It worked very fine

Thanks for you help even though
hidrauAuthor Commented:
thanks
bokistCommented:
Hi hidrau!
Glad to helped a wee bit.
Thank's for the points.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.