print stringgrid
hello,
I'a trying to print a stringgrid using the example code in the demo pack.
But I don't inderstand if the name of the cross view changes (for example, my Tfrxcrossview is cross1)
Because I have 2 crossview (cross1 and cross2) on my report, and I want to have the good data on the good cross view !
Could you help me to adapt this code with a named Tfrxcrossview ?
regards
I'a trying to print a stringgrid using the example code in the demo pack.
But I don't inderstand if the name of the cross view changes (for example, my Tfrxcrossview is cross1)
Because I have 2 crossview (cross1 and cross2) on my report, and I want to have the good data on the good cross view !
Could you help me to adapt this code with a named Tfrxcrossview ?
procedure TForm1.frxReport1BeforePrint(c: TfrxReportComponent);
var
  Cross: TfrxCrossView;
  i, j: Integer;
begin
  c.Name:='cross1'; // I tried this but it's not Ok !!!
  if c is TfrxCrossView then
  begin
    Cross := TfrxCrossView(c);
    for i := 1 to 16 do
      for j := 1 to 16 do
        Cross.AddValue([i], [j], [StringGrid1.Cells[i - 1, j - 1]]);
  end;
end;
regards
Comments
thank you
it's working fine now [img]style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> Another question: Is it possible to put a name on the colum and row ? For example if we take the same example as above: how I can do to set 'C1, C2,C3, ....C16' for colum title and 'R1,R2,R3...R16 for row title ? regards[/img]