I am trying to add new sheet for each Company...
I have taken the standard Fixed asset report and customized it to look at every company and bring back all data for all companies.
Data Item
Company
Fixed asset.
On the Report - OnPostReport() I have added the following.
IF PrintDetail THEN BEGIN
TmpExcelBuffer.CreateBook;
TmpExcelBuffer.CreateSheet('FixedAsset','Fixed Asset Book Value 01',COMPANYNAME,USERID);
TmpExcelBuffer.GiveUserControl;
END;
Every time the Company changes I need the data to print to another sheet until it reaches the next company, which in turn should create another sheet.
There are 26 companies in Total.
Would someone be able to help me figure out how to do this. I see data on how to create new sheet, But I can not figure out where to put code to create sheet when Company changes.
0
Comments
TmpExcelBuffer.CreateSheet(SheetName,'Fixed Asset Book Value 01',COMPANYNAME,USERID);
prior to getting the next company.
You will have to do the createbook before this.
Report - OnPostReport runs after all data has been put into the ExcelBuffer Table.
Did I miss something here?
Essentially,
1 create book
2 get data for 1st company
3 create sheet for 1st company
4 repeat 2 and 3 for other companies
5 give user control
But as I say will in part be determined how you modified the report.