on 2009 Jan 13 9:07 AM
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);
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.