dataitem("Sales invoice Line"; "Sales Invoice Line")
{
DataItemLink = "Document No." = field("No.");
DataItemLinkReference = Header;
DataItemTableView = sorting("Document No.");
column(HSN_SAC_Code_; "HSN/SAC Code") { }
column(CGSTAmount; CGSTAmount) { }
column(SGSTAmount; SGSTAmount) { }
column(IGSTAmount; IGSTAmount) { }
column(TotalGST; TotalGST) { }
column(TotalAmountwithGST_; TotalAmountwithGST) { }
column(GSTpercent; GSTpercentage) { }
column(SGSTpercent; SGSTpercentage) { }
column(IGSTpercent; IGSTpercentage) { }
trigger OnAfterGetRecord()
var
DGST: Record "Detailed GST Ledger Entry";
Salesinvline: Record "Sales Invoice line";
TotalAmountwithoutGST: Decimal;
begin
DGST.Reset();
DGST.SetRange("Document No.", CurrReport.Header."No.");
TotalGST := 0;
CGSTAmount := 0;
SGSTAmount := 0;
IGSTAmount := 0;
TotalAmountwithoutGST := CurrReport.Header.Amount;
if DGST.FindFirst() then
repeat
TotalGST += -DGST."GST Amount";
if DGST."GST Component Code" = 'CGST' then begin
CGSTAmount += -DGST."GST Amount";
GSTpercentage := DGST."GST %";
end;
if DGST."GST Component Code" = 'SGST' then begin
SGSTAmount += -DGST."GST Amount";
SGSTpercentage := DGST."GST %";
end;
if DGST."GST Component Code" = 'IGST' then begin
IGSTAmount += -DGST."GST Amount";
IGSTpercentage := DGST."GST %";
end;
until DGST.Next() = 0
else begin
TotalGST := 0;
CGSTAmount := 0;
SGSTAmount := 0;
IGSTAmount := 0;
GSTpercentage := 0;
SGSTpercentage := 0;
IGSTpercentage := 0;
end;
TotalAmountwithGST := TotalAmountwithoutGST + TotalGST;
end;
}
Previously i made mistake by linking "Sales Line" and "Detailed Gst Ledger Entry", i couldn't able to get values in my report. Later i tried linking "Sales Invoice Line" and "Detailed GST Ledger Entry", and also i used CurrReport.Header."No." . This time i can able to get current line values from Detailed GST Ledger Entry. The Above Code is perfect. Now i can able to get all cgst, igst and sgst values in my standard sales invoice report. Thank you all for your suggestions and responses. your responses helped me a lot to get solutions quicker.