Dynamic Columns

166 views
Skip to first unread message

mvg

unread,
May 6, 2013, 10:23:45 PM5/6/13
to fastreport_f...@googlegroups.com
Hello to all,

are there some sample how to create a report with dynamic number and names of columns, not fixed number and names

best regards

Marcelo

Jose Manuel García del Valle

unread,
May 7, 2013, 4:05:37 AM5/7/13
to fastreport_f...@googlegroups.com

Hello

 

var // var section

 

ii: Integer;

cCad : string;                                

nAnchoImportes: Extended;

Memo: TfrxMemoView;

Imp: TfrxMemoView;

 

begin

  // Los anchos de todos los importes se cogen de este objeto                                                                                                                                            

  nAnchoImportes:= CabGas1.width;

 

     II:=2;

     while ii <= GetXppVar('nColumnasLis') do

     

       begin

       //Cabeceras                     

       Memo := TfrxMemoView.Create(PageHeader1);

       Memo.Font := CabGas1.Font; 

       Memo.Frame:= CabGas1.Frame; 

       Memo.Color:= CabGas1.Color; 

       Memo.HAlign:= CabGas1.HAlign; 

       Memo.VAlign:= CabGas1.VAlign; 

       Memo.SetBounds(CabGas1.left + (ii-1)*CabGas1.width, CabGas1.top, CabGas1.width, CabGas1.Height);

 

       Memo.Text := trim(GetXppVar('CL_CONCEP' + inttostr(ii)+));

 

 

       //datos del cuerpo

       Memo := TfrxMemoView.Create(MasterData1);

       Memo.Font := Gasto1.Font; 

       Memo.Frame:= Gasto1.Frame; 

       Memo.HAlign:= Gasto1.HAlign; 

       Memo.VAlign:= Gasto1.VAlign; 

       Memo.Hidezeros:= Gasto1.Hidezeros; 

       Memo.DisplayFormat:= Gasto1.DisplayFormat; 

       Memo.SetBounds(Gasto1.left + (ii-1)*Gasto1.width, Gasto1.top, Gasto1.width, Gasto1.Height);

       Memo.Text := '[MOV."IMP_GAS'+inttostr(ii)+'"]';   

    

 

       //Totales                                                       

       Memo := TfrxMemoView.Create(ReportSummary1);

       Memo.Font := Total1.Font; 

       Memo.Frame:= Total1.Frame; 

       Memo.HAlign:= Total1.HAlign; 

       Memo.VAlign:= Total1.VAlign; 

       Memo.DisplayFormat:= Total1.DisplayFormat; 

       Memo.SetBounds(Total1.left + (ii-1)*Total1.width, Total1.top, Total1.width, Total1.Height);

       Memo.Text   := '[SUM(<MOV."IMP_GAS'+inttostr(ii)+'">,MasterData1)]';           

   

       Inc(ii);

    

       end;

   

end.

 

Jose Manuel

--
You received this message because you are subscribed to the Google Groups "FastReport for [x]Harbour, Alaska Xbase++, Visual FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fastreport_for_x_h...@googlegroups.com.
To post to this group, send email to fastreport_f...@googlegroups.com.
Visit this group at http://groups.google.com/group/fastreport_for_x_harbour?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


No se encontraron virus en este mensaje.
Comprobado por AVG - www.avg.com
Versión: 2013.0.2904 / Base de datos de virus: 3162/6302 - Fecha de publicación: 05/06/13

Reinaldo Crespo

unread,
May 8, 2013, 9:46:42 AM5/8/13
to fastreport_f...@googlegroups.com
Marcelo;

Hola.  

No estoy seguro si esto te sirva para tus propósitos.  Una cosa que puedes hacer es tener un evento definido en la pestaña de eventos del memo donde pruebas cierta condición antes de hacer el memo visible o no.  Por ejemplo:



//------------------------------------------------------------                                                                                                                              
procedure Memo15OnBeforePrint(Sender: TfrxComponent);
begin
    Memo15.Visible := <ciertaVarible o condicion>;
end;


También pudieras hacer la definición del campo una condición:

[ iif( <condition>, ’Tabla.”Campo”’, ‘OtraTabla.”OtroCampo”’) ]


Saludos,




Reinaldo Crespo-Bazán


mvg

unread,
May 9, 2013, 6:50:35 PM5/9/13
to fastreport_f...@googlegroups.com
José, Reinaldo

gracias por sus respuestas, vere de implementarlas y si tengo novedades, las comparto aquí

saludos

Marcelo

jo.ow...@yahoo.com

unread,
Jun 4, 2013, 5:06:13 AM6/4/13
to fastreport_f...@googlegroups.com
Click Me!
Hi all,
 
It appears that Conditional Font Colors and highlighting in CrossTab is not working, anybody with a work-around. My condition is: <dbTable."COL08"> < 0 
 
 
 
 
 
 
J.O. Owoyemi
Unix Computer Services Limited
NM 10 Constitution Road
Kaduna, NIGERIA
-------Original Message-------
grad.jpg
SENDER_EMAILjo@@owoyemi@yahoo@@com.png
sg-0.gif
image1.gif
sea_sand.jpg
image2.gif
butterfly_top.gif
butterfly_bottom.gif
Reply all
Reply to author
Forward
0 new messages