Hello Experts,
I recently learned the "excel buffer" features. I tried to use it for "vendor aging report" & its working great. Problem is if I choose more than 1 vendor it generates more excel files instead of adding more rows in first excel file. I added all "excel buffer" coding in second dataitem i.e. "vendor ledger entry". I feel some of the code belongs to first dataitem i.e. "vendor" but no idea which one. Can someone help? here is coding
Vendor Ledger Entry - OnPreDataItem()
gdl_Window.OPEN(Text001 +
'
@\');
gdl_Window.UPDATE(1,0);
gin_TotalRecNo := Vendor.COUNTAPPROX;
gin_RecNo :=0;
grc_Excelbuffer.DELETEALL;
CLEAR(grc_Excelbuffer);
EnterCell(1, 3, Text001+ ' '+ "Vendor No.", TRUE, FALSE, FALSE);
gin_row := 3;
Vendor Ledger Entry - OnAfterGetRecord()
Vendor.SETRANGE("No.","Vendor No.");
IF Vendor.FINDFIRST THEN
gtx_name:=Vendor.Name;
gin_row := gin_row + 1;
EnterCell(gin_row, 1, FORMAT("Posting Date"), FALSE, FALSE, FALSE);
EnterCell(gin_row, 2, FORMAT("Document Date"), FALSE, FALSE, FALSE);
EnterCell(gin_row, 3, FORMAT(gtx_name), FALSE, FALSE, FALSE);
EnterCell(gin_row, 4, FORMAT("Document No."), FALSE, FALSE, FALSE);
EnterCell(gin_row, 5, FORMAT("External Document No."), FALSE, FALSE, FALSE);
EnterCell(gin_row, 6, FORMAT("Total TDS Including SHE CESS"), FALSE, FALSE, FALSE);
EnterCell(gin_row, 7, FORMAT(Amount), FALSE, FALSE, FALSE);
EnterCell(gin_row, 8, FORMAT("Remaining Amount"), FALSE, FALSE, FALSE);
gin_RecNo := gin_RecNo + 1;
gdl_Window.UPDATE(1,ROUND(gin_RecNo / gin_TotalRecNo * 10000,1));
Vendor Ledger Entry - OnPostDataItem()
gin_row := gin_row + 1;
EnterCell(gin_row, 2, 'TOTAL FOR'+' '+ gtx_name, TRUE, FALSE, FALSE);
EnterCell(gin_row, 6, FORMAT("Total TDS Including SHE CESS"), TRUE, FALSE, FALSE);
EnterCell(gin_row, 7, FORMAT(Amount), TRUE, FALSE, FALSE);
EnterCell(gin_row, 8, FORMAT("Remaining Amount"), TRUE, FALSE, FALSE);
gdl_Window.CLOSE;
grc_Excelbuffer.CreateBook;
grc_Excelbuffer.CreateSheet(Text001,Text001,COMPANYNAME,USERID);
grc_Excelbuffer.GiveUserControl;
EnterCell(lin_RowNo : Integer;lin_ColumnNo : Integer;ltx_CellValue : Text[250];lbl_Bold : Boolean;lbl_Italic : Boolean;lbl_UnderLine :
grc_Excelbuffer.INIT;
grc_Excelbuffer.VALIDATE("Row No.",lin_RowNo);
grc_Excelbuffer.VALIDATE("Column No.",lin_ColumnNo);
grc_Excelbuffer."Cell Value as Text" := ltx_CellValue;
grc_Excelbuffer.Formula := '';
grc_Excelbuffer.Bold := lbl_Bold;
grc_Excelbuffer.Italic := lbl_Italic;
grc_Excelbuffer.Underline := lbl_UnderLine;
grc_Excelbuffer.INSERT;
Answers
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
gdl_Window.OPEN(Text001 +
'@\');
gdl_Window.UPDATE(1,0);
gin_TotalRecNo := Vendor.COUNTAPPROX;
gin_RecNo :=0;
grc_Excelbuffer.DELETEALL;
CLEAR(grc_Excelbuffer);
Chn
Microsoft Dynamics NAV Classic
The Excel Buffer already exists.
Identification fields and values:
Row No.='1',Column No.='3'
OK
Chn
If that is where you have it then review the entire code in the entire report (including any sections) and make sure that your Row No. is only set to zero at the beginning of the report and nowhere else.
KCP Consultores
I have an example with the ar aging here:
https://docs.google.com/document/d/1PPM ... Zgra4/edit
To get customers aged totals I add it to ONPOSTSECTION
SectionType=Footer;
SectionWidth=21600;
SectionHeight=1692;
KeepWithNext=No;
OnPostSection=BEGIN
http://www.BiloBeauty.com
http://www.autismspeaks.org