You've already forked lazarus-ccr
fpspreadsheet: Add units (mm, cm, in, pts, lines/chars) for column width and row heights. Update all demos (some issues left).
NOTE: This revision breaks existing code if the worksheet's DefaultRowHeight/DefaultColWidth is changed - value must be in millimeters now. Methods for accessing individual row heiths and column widths are fine, but are marked as deprecated, they use the old units. Optionally a unit parameter can be specified. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4568 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -25,25 +25,28 @@ begin
|
||||
try
|
||||
worksheet := workbook.AddWorksheet('Test');
|
||||
|
||||
worksheet.WriteNumber(0, 0, 1); // A1
|
||||
worksheet.WriteNumber(0, 1, 2.5); // B1
|
||||
worksheet.WriteNumber(0, 0, 1); // A1
|
||||
worksheet.WriteNumber(0, 1, 2.5); // B1
|
||||
{
|
||||
worksheet.WriteText(0, 0, 'Hallo'); // A1
|
||||
worksheet.WriteText(0, 1, 'World'); // B1
|
||||
}
|
||||
|
||||
worksheet.WriteUTF8Text(0, 0, 'Hallo'); // A1
|
||||
worksheet.WriteUTF8Text(0, 1, 'World'); // B1
|
||||
cell := worksheet.WriteFormula(1, 0, '=4+5'); // A2
|
||||
cell := worksheet.WriteFormula(2, 0, 'AND(TRUE(), TRUE(), TRUE())');
|
||||
cell := worksheet.WriteFormula(3, 0, 'SIN(A1+B1)');
|
||||
cell := worksheet.WriteFormula(4, 0, '=TRUE()');
|
||||
cell := worksheet.WriteFormula(5, 0, '=1-(4/2)^2*2-1'); // A2
|
||||
cell := Worksheet.WriteFormula(6, 0, 'datedif(today(),Date(2014,1,1),"D")');
|
||||
cell := Worksheet.WriteFormula(7, 0, 'Day(Date(2014, 1, 12))');
|
||||
cell := Worksheet.WriteFormula(8, 0, 'SUM(1,2,3)');
|
||||
cell := Worksheet.WriteFormula(9, 0, 'CELL("address",A1)');
|
||||
cell := Worksheet.WriteFormula(10, 0, 'REPT("Hallo", 3)');
|
||||
cell := Worksheet.WriteFormula(11, 0, '#REF!');
|
||||
{ Select one of these formulas }
|
||||
//cell := worksheet.WriteFormula(1, 0, '=4+5'); // A2
|
||||
//cell := worksheet.WriteFormula(1, 0, 'AND(TRUE(), TRUE(), TRUE())');
|
||||
cell := worksheet.WriteFormula(1, 0, 'SIN(A1+B1)');
|
||||
//cell := worksheet.WriteFormula(1, 0, '=TRUE()');
|
||||
//cell := worksheet.WriteFormula(1, 0, '=1-(4/2)^2*2-1'); // A2
|
||||
//cell := Worksheet.WriteFormula(1, 0, 'datedif(today(),Date(2014,1,1),"D")');
|
||||
//cell := Worksheet.WriteFormula(1, 0, 'Day(Date(2014, 1, 12))');
|
||||
//cell := Worksheet.WriteFormula(1, 0, 'SUM(1,2,3)');
|
||||
//cell := Worksheet.WriteFormula(1, 0, 'CELL("address",A1)');
|
||||
//cell := Worksheet.WriteFormula(1, 0, 'REPT("Hallo", 3)');
|
||||
//cell := Worksheet.WriteFormula(1, 0, '#REF!');
|
||||
|
||||
WriteLn('A1: ', worksheet.ReadAsUTF8Text(0, 0));
|
||||
WriteLn('B1: ', worksheet.ReadAsUTF8Text(0, 1));
|
||||
WriteLn('A1: ', worksheet.ReadAsText(0, 0));
|
||||
WriteLn('B1: ', worksheet.ReadAsText(0, 1));
|
||||
|
||||
parser := TsSpreadsheetParser.Create(worksheet);
|
||||
try
|
||||
|
Reference in New Issue
Block a user