Skip to Content
0

SAP B1 Invalid argument provided on Print Preview Crystal Reports

Apr 25 at 08:57 AM

32

avatar image
Former Member

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?

untitled.png (28.4 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Apr 27 at 06:46 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded