Footerband leaks available space
Hi,
The purpose to achieve is a report with all detail rows boxed in. The first
pages uses the footerband for the connecting line, the last page uses the
summaryband for the connecting line. I can't use pagestyles because i don't
know the exact postion the horizontal line has to be on all pages, unless i
set the report to twopass mode which slows down the report even more.
I have a main report with a subreport type sbChild on the main reports
detailband, on the childreports detailband I dropped 2 vertical tpplines
with parent height to True. On the main reports footerband I dropped a
horizontal tppline with top set to 0. The problem I have now that the
detailbands vertical lines don't connect to the footerbands horizontal line.
My childreport only contains a detailband for now (no title,header,summary
or footer). However when i create a drawcommand in the the main reports
footerband BeforeGenerate event with code mentioned below this line DOES
connect to the the detailbands vertical lines. This means that the
FooterBands 'normal' top starts below
ppFooterBand1.Report.Engine.PrintPosRect.Top because the horizontal tppline
dropped on the footerband with top 0 and position set to lpTop is drawn
below the line drawn with the drawcommand. Why does my first approach
doesn't work properly unless i use manual drawcommands, which i can't use in
the final design because it end user could change the design. So everything
has to work with dropped components on the report.
Greetings,
Filip Moons
procedure TForm2.ppFooterBand1BeforeGenerate(Sender: TObject);
var
AValue: integer;
ALine: TppDrawLine;
ADefaultTop: Integer;
ADefaultHeight: Integer;
begin
ALine := TppDrawLine.Create(Self);
ALine.Page := ppFooterBand1.Report.Engine.Page;
ALine.LinePosition := lpTop;
ALine.Weight := ppLine4.Weight;
ALine.Pen.Width := ppLine4.Pen.Width;
ALine.Pen.Color := ppLine4.Pen.Color;
ALine.Pen.Style := ppLine4.Pen.Style;
ALine.Top := ppFooterBand1.Report.Engine.PrintPosRect.Top;
ALine.Left :=
ppLine10.mmLeft+ppFooterBand1.Report.PrinterSetup.PageDef.mmMarginLeft;
ALine.Width := ppLine10.mmWidth;
end;
The purpose to achieve is a report with all detail rows boxed in. The first
pages uses the footerband for the connecting line, the last page uses the
summaryband for the connecting line. I can't use pagestyles because i don't
know the exact postion the horizontal line has to be on all pages, unless i
set the report to twopass mode which slows down the report even more.
I have a main report with a subreport type sbChild on the main reports
detailband, on the childreports detailband I dropped 2 vertical tpplines
with parent height to True. On the main reports footerband I dropped a
horizontal tppline with top set to 0. The problem I have now that the
detailbands vertical lines don't connect to the footerbands horizontal line.
My childreport only contains a detailband for now (no title,header,summary
or footer). However when i create a drawcommand in the the main reports
footerband BeforeGenerate event with code mentioned below this line DOES
connect to the the detailbands vertical lines. This means that the
FooterBands 'normal' top starts below
ppFooterBand1.Report.Engine.PrintPosRect.Top because the horizontal tppline
dropped on the footerband with top 0 and position set to lpTop is drawn
below the line drawn with the drawcommand. Why does my first approach
doesn't work properly unless i use manual drawcommands, which i can't use in
the final design because it end user could change the design. So everything
has to work with dropped components on the report.
Greetings,
Filip Moons
procedure TForm2.ppFooterBand1BeforeGenerate(Sender: TObject);
var
AValue: integer;
ALine: TppDrawLine;
ADefaultTop: Integer;
ADefaultHeight: Integer;
begin
ALine := TppDrawLine.Create(Self);
ALine.Page := ppFooterBand1.Report.Engine.Page;
ALine.LinePosition := lpTop;
ALine.Weight := ppLine4.Weight;
ALine.Pen.Width := ppLine4.Pen.Width;
ALine.Pen.Color := ppLine4.Pen.Color;
ALine.Pen.Style := ppLine4.Pen.Style;
ALine.Top := ppFooterBand1.Report.Engine.PrintPosRect.Top;
ALine.Left :=
ppLine10.mmLeft+ppFooterBand1.Report.PrinterSetup.PageDef.mmMarginLeft;
ALine.Width := ppLine10.mmWidth;
end;
This discussion has been closed.
Comments
The Footer band is not a dynamic height band. In order for a line in the
footer band to line up with a vertical line in the detail band, the bottom
of the last detail band would have to match perfectly with the top of the
footer band. If you are using static height detail bands, it may be
possible to make this calculation however it seems you are using dynamic
details since you say the line needs to be in a different position on each
page.
With your requirements, the best way to accomplish what you need is to
create a draw command as you do in your code below. If you would like to
give your users the ability to alter that line, you could place an invisible
line in the designer and create the draw command based on what your users do
with it. This would give them the illusion they have the ability to alter
it.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com