Hi Experts,
There is a customized report, having code on OnPreSection() of the dataitem's body trigger.
The code is given below which does the insertion of data in excel:
IF COMPANYNAME = 'XYZ' THEN
SalesAmt :=SalesCrMemoLineAmount;
NetAmt := 0;
IF Customer.GET("Sales Cr.Memo Header"."Sell-to Customer No.") THEN
IF (CRSalesAmt <> 0) AND (Customer."Net Amount %" <> 0) THEN
NetAmt := (CRSalesAmt / Customer."Net Amount %") * 100;
IF CurrReport.SHOWOUTPUT AND ExportToXL THEN BEGIN
EnterCell(i,1,FORMAT("Document No."),FALSE,FALSE);
EnterCell(i,2,FORMAT("Sales Cr.Memo Header"."Posting Date"),FALSE,FALSE);
EnterCell(i,3,FORMAT("Sell-to Customer No."),FALSE,FALSE);
EnterCell(i,4,FORMAT("Sales Cr.Memo Header"."Sell-to Customer Name"),FALSE,FALSE);
EnterCell(i,5,FORMAT("No."),FALSE,FALSE);
EnterCell(i,6,FORMAT(Description),FALSE,FALSE);
EnterCell(i,7,FORMAT("Item Category Code"),FALSE,FALSE);
EnterCell(i,8,FORMAT(CRItemCatDesc),FALSE,FALSE);
EnterCell(i,9,FORMAT("Product Group Code"),FALSE,FALSE);
EnterCell(i,10,FORMAT("Sales Cr.Memo Header"."Ship-to Code"),FALSE,FALSE);
EnterCell(i,11,FORMAT("Sales Cr.Memo Header"."Ship-to Name"),FALSE,FALSE);
EnterCell(i,12,FORMAT(CRCountry),FALSE,FALSE);
IF COMPANYNAME = 'PMI' THEN
EnterCell(i,13,FORMAT(SalesCrMemoLineAmount),FALSE,FALSE)
ELSE
EnterCell(i,13,FORMAT(CRSalesAmt),FALSE,FALSE);
EnterCell(i,14,FORMAT(CRValueAmt),FALSE,FALSE);
EnterCell(i,16,FORMAT("Unit of Measure Code"),FALSE,FALSE);
EnterCell(i,15,FORMAT(CMQty * -1),FALSE,FALSE);
QuantityKL := 0;
ItemUnitMeasure.RESET;
ItemUnitMeasure.SETRANGE("Item No.","No.");
ItemUnitMeasure.SETRANGE(Code,'KL');
IF ItemUnitMeasure.FINDFIRST THEN BEGIN
QuantityKL := CMQtyBase / ItemUnitMeasure."Qty. per Unit of Measure" * -1;
END;
QuantityNo := 0;
ItemUnitMeasure.RESET;
ItemUnitMeasure.SETRANGE("Item No.","No.");
ItemUnitMeasure.SETRANGE(Code,'NOS');
IF ItemUnitMeasure.FINDFIRST THEN BEGIN
QuantityNo := CMQtyBase / ItemUnitMeasure."Qty. per Unit of Measure" * -1;
END;
EnterCell(i,17,FORMAT(QuantityNo),FALSE,FALSE);
EnterCell(i,18,FORMAT(QuantityKL),FALSE,FALSE);
EnterCell(i,19,FORMAT(NetAmt),FALSE,FALSE);
i+=1;
END;
I have tried:
1. Moving code to the dataitem's OnAftergetrecord() with the following
IF ISSERVICETIER THEN
code...
still i getting the data in the excel,excel is getting generated. But without any data.
0
Answers
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Yes, it is.
And the companies in both classic and Rtc are also same.
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Section Level coding will not work on RTC reports You have to write the code at
onpredataitemtriger or on aftergetrecords
Regards
Akhilesh
Akhilesh
http://navconsultant.com/
http://www.linkedin.com/in/akhileshek
Can u please, tell me how can i identify the nav service in a machine.
Is it the service Named Microsoft Dynamics Nav server, running with my login id.
Can u please, tell me how can i identify the nav service in a machine.
Is it the service Named Microsoft Dynamics Nav server, running with my login id.
It shows like localhost:7046/DynamicsNAV in RTC-> Microsoft Dynamics Nav-> Select server..
I think this is not the concern, its something related to code.
Mihail,
How could that be done.
as i have the Entercell code is on most of the section for Excel data entry.
And now the data is flowing into the excel for Rtc