Crystal Reports - the string "String" is required here.

I have a command line utility that generates one simple crystal report. I recently upgraded a project from .NET 1.1 to .NET 3.5 using the migration of Visual Studio 2008, and now I get an error message that I have never received before.

The problem is the work_order formula, which looks like this:

stringVar nvl_ship_wrk_id := "0"; stringVar nvl_ship_wrk_seq := "0"; If Not IsNull({FeedBOLInput.ShipWrkId}) Then nvl_ship_wrk_id := {FeedBOLInput.ShipWrkId}; If Not IsNull({FeedBOLInput.ShipWrkSeq}) Then nvl_ship_wrk_seq := {FeedBOLInput.ShipWrkSeq}; nvl_ship_wrk_id & " - " & nvl_ship_wrk_seq; 

And the error:

 - InnerException {"A string is required here. Error in File C:\\...\\temp_88c50533-02c6-4973-ae06-ed0ab1a603ac {0D5E96FB-038A-41C5-93A7-A9D199961377}.rpt: Error in formula <work_order>. 'stringVar nvl_ship_wrk_id := \"0\"; ' A string is required here."} System.Exception {System.Runtime.InteropServices.COMException} 

Does anyone know what this could be? I dont know. The data set is doing the right thing - and the error seems to point to a string that simply initializes the variable.

+4
source share
1 answer

You can try passing {FeedBOLInput.ShipWrkId} and {FeedBOLInput.ShipWrkSeq} a string to make sure that it appears as a string.

I'm not sure why what you have will not work, but see if it works below.

 stringVar nvl_ship_wrk_id := "0"; stringVar nvl_ship_wrk_seq := "0"; If Not IsNull({FeedBOLInput.ShipWrkId}) Then nvl_ship_wrk_id := CStr({FeedBOLInput.ShipWrkId}); If Not IsNull({FeedBOLInput.ShipWrkSeq}) Then nvl_ship_wrk_seq := CStr({FeedBOLInput.ShipWrkSeq}); nvl_ship_wrk_id & " - " & nvl_ship_wrk_seq; 
+7
source

All Articles