Hi,
I hav developed a report using “Sales Invoice Line” table. I am trying to export thereport to excel. But i’m getting an error in it - “The Dialog box is not open”.
Have shown the following codes in following triggers…
Sales Invoice Line-OnPreDataItem()
IF PrintToExcel THEN
BEGIN
window.OPEN(Text001 + ‘@1@@@@@@@@@@@@@@@@@@@@@’);
window.UPDATE(1,0);
TotalRecNo := “Sales Invoice Line”.COUNTAPPROX;
RecNo :=0;
TempExcelBuffer.DELETEALL;
CLEAR(TempExcelBuffer);
ENTERCELL(1, 1, Text000, TRUE, TRUE, FALSE);
ENTERCELL(1, 2, Text002, TRUE, TRUE, FALSE);
ENTERCELL(1, 3, Text003, TRUE, TRUE, FALSE);
ENTERCELL(1, 4, Text004, TRUE, TRUE, FALSE);
ENTERCELL(1, 5, Text005, TRUE, TRUE, FALSE);
ENTERCELL(1, 6, Text006, TRUE, TRUE, FALSE);
ENTERCELL(1, 7, Text007, TRUE, TRUE, FALSE);
ENTERCELL(1, 8, Text008, TRUE, TRUE, FALSE);
row := 1;
RecNo := RecNo + 1;
window.UPDATE(1,ROUND(RecNo / TotalRecNo * 10000,1));
END;
Sales Invoice Line-OnAfterGetRecord()
IF PrintToExcel THEN
BEGIN
window.CLOSE;
TempExcelBuffer.CreateBook;
TempExcelBuffer.CreateSheet(Text000,Text000,COMPANYNAME,USERID);
TempExcelBuffer.GiveUserControl;
END;
Sales Invoice Line,Body-OnPostSection()
IF PrintToExcel THEN
BEGIN
row := row + 1;
ENTERCELL(row, 1, “No.”, FALSE, FALSE, FALSE);
ENTERCELL(row, 2, Description, FALSE, FALSE, FALSE);
ENTERCELL(row, 3, FORMAT(“Quantity (Base)”),FALSE, FALSE, FALSE);
ENTERCELL(row, 4, “Unit of Measure Code”, FALSE, FALSE, FALSE);
ENTERCELL(row, 5, FORMAT(CBQty), FALSE, FALSE, FALSE);
ENTERCELL(row, 6, FORMAT(PMQty), FALSE, FALSE, FALSE);
ENTERCELL(row, 7, FORMAT(OtherQty), FALSE, FALSE, FALSE);
ENTERCELL(row, 8, FORMAT(CostAmount), FALSE, FALSE, FALSE);
RecNo := RecNo + 1;
window.UPDATE(1,ROUND(RecNo / TotalRecNo * 10000,1));
END;
Its jus creating a blank excel sheet with that error on the report, if I run with the debugger its pointing to the window.UPDATE line which is highlighted. Can anyone pls help me how to go on with this…
Thanks in advance…