microsoft / microsoft/ALAppExtensions
Event OnFetchReportLayoutByCode missing
Nobody has claimed this yet.
- Dominant language
- AL
- Stars
- 988
- Forks
- 692
- Avg merge
- 49m
- Merged PRs (30d)
- 1
Description
Why do you need this change?
Create event to modify the layout state before printing but after a runmodal with the new method (Report Layout List 2000000234)
Describe the request
In CU44, there's a "FetchReportLayoutByCode" function to modify the layout before printing but after a runmodal.
Use with the old "Custom Report Layout". I can call a custom report before launching a report.
[EventSubscriber(ObjectType::Codeunit, Codeunit::ReportManagement, OnFetchReportLayoutByCode, '', false, false)]
local procedure OnFetchReportLayoutByCode(ObjectId: Integer; LayoutCode: Text; var TargetStream: OutStream; var IsHandled: Boolean)
var
CustomReportLayout: Record "Custom Report Layout";
TempBlobIn: codeunit "Temp Blob";
TempInStream: InStream;
lSingleInstance: Codeunit "NVW NaviWest SingleInstance";
begin
LayoutCode := lSingleInstance.GetLayout();
if not CustomReportLayout.Get(LayoutCode) then
LayoutCode := '';
if LayoutCode <> '' then begin
CustomReportLayout.GetLayoutBlob(TempBlobIn);
TempBlobIn.CreateInStream(TempInStream);
CopyStream(TargetStream, TempInStream);
IsHandled := true;
end;
end;
With the new method (Report Layout List 2000000234), is it possible to create a "OnFetchReportLayoutByCode" event to modify the layout state before printing but after a runmodal ? I haven't found a solution.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the ReportManagement codeunit and the Report Layout List method 2000000234, then compare its flow with the CU44 FetchReportLayoutByCode behavior described in the issue. The work is done when an OnFetchReportLayoutByCode event is available at the requested point after runmodal and before printing, with the needed layout data and handled state exposed.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100