cancel
Showing results for 
Search instead for 
Did you mean: 

Schedule a report with passing range parameters

Former Member
0 Kudos
86

I have wrote a program to run the crystal report in BO server and email to the user. The program can pass the parameter to the crystal report and generate different result/ report. It works well with string parameters, int parameter and date parameter. But when I pass the date range parameters, the CR in BO always displays error "Information is needed before this report can be processed. ", and in the CR history, the Parameters field is "No Parameter"

For single parameters, I will use the setValue() of IReportParameterSingleValue to set the param value

IReportParameterSingleValue v = prompt.getCurrentValues().addSingleValue();

v.setValue(paramValueArray<i>);

but I dunno how to set the date range value. Anyone ve ideas on this?

Here is some of my sample code.

rangeValue.setBeginValue(dateValue1);

rangeValue.setEndValue(dateValue1);

rangeValue.getEndValue());

rangeValue.setLowerBoundType(RangeValueBoundType.inclusive);

rangeValue.setUpperBoundType(RangeValueBoundType.inclusive);

newParam.getCurrentValues().add(rangeValue);

Accepted Solutions (0)

Answers (1)

Answers (1)

aasavaribhave
Product and Topic Expert
Product and Topic Expert
0 Kudos

I am not sure if you are using RAS or Enterprise SDK, but here are some code snippets to set range report parameters:

For scheduling:

// oReport is IReport object holding the crystal report.

oReportParameter = oReport.getReportParameters().get(i);

currentRangeValue = oReportParameter.getCurrentValues().addRangeValue();

currentRangeValue.getFromValue().setValue(dateParameter);

currentRangeValue.getToValue().setValue(dateParameter);

For viewing:

ParameterFieldRangeValue pfrv = new ParameterFieldRangeValue();

pfrv.setBeginValue(dateTimeValue);

pfrv.setEndValue(dateTimeValue1);

pfrv.setLowerBoundType(RangeValueBoundType.inclusive);

pfrv.setUpperBoundType(RangeValueBoundType.inclusive);

pf.getCurrentValues().add(pfrv);

f.add(pf);

f is Fields object and pass that to viewer.