Problem: MasterDate with 3 columns
Hi, I have a problem with my report where I created a PageHeader and a Masterdata (see attached file Prova.fr3).
I have a MasterData with 3 columns linked to a query (named qopelegF1) that contains the following 15 elements:
Inside the report I create a TStringList where I insert the following items:
In the event of OnBeforePrint of MasterData, I control if the element is contained in the query list that I created. If there is, I put MasterData???s property Visible to True, otherwise I put it to False.
The code is:
var
lista_ope : TStringList;
procedure MasterData1OnBeforePrint(Sender: TfrxComponent);
begin
if <qopelegF1."CODTAB"> <> null then
begin
if (lista_ope.indexof( <qopelegF1."CODTAB">) <> -1) then
MasterData1.visible := true
else
MasterData1.visible := false;
end;
end;
begin
lista_ope := TStringList.Create;
Lista_ope.Add('H');
Lista_ope.Add('A');
Lista_ope.Add('Z');
Lista_ope.Add('W');
Lista_ope.Add('F');
Lista_ope.Add('G');
Lista_ope.Add('Y');
Lista_ope.Add('X');
Lista_ope.Add('J');
end.
The layout contains empty columns, as below:
column1 column2 column3
ADD CNT -
- - COM
CVC
But I would like my layout is like this:
column1 column2 column3
ADD CNT COM
CVC
There is some property that I set on MasterData who not have contemplated?
I have a MasterData with 3 columns linked to a query (named qopelegF1) that contains the following 15 elements:
??? A
??? B
??? C
??? D
??? E
??? F
??? G
??? H
??? I
??? L
??? M
??? N
??? O
??? P
??? Q
Inside the report I create a TStringList where I insert the following items:
- H
- A
- Z
- W
- F
- G
- Y
- X
- J
In the event of OnBeforePrint of MasterData, I control if the element is contained in the query list that I created. If there is, I put MasterData???s property Visible to True, otherwise I put it to False.
The code is:
var
lista_ope : TStringList;
procedure MasterData1OnBeforePrint(Sender: TfrxComponent);
begin
if <qopelegF1."CODTAB"> <> null then
begin
if (lista_ope.indexof( <qopelegF1."CODTAB">) <> -1) then
MasterData1.visible := true
else
MasterData1.visible := false;
end;
end;
begin
lista_ope := TStringList.Create;
Lista_ope.Add('H');
Lista_ope.Add('A');
Lista_ope.Add('Z');
Lista_ope.Add('W');
Lista_ope.Add('F');
Lista_ope.Add('G');
Lista_ope.Add('Y');
Lista_ope.Add('X');
Lista_ope.Add('J');
end.
The layout contains empty columns, as below:
column1 column2 column3
ADD CNT -
- - COM
CVC
But I would like my layout is like this:
column1 column2 column3
ADD CNT COM
CVC
There is some property that I set on MasterData who not have contemplated?
Comments
But I thought to use the report properties and do not write the code.
If instead of 3 columns, I use a column with the same procedures, the problem does not exist.
Why?