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?