.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
.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