Columns headers question
Hiya,
I am creating a report with 2 columns, each ones containing severals
records. Also, this report will have severals page. In RB, there is only
one columns that will be generated as needed. For the first columns of the
report, I put the visible properties of the lines and label box to false,
since I don't want to see the subtotal to appear at the top of the first
column (columns header ). The second and all others columns on the
following pages must have that little box visible. So I set by
programmation the visible property to false, I count the number of column he
is at, and for all others set the visible property to true. If I wasn't
clear, the report layout should looks like this :
--header
--column 1header(invisible) --column2 header(visible)
----------- ----------
----------- ----------
--column footer column footer
--footer
(for all the following pages )
--header
--column 1header(visible) --column2 header(visible)
----------- ----------
----------- ----------
--column footer column footer
--footer
**Note, the "columns" are identical, RB simply continue to add records in
the second columns.
The code does work, except for one thing. When I set the visible property
for the second column (on the same page than first column), since the label
box property name is the same (each column are generated), the first label
box get "overwrited" and become visible, since it has the same name.
I tried to use an alternate way, without using the column header, but
creating two differents column header. Unfortunately, the total at the
bottom of the column footer couldn't be copied to the second column
header(this for every page).
So I was wondering if there was an alternative way to have two label box
(generated from a single one in RB) with the same name but their visible
property set to different value ? Or there is an alternative way ?
I am using Dephi 7 with report builder 7.03.
Thanks in advance,
Adam
I am creating a report with 2 columns, each ones containing severals
records. Also, this report will have severals page. In RB, there is only
one columns that will be generated as needed. For the first columns of the
report, I put the visible properties of the lines and label box to false,
since I don't want to see the subtotal to appear at the top of the first
column (columns header ). The second and all others columns on the
following pages must have that little box visible. So I set by
programmation the visible property to false, I count the number of column he
is at, and for all others set the visible property to true. If I wasn't
clear, the report layout should looks like this :
--header
--column 1header(invisible) --column2 header(visible)
----------- ----------
----------- ----------
--column footer column footer
--footer
(for all the following pages )
--header
--column 1header(visible) --column2 header(visible)
----------- ----------
----------- ----------
--column footer column footer
--footer
**Note, the "columns" are identical, RB simply continue to add records in
the second columns.
The code does work, except for one thing. When I set the visible property
for the second column (on the same page than first column), since the label
box property name is the same (each column are generated), the first label
box get "overwrited" and become visible, since it has the same name.
I tried to use an alternate way, without using the column header, but
creating two differents column header. Unfortunately, the total at the
bottom of the column footer couldn't be copied to the second column
header(this for every page).
So I was wondering if there was an alternative way to have two label box
(generated from a single one in RB) with the same name but their visible
property set to different value ? Or there is an alternative way ?
I am using Dephi 7 with report builder 7.03.
Thanks in advance,
Adam
This discussion has been closed.
Comments
Once the first label has been generated, you should be able to alter it, and
still retain the properties you have already given it. In my testing, I was
able to successfully get a label in the first column header to remain
invisible while all other labels in the column headers of the report were
visible. Here is the code I used...
procedure TForm1.ppColumnHeaderBand1BeforePrint(Sender: TObject);
begin
if (ppReport1.AbsolutePageNo = 1) and (ppReport1.CurrentColumn = 1) then
ppLabel1.Visible := False
else
ppLabel1.Visible := True;
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com