Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal / FoxPro SetCurrentValue to NULL problem

Status
Not open for further replies.

skuhlman

Programmer
Joined
Jun 10, 2002
Messages
260
Location
US
.I'm using Visual FoxPro 7.0 and CrystalReports 8.5.

.Within my FoxPro code, I'm adding an OLE Crystal Viewer to my form. I'm creating a Crystal Runtime App Object. I'm creating a Crystal Report object. Then I set various values and among other things I populate the parameters for the report. Here are the key lines of code:

g_oCRApp = createobject ("CrystalRuntime.Application")
g_oCRRep = createobject ("CrystalRuntime.Report")
thisform.AddObject("oleCrystalViewer", "oleControl", "crViewer.crViewer")

g_oCRRep.EnableParameterPrompting = .F.

g_oCRRep.parameterfields.item(1).setcurrentvalue(l_cFieldValue)

.The parameter is optional and goes through crystal to a stored procedure which knows how to use it no matter the value (including null).

.If I run the report directly through Crystal, I can set my parameter to null and the report works correctly.

.My problem is that through FoxPro, if l_cFieldValue is null, this command will not execute successfully. I can get away with not executing the line of code and the report shows up in preview mode fine. But then when I try to print the report it prompts for that parameter. I have a feeling that if I could .setcurrentvalue(.null.) things would work fine. Any suggestions? Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top