procedure TfmMain.btMainTestClick(Sender: TObject);
var
V:variant;
x,y:integer;
begin
OW.PageStyles[0].HeaderIsOn:=true;
OW.PageStyles[0].ModelCursor[owhHeader].Text:='
Test header '#13'
line2';
OW.PageStyles[0].ModelCursor[owhHeader].Font.Posture:=ofpItalic;
OW.PageStyles[0].ModelCursor[owhHeader].Para.HoriAlignment:=ophCenter;
OW.PageStyles[0].ModelCursor[owhHeader].CollapseToEnd;
OW.PageStyles[0].ModelCursor[owhHeader].Text:='
Page ';
OW.PageStyles[0].ModelCursor[owhHeader].CollapseToEnd;
OW.PageStyles[0].ModelCursor[owhHeader].InsertPageNumber;
OW.PageStyles[0].ModelCursor[owhHeader].Text:='
of ';
OW.PageStyles[0].ModelCursor[owhHeader].CollapseToEnd;
OW.PageStyles[0].ModelCursor[owhHeader].InsertPageCount;
OW.PageStyles[0].HeaderBottomBorder:=BLine(clRed,0,30,0);
OW.PageStyles[0].HeaderTopBorder:=BLine(clBlue,0,30,0);
OW.Tables.Insert(5,9,'
',OW.ViewCursor);
OW.Tables[0].CellByName['
A1'].AsText:='
Test';
OW.Tables[0].CellByName['
A2'].AsNumber:=12.5678;
OW.Tables[0].CellByName['
A4'].AsDate:=Now;
OW.Tables[0].CellByName['
A4'].Format:=OW.NumberFormats.Add('
DD.MM.YYYY');
OW.Tables[0].CellByName['
A4'].BackColor:=clSilver;
V:=VarArrayCreate([1,3,1,2],VarVariant);
for x:=1
to 3
do
for y:=1
to 2
do
V[x,y]:=IntToStr(x*y+1);
OW.Tables[0].CellRange[0,1,2,2].Para.HoriAlignment:=ophCenter;
OW.Tables[0].CellRange[0,1,2,2].Para.Margin.Top:=500;
OW.Tables[0].CellRange[0,1,2,2].Para.Margin.Left:=500;
OW.Tables[0].CellRange[0,1,2,2].Para.Margin.Right:=500;
OW.Tables[0].CellRange[0,1,2,2].Para.Margin.Bottom:=500;
OW.ViewCursor.GotoEnd(false);
OW.ViewCursor.Font.FontName:='
Times New Roman';
OW.ViewCursor.Font.Height:=12;
OW.ViewCursor.Para.FirstLineIndent:=1000;
OW.ViewCursor.Para.HoriAlignment:=ophLeft;
OW.ViewCursor.Text:='
Çàäà÷à - â ïðîãðàììå íà D7 ôîðìèðóåòñÿ ïðàéñ-ëèñò.'+#13+
'
Ðàíåå ÿ âûâîäèë åãî â DBF, îòêðûâàë Excel-åì, è òàì ìàêðîñîì ôîðìàòèðîâàë êàê íàäî.'+#13;
OW.ViewCursor.CollapseToEnd;
OW.ViewCursor.Para.LineSpacing:=LSpacing(olsProp,150);
OW.ViewCursor.Para.DropCapFormat:=DCFormat(2,1,1);
OW.ViewCursor.Text:='
Ïîòîì ÷òî áû íå ñâÿçûâàòüñÿ ñ ìàêðîñàìè (íó íå ïåðåâàðèâàþ ÿ ýòèì îáúåêòû ýêñåëÿ) '+
'
ñòàë äåëàòü òàê - âûâîæó â html ñ ôîðìàòèðîâàíèåì è îòêðûâàþ åãî Excel-åì. Äàæå ôîðìóëû ðàáîòàþò.';
OW.ViewCursor.GotoEnd(false);
OW.Tables.Insert(3,35,'
',OW.ViewCursor);
OW.Tables[1].HoriOrient:=ofhoLeft;
OW.Tables[1].Width:=12000;
OW.Tables[1].RepeatHeadline:=true;
OW.Tables[1].HeaderRowCount:=2;
OW.Tables[1].Rows[0].BackColor:=clGreen;
OW.Tables[1].Rows[0].AutoHeight:=false;
OW.Tables[1].Rows[0].Height:=2000;
OW.Tables[1].Cell[0,0].AsText:='
String1';
OW.Tables[1].Cell[1,0].AsText:='
String2'+#13+'
String3';
OW.Tables[1].Cell[0,1].AsText:='
1';
OW.Tables[1].Cell[1,1].AsText:='
2';
OW.Tables[1].Cell[2,1].AsText:='
3';
OW.Tables[1].CellRange[0,1,2,1].Para.HoriAlignment:=ophCenter;
OW.Tables[1].Cell[0,0].VertAlignment:=ofvoCenter;
OW.Tables[1].Cell[0,0].Font.Posture:=ofpItalic;
OW.Tables[1].Cell[0,0].Font.Weight:=ofwBold;
OW.Tables[1].Cell[0,0].Font.Underline:=ofuDoubleWave;
// ShowMessage('Page count = '+IntToStr(OW.PageCount));
OW.ViewCursor.GotoEnd(false);
OW.ViewCursor.Para.BreakType:=obtPageBefore;
OW.ViewCursor.Text:='
Test 3 page';
OW.ViewCursor.CollapseToEnd;
OW.ModelCursor.SyncFrom(OW.ViewCursor);
end;