Hi guys i have problem i grouping report to item ledger entry table data item as following :
item no quantity cost amount(actual)
ax 5 3000
az 2 4000
grouping by item no until now is successfully.
I try to print to excel sheet using excel buffer table so that i write following code :
item ledger entry -on after get record trigger
IF PrintToExcel THEN
MakeExcelDataBody;
CreateExcelBook() function
ExcelBuf.CreateBook;
ExcelBuf.CreateSheet(Text002,Text001,COMPANYNAME,USERID);
ExcelBuf.GiveUserControl;
ERROR(’’);
MakeExcelInfo() function
ExcelBuf.SetUseInfoSheed;
ExcelBuf.AddInfoColumn(FORMAT(Text005),FALSE,’’,TRUE,FALSE,FALSE,’’);
ExcelBuf.AddInfoColumn(COMPANYNAME,FALSE,’’,FALSE,FALSE,FALSE,’’);
ExcelBuf.NewRow;
ExcelBuf.AddInfoColumn(FORMAT(Text007),FALSE,’’,TRUE,FALSE,FALSE,’’);
ExcelBuf.AddInfoColumn(FORMAT(Text001),FALSE,’’,FALSE,FALSE,FALSE,’’);
ExcelBuf.NewRow;
ExcelBuf.AddInfoColumn(FORMAT(Text006),FALSE,’’,TRUE,FALSE,FALSE,’’);
ExcelBuf.AddInfoColumn(REPORT::“TotalQuantity-Cost”,FALSE,’’,FALSE,FALSE,FALSE,’’);
ExcelBuf.NewRow;
ExcelBuf.AddInfoColumn(FORMAT(Text008),FALSE,’’,TRUE,FALSE,FALSE,’’);
ExcelBuf.AddInfoColumn(USERID,FALSE,’’,FALSE,FALSE,FALSE,’’);
ExcelBuf.NewRow;
ExcelBuf.AddInfoColumn(FORMAT(Text009),FALSE,’’,TRUE,FALSE,FALSE,’’);
ExcelBuf.AddInfoColumn(TODAY,FALSE,’’,FALSE,FALSE,FALSE,’’);
ExcelBuf.NewRow;
ExcelBuf.AddInfoColumn(“Item Ledger Entry”.GETFILTER(“Item No.”),FALSE,’’,FALSE,FALSE,FALSE,’’);
ExcelBuf.NewRow;
ExcelBuf.ClearNewRow;
MakeExcelDataHeader;
MakeExcelDataHeader() function
ExcelBuf.AddColumn(“Item Ledger Entry”.FIELDCAPTION(“Item No.”),FALSE,’’,TRUE,FALSE,TRUE,’’);
ExcelBuf.AddColumn(“Item Ledger Entry”.FIELDCAPTION(Quantity),FALSE,’’,TRUE,FALSE,TRUE,’’);
ExcelBuf.AddColumn(“Item Ledger Entry”.FIELDCAPTION(“Cost Amount (Actual)”),FALSE,’’,TRUE,FALSE,TRUE,’’);
MakeExcelBody()
ExcelBuf.NewRow;
ExcelBuf.AddColumn(“Item Ledger Entry”.“Item No.”,FALSE,’’,FALSE,FALSE,FALSE,’@’);
ExcelBuf.AddColumn(“Item Ledger Entry”.Quantity,FALSE,’’,FALSE,FALSE,FALSE,’’);
ExcelBuf.AddColumn(“Item Ledger Entry”.“Cost Amount (Actual)”,FALSE,’’,FALSE,FALSE,FALSE,’’);
Report - onprereport()
itemFilter := “Item Ledger Entry”.GETFILTERS;
PeriodText := “Item Ledger Entry”.GETFILTER(“Posting Date”);
IF PrintToExcel THEN
MakeExcelInfo;
Report-onpostreport()
IF PrintToExcel THEN
CreateExcelbook;
Then when i run report i found error tell me as following :
" The Excel buffer already exist identification field and value Row No =2 Column No = 1"
How i solve this problem.
thanks