cancel
Showing results for 
Search instead for 
Did you mean: 

SAP B1 Invalid argument provided on Print Preview Crystal Reports

0 Kudos

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?

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

I solved it.

In my form using screen painter, I set the form ObjectType="23", same as that for Sales Quotation and it now works.