during migration I am facing a different behaviour from version 4 to 5.
The need is to set the first 5 rows to be repeated on every page, like a header.
In version 4 there was a coding like this:
Code: Select all
// printer settings
// This will remove the psoPortrait option and seems to default to Landscape.
XLS[0].PrintSettings.Options := [];
// for repeating print the first 5 rows, you must set an internal name
with XLS.InternalNames.Add do
begin
BuiltInName := bnPrintTitles;
Definition := 'Sheet1!$A$1:$IV$5';
Name := FormatDateTime('YYYYMMDDHHNNSSZZZ',now); // always internal name, if not an excel 2007 error will raise
end;
// ... other settings ...
XLS[0].PrintSettings.PaperSize := psA4;
XLS[0].PrintSettings.Options := XLS[0].PrintSettings.Options + [psoGridlines];
XLS[0].PrintSettings.FitWidth := 1;
XLS[0].PrintSettings.FitHeight := 0;
XLS[0].WorkspaceOptions := XLS[0].WorkspaceOptions + [woFitToPage];
E2250 There is no overloaded version of 'Add' that can be called with these arguments
E2003 Undeclared identifier: 'BuiltInName'
Probably the things are changed: how to set the first 5 rows to be repeated on every page ?
I haven't find this information in Samples.
Thanks in advance, Regards
-Massimo