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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set Datetime value to a param in Java in CE 10 env

Status
Not open for further replies.

podi80

Programmer
Sep 9, 2005
7
US
Hi All,

I need to set a value to a parameter which takes datetime type values. I am using java SDK in Crystal Enterprise 10 environment. Here is my code :

IReport oInfoReport = (IReport)oInfoObject;

IReportParameter oParam = null;
try {
int j = 0;
//Get a list of Parameters from the Report
java.util.List oReportParamaters = oInfoReport.getReportParameters();

while ( j < oReportParamaters.size())
{
oParam = (IReportParameter)oReportParamaters.get(j);
if ( oParam != null ) {

oParam.getCurrentValues().clear();
String sValue = parameters.getProperty(oParam.getParameterName().toUpperCase());

IReportParameterSingleValue currentValue = oParam.getCurrentValues().addSingleValue();

if (sValue != null)
{

currentValue.setValue(sValue);
currentValue.setNull(false);

}

}
j++;
}

}
catch ( SDKException sdke) {
System.out.println( "Exceptions getting paramater" );
System.out.print( sdke.toString() );
}

SetValue is only takes String as parameter, on the other end I am trying to set datetime value. How could I set a datetime value in Crystal Report from Java. I appreciate if some one could help me resolving this issue please.

Thanks
Podi.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top