mohdshadab
Programmer
On executing this code for generating report we get this error
com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException: Missing parameter values.---- Error code:-2147217394 Error code name:missingParameterValueError
Our report calls a Stored Procedure which takes 2 params.Have tried all tricks to set the params but to no luck.plz help.
ReportClientDocument clientDoc = (ReportClientDocument) session.getAttribute("oClientDoc");
Fields parameterFields = (Fields) session.getAttribute("parameterFields");
clientDoc.verifyDatabase();
ByteArrayInputStream byteIS = null;
byte[] buf = new byte[2000 * 1024];
int nRead = 0;
FileOutputStream outputStream = null;
ParameterField newParameter0 = new ParameterField();
ParameterField newParameter1 = new ParameterField();
ParameterField pField0 =null;
ParameterField pField1 =null;
pField0 =(ParameterField) clientDoc.getDataDefinition().getParameterFields().getField(0);
pField1 =(ParameterField) clientDoc.getDataDefinition().getParameterFields().getField(1);
newParameter0 = (ParameterField)parameterFields.getField(0);
newParameter1 = (ParameterField)parameterFields.getField(1);
pField0.copyTo( newParameter0, true );
pField1.copyTo( newParameter1, true );
newParameter0 = (ParameterField)parameterFields.getField(0);
newParameter1 = (ParameterField)parameterFields.getField(1);
clientDoc.getDataDefController().getParameterFieldController().modify(pField0, newParameter0);
clientDoc.getDataDefController().getParameterFieldController().modify(pField1, newParameter1);
byteIS = (ByteArrayInputStream) clientDoc.getPrintOutputController().export(ReportExportFormat.MSExcel);
outputStream = new FileOutputStream("C:\\abcd.xls");
while ((nRead = byteIS.read(buf)) != -1) {
outputStream.write(buf, 0, nRead);
}
outputStream.flush();
outputStream.close();
byteIS.close();
com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException: Missing parameter values.---- Error code:-2147217394 Error code name:missingParameterValueError
Our report calls a Stored Procedure which takes 2 params.Have tried all tricks to set the params but to no luck.plz help.
ReportClientDocument clientDoc = (ReportClientDocument) session.getAttribute("oClientDoc");
Fields parameterFields = (Fields) session.getAttribute("parameterFields");
clientDoc.verifyDatabase();
ByteArrayInputStream byteIS = null;
byte[] buf = new byte[2000 * 1024];
int nRead = 0;
FileOutputStream outputStream = null;
ParameterField newParameter0 = new ParameterField();
ParameterField newParameter1 = new ParameterField();
ParameterField pField0 =null;
ParameterField pField1 =null;
pField0 =(ParameterField) clientDoc.getDataDefinition().getParameterFields().getField(0);
pField1 =(ParameterField) clientDoc.getDataDefinition().getParameterFields().getField(1);
newParameter0 = (ParameterField)parameterFields.getField(0);
newParameter1 = (ParameterField)parameterFields.getField(1);
pField0.copyTo( newParameter0, true );
pField1.copyTo( newParameter1, true );
newParameter0 = (ParameterField)parameterFields.getField(0);
newParameter1 = (ParameterField)parameterFields.getField(1);
clientDoc.getDataDefController().getParameterFieldController().modify(pField0, newParameter0);
clientDoc.getDataDefController().getParameterFieldController().modify(pField1, newParameter1);
byteIS = (ByteArrayInputStream) clientDoc.getPrintOutputController().export(ReportExportFormat.MSExcel);
outputStream = new FileOutputStream("C:\\abcd.xls");
while ((nRead = byteIS.read(buf)) != -1) {
outputStream.write(buf, 0, nRead);
}
outputStream.flush();
outputStream.close();
byteIS.close();