Excel Buffer Error

NormajmNormajm Member Posts: 82
Hello,

I'm trying to create a report that will export to Excel (my first try at this). A very simple report with just six columns. I've copied code from a report that already was set up to export and modified it. The end result is an error:

The Excel Buffer already exists.
Identification fields and values:
Row No.='1',Column No.='1'

When running the debugger, it shows and "insert" in table 370 as the problem.

There are 5 functions copied:
MakeExcelInfo
MakeExcelDataHeader
MakeExcelCustHeader
MakeExcelDataBody
CreateExcelbook

The code in all but MakeExcelDataBody and createExcelBook have been remmed out.

This is the MakeExcelDataBody code (for testing, I want only the first column)
ExcelBuf.NewRow;
ExcelBuf.AddColumn(Item."No.",FALSE,'',TRUE,FALSE,FALSE,'');

This is the CreateExcelBook code:
ExcelBuf.CreateBook;
ExcelBuf.CreateSheet('Customer','Unit Sales Report',COMPANYNAME,USERID);
ExcelBuf.GiveUserControl;
ERROR('');

There are five sections to the report:
Header1
Body2
GroupFooter1
Footer2
Footer3

The data I want to export is in groupfooter1 where I have added this code to the presection:
IF (PrinttoExcel)THEN
  MakeExcelDataBody();

I also added code to OnPostReport
IF PrinttoExcel THEN
  CreateExcelbook;

Any suggestions on where I went wrong with this?

Thank you.

JNM

Comments

Sign In or Register to comment.