Crystal Vs Thai Buddish Calender

  • Thread starter Thread starter Jonathan Woods
  • Start date Start date
J

Jonathan Woods

Hi there,

I have been a problem of passing DateTime Parameter value(Thai Buddish
Calender Value) to Crystal Report.


ParameterFieldDefinition myDef;
SCRPrintJob myPrintJob=new SCRPrintJob();
ParameterFieldDefinitions crParamDefs=new
ParameterFieldDefinitions(myPrintJob);
ParameterValues crParamValues=new ParameterValues();
ParameterDiscreteValue crParamDiscreteValue=new
ParameterDiscreteValue();


crParamDiscreteValue.Value=this.AccountDateFrom;//It is a value from DT
picker that displays Buddish Calender Value

crParamDefs=r_GLActivity.DataDefinition.ParameterFields;
myDef=crParamDefs["DateFrom"];
crParamValues=myDef.CurrentValues;
crParamValues.Add(crParamDiscreteValue);
myDef.ApplyCurrentValues(crParamValues);//<-- Following Err Msg appear
in there
----------------------
An unhandled exception of type
'CrystalDecisions.CrystalReports.Engine.ParameterFieldExcept­ion'
occurred in crystaldecisions.crystalreports.engine.dll
Additional Info:
Invalid parameter value: exceeds the Min or Max
or conflicts with existing value or edit mask
 
There could be several things going on here, but the first thing I see is
that you should remove this line

crParamValues=myDef.CurrentValues;

You do not need to get the reports current values to apply the new ones. In
fact I think that is an error. Try that first and report back

JIM


Hi there,

I have been a problem of passing DateTime Parameter value(Thai Buddish
Calender Value) to Crystal Report.


ParameterFieldDefinition myDef;
SCRPrintJob myPrintJob=new SCRPrintJob();
ParameterFieldDefinitions crParamDefs=new
ParameterFieldDefinitions(myPrintJob);
ParameterValues crParamValues=new ParameterValues();
ParameterDiscreteValue crParamDiscreteValue=new
ParameterDiscreteValue();


crParamDiscreteValue.Value=this.AccountDateFrom;//It is a value from DT
picker that displays Buddish Calender Value

crParamDefs=r_GLActivity.DataDefinition.ParameterFields;
myDef=crParamDefs["DateFrom"];
crParamValues=myDef.CurrentValues;
crParamValues.Add(crParamDiscreteValue);
myDef.ApplyCurrentValues(crParamValues);//<-- Following Err Msg appear
in there
----------------------
An unhandled exception of type
'CrystalDecisions.CrystalReports.Engine.ParameterFieldExcept­ion'
occurred in crystaldecisions.crystalreports.engine.dll
Additional Info:
Invalid parameter value: exceeds the Min or Max
or conflicts with existing value or edit mask
 
Thanks for your response.

I've already removed your suggested Line and test it. But, it does not
work same Error as mentioned before.
 
I think the problem is with DateTime. You probably need to pass a string,
not a DateTime structure. Crystal Reports is expecting a string criteria
like "1/1/2005" etc... Can you as a test simply hard code the value as a
string Date to see if that works ?

JIM
 
Back
Top