Dear all,
from the general ledger entries, we have the option for print the voucher for all the transactions. Right now we want to bring approvers name on the prints. (1st level, 2nd level etc) which comes from the Posted approval entries.
Approver 1 and approver 2 for this eg
what all the corrections need to do in this coding ..pls request all your helps
reportextension 58101 "ApproverId-GL Register" extends "GL Register Report One" { dataset { // Add changes to dataitems and columns here add("G/L Entry") { } add(PageLoop) { column(Approver1; Approver1) { } } modify("G/L Entry") { trigger OnAfterAfterGetRecord() var ApprovalEntry: Record "Posted Approval Entry"; begin Clear(Approver1); ApprovalEntry.Reset(); ApprovalEntry.SetRange("Document No.", "G/L Entry"."No."); IF ApprovalEntry.FindFirst() then Approver1 := ApprovalEntry."Approver ID" end; } } rendering { layout(LayoutName) { Type = RDLC; LayoutFile = './ReportLayouts/GLRegisterNewOnee.rdl'; } } var Approver1: Code[20]; Approver2: Code[20]; }
Thannks for the repsonse. its compiled sucessfully. but am facing an issue in rdl
while opening the rdl file, there is no dataset is showing. dont know what happend suddenly.
On Down Connect now is showing. i reisntalled microsft report builder also but none of the reports while opening dataset is not loading
what may be the issue?
Follow through the below steps. There's an easy way and a time consuming one too, see what works:
EASY (requires no logic, not recommended - use for triage purpose only):
In your current report extension, on OnAfterGetRecord of GL Entries dataitem. Or you can copy the default report into a new one and perform this there
1. If you know that the Number of approvers (Approval Sequence) is going to be less than 4, create 4 different variables
2. Now follow the below code and paste it
trigger OnAfterAfterGetRecord()
var
ApprovalEntry: Record "Posted Approval Entry";
begin
Clear(Approver1);
Clear(Approver2);
Clear(Approver3);
Clear(Approver4);
ApprovalEntry.Reset();
ApprovalEntry.SetRange("Document No.", "G/L Entry"."No.");
IF ApprovalEntry.FindSet() then
repeat
If ApprovalEntry."Sequence No." = 1 then
Approver1 := ApprovalEntry."Approver ID"
else
if ApprovalEntry."Sequence No." = 2 then
Approver2 := ApprovalEntry."Approver ID"
else
if ApprovalEntry."Sequence No." = 3 then
Approver3 := ApprovalEntry."Approver ID"
else
if ApprovalEntry."Sequence No." = 4 then
Approver4 := ApprovalEntry."Approver ID"
Until ApprovalEntry.Next() = 0;
end;
Print these 4 variables in 4 different text boxes in the report. The variables which do not have value will print blank
Challenging (requires logic & some understanding of report functioning in BC, recommended):
1. I'd recommend copy the default report and create a new one on a 50000 ID. If you do not know how to do that, do write back
2. In the copied report, add "Posted Approval Entries" as the child dataitem under G/L Entry & see if you can establish a DataItemLinkReference between GL Entry & Posted Approval Entries.
3. You do not need to write any code after DataItemLinkReference is specified. Read about it in MSDN blogs
4. Now declare columns for your Posted Approval Entries. In the report layout you may need to add a Sequence No subgroup to the GL Entry's original group
5. Run and see the report
Can you please try as per below?
reportextension 58101 "ApproverId-GL Register" extends "G/L Register"
{
dataset
{
// Add changes to dataitems and columns here
add("G/L Entry")
{
column(Approver1; Approver1)
{ }
column(Approver2; Approver2)
{ }
}
modify("G/L Entry")
{
trigger OnAfterAfterGetRecord()
var
ApprovalEntry: Record "Posted Approval Entry";
begin
Clear(Approver1);
ApprovalEntry.Reset();
ApprovalEntry.SetRange("Document No.", "G/L Entry"."Document No.");
IF ApprovalEntry.FindFirst() then
Approver1 := ApprovalEntry."Approver ID"
end;
}
}
rendering
{
layout(LayoutName)
{
Type = RDLC;
LayoutFile = './ReportLayouts/GLRegisterNewOnee.rdl';
}
}
var
Approver1: Code[20];
Approver2: Code[20];
}
|
Anyone pls help me on this?
am trying to extend the report. i don't have much exp in bc,its my starting stage.
Requirement is if there is one level or 2 level or 3 level approval is there in particular transaction it should display in the prints
error AL0682: A DataItem or Column with name '"G/L Entry"' could not be found in the target GL Register Report One.
what is the problem you are facing?
Thanks
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,188 Super User 2024 Season 2
Martin Dráb 230,030 Most Valuable Professional
nmaenpaa 101,156