Please follow the steps in the attached document. If you cannot set the ID of report after loading, you have to dynamically query the ID from the table to access the report. Details are in given the document.
Attachment : Detail Document with Image
Step 1 : Create a crystal report for the Printlayout of the user defined form.The parameter of the crystal
report must be DocKey@ with type number. Ref the Image below
Step 2 : Upload this report to SAP B1.
Step 3 : Have to add the Event trigger in the InitialSettings.cs.Advertisement
Add the below codes in the
InitialSettings()
<Code>
Global.SapApplication.LayoutKeyEvent += new
SAPbouiCOM._IApplicationEvents_LayoutKeyEventEventHandler(SapApplication_LayoutKeyEvent);
<Code>
Add the event function to trigger the event function of “VPurchaseRequest.cs”
<code>
private void SapApplication_LayoutKeyEvent(ref SAPbouiCOM.LayoutKeyInfo eventInfo, out bool
BubbleEvent)
{
Global.bubblevalue = true;
if (eventInfo.ReportCode == "RCRI" & eventInfo.ReportTemplate == "RCRI0012")
{
VPurchaseRequest.Instance.SapApplication_LayoutKeyEvent(ref eventInfo, out
BubbleEvent);
}
BubbleEvent = Global.bubblevalue;
}
report must be DocKey@ with type number. Ref the Image below
Step 2 : Upload this report to SAP B1.
Step 3 : Have to add the Event trigger in the InitialSettings.cs.
Add the below codes in the
InitialSettings()
<Code>
Global.SapApplication.LayoutKeyEvent += new
SAPbouiCOM._IApplicationEvents_LayoutKeyEventEventHandler(SapApplication_LayoutKeyEvent);
<Code>
Add the event function to trigger the event function of “VPurchaseRequest.cs”
<code>
private void SapApplication_LayoutKeyEvent(ref SAPbouiCOM.LayoutKeyInfo eventInfo, out bool
BubbleEvent)
{
Global.bubblevalue = true;
if (eventInfo.ReportCode == "RCRI" & eventInfo.ReportTemplate == "RCRI0012")
{
VPurchaseRequest.Instance.SapApplication_LayoutKeyEvent(ref eventInfo, out
BubbleEvent);
}
BubbleEvent = Global.bubblevalue;
}
<code>
RCRI – Is the type code of Crsyatl report
RCRI – Is the type code of Crsyatl report