Skip to Content
avatar image
Former Member

SAP B1 Invalid argument provided on Print Preview Crystal Reports

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

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

    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.

    Add comment
    10|10000 characters needed characters exceeded