#1 Re: PDF Engine » Delphi draw a table from a stringgrid » 2014-06-05 12:44:53

I think this is not the problem also if i replace x with 2 it dont work.
How is the function addcolumnHeaders be used?

#2 PDF Engine » Delphi draw a table from a stringgrid » 2014-06-04 15:10:53

chris0086
Replies: 3

Hello at all,
i use the synpdf engine and for the first test it working very well.
But now is have a problem and find no way out.
i used the example code to generate a sheet:
http://blog.synopse.info/post/2010/06/3 … -from-code

Now i want to draw my Stringgrid into the pdf.
The first contains the headers.
The stringrid contain rows and cols that are dynamical created.
so at first I tried to create columns and the columnheaders

var
Text: array of SynUnicode;
begin
     setlength(Text,x);
     cx1:=0;
     cx2:=20;
     y:= pred(MWGrid.RowCount); //erste Zeile enthält Beschreibung
     x:= pred(MWGrid.ColCount); //erste Spalte = Testschritte
for i:= 0 to x do
    begin
         text[i]:= MWGrid.Cells[i,0];
         AddColumn(cx1,cx2,caLeft,false);
         cx1:= cx1+20;
         cx2:=cx2+20;
    end;
    AddColumnHeaders(Text,true,true);

but the programm freezes.
If I comment "AddColumnHeaders(Text,true,true);" out then the sheet will be displayed but the columns have no caption.

In the second step i have to fill the rows with my data...

Is there anyone who can help me with this problem?

Kind regards
Christian

Board footer

Powered by FluxBB