In Excel OLE automation a sheet has a PageSetup property where I can set the LeftHeader, CenterHeader, RightHeader, LeftFooter, CenterFooter, RightFooter, PrintTitleRows, PrintTitleColumns. How can I do this in FlexCel?
The simplest way again is with APIMate. Just write the headers and footers you want in Excel, save the file and open it in APIMate and it will tell you how to change the properties you want.
Und PrintMargins (Top, Left, Right, Botton)?
Again, you can find out with APIMate. Just set some print margins in Excel, save the file and open it with APIMate. This is what I get:
//Printer Settings
//You can set the margins in 2 ways, the one commented here or the one below:
//var PrintMargins: TXlsMargins;
// PrintMargins := xls.GetPrintMargins();
// PrintMargins.Left := 1;
// PrintMargins.Top := 1;
// PrintMargins.Right := 1;
// PrintMargins.Bottom := 1;
// PrintMargins.Header := 0.5;
// PrintMargins.Footer := 0.5;
// xls.SetPrintMargins(PrintMargins);
xls.SetPrintMargins(TXlsMargins.Create(1, 1, 1, 1, 0.5, 0.5));
Und PrintTitleColumns?
PrintTitleColumns works by setting a named range (Print_Titles), as it is how it works internally in Excel. Again, APIMate is your friend:
//Named Ranges
RangeName := TXlsNamedRange.GetInternalName(TInternalNameRange.Print_Titles);
Range := TXlsNamedRange.Create(RangeName, 1, 32, '=Sheet1!$A:$B,Sheet1!$1:$2');
xls.SetNamedRange(Range);