Skip to Content
0
Apr 25, 2018 at 08:57 AM

SAP B1 Invalid argument provided on Print Preview Crystal Reports

253 Views Last edit Apr 25, 2018 at 01:07 PM 3 rev

I have this add-on that has a form that I use to get sales quotations.

I have linked them to the QUT Crystal Reports in SAP Business One. When I click on print preview however, the crystal report starts but then throws an error "Invalid argument provided".

I have checked and verified that the docentry number I am passing to LayoutKey exists.

What am I doing wrong? See below code and attached image of error.

//Add Layout Key Event Handler  
SboConnection.SboApplication.LayoutKeyEvent += new SAPbouiCOM._IApplicationEvents_LayoutKeyEventEventHandler(LayoutKeyEvent);

public void LayoutKeyEvent(ref SAPbouiCOM.LayoutKeyInfo eventInfo, out bool BubbleEvent)  
{  
BubbleEvent = true;  

if (docType == "I")  
{  
_form.ReportType = "QUT2";
 eventInfo.LayoutKey = docEntry.ToString();  
}  
else  
{  
_form.ReportType = "QUT1";
eventInfo.LayoutKey = docEntry.ToString();
}  
}

The crystal report DocKey@ is numeric.

How do I pass an integer/number to eventInfo.LayoutKey?

Attachments

untitled.png (28.4 kB)