Hello,
I have a problem with Excel Automation.
I've tried to design a report which exports some items to an excel-file.
If i try to compile my Report, following Message occurs:
"The variable XLAPPLICATION::WORKBOOKPIVOTTA is defined more than once."
"An example could be: 'File' exists as both a data type and a global variable."
And a second problem:
Does anyone know how I can fill data to a different sheet?
I hope that someone could help me!
0
Comments
LaExcelRange ==> LaEx
You will have to add the worksheets at the start of your report and then if you are grouping by a specific field add the following code to get to the next sheet in the OnPresection of GroupFooter
data for footer in formation to fill current worksheet
Sheet := Sheet.Next; // Gets the next worksheet
Sheet.Activate;
to add lets say 4 worksheets do the following in the Report - OnPreReport
CLEAR(App);
CREATE(App);
App.Visible(FALSE);
Book := App.Workbooks.Add(-4167);
FOR x := 1 TO 3 DO
Book.Worksheets.Add;
Sheet := App.ActiveSheet;
Sheet.Name := 'A';
FOR x := 1 TO 3 DO BEGIN
Sheet := Sheet.Next;
CASE x OF
1 : Sheet.Name := 'B';
2 : Sheet.Name := 'C';
3 : Sheet.Name := 'D';
END;
END;
FOR x := 4 DOWNTO 1 DO
Sheet := Sheet.Previous;
Sheet.Activate;
Hope this helps
first thanks for your suggestion.
But i already have the problem with the error Message:
"The variable APP::NEWWORKBOOK is defined more than once."
"An example could be: 'File' exists as both a data type and a global variable."
Hope you can help me!
Thanks