Skip to Content
0

ReportSDKException: Can not create temp file: Missing parameter values.-— Error code:-2147215357

Jun 02, 2017 at 09:06 AM

133

avatar image
Former Member

Hi All,

Can any one help on this , we are using JAVA crystal apis to connect and export the crystal report to pdf format , and I am getting below issue .

com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Can not create temp file: Missing parameter values.-— Error code:-2147215357

Below is the method used to get the ReportClientDocument

public static ReportClientDocument getDocumentFromInfoStore(IEnterpriseSession enterpriseSession, String reportFolderPath, String reportName)
                            throws SDKException, Exception{
    
        try {
            IInfoStore iStore = (IInfoStore) enterpriseSession.getService("InfoStore");
            
            //Get report's parent folder id
            int folderID = getReportFolderId(reportFolderPath, iStore);
            
            if (folderID == 0){
                throw new Exception("InternalReportException : Invalid Folder Path - Report parent folder can not be found in path :" + reportFolderPath);
            }
            //Get ReportClientDocument object    
            IInfoObjects infoObjects = iStore.query("Select SI_ID, SI_NAME, SI_LOGONINFO, SI_PROCESSINFO From CI_INFOOBJECTS Where SI_NAME='" + reportName + "' And SI_INSTANCE=0 AND SI_PARENTID =" + folderID);
            if (infoObjects.size() == 0){
                throw new Exception("InternalReportException : Report object '"+ reportName + "' could not be found.");
            }
            IInfoObject infoObject = (IInfoObject) infoObjects.get(0);  
            
            ReportLogger.debug(" Retrieved report under '" + reportFolderPath + "' folder is :::: " + infoObject.getTitle() + " :: ID :: " + infoObject.getID() );
            
            IReportAppFactory reportAppFactory = (IReportAppFactory) enterpriseSession.getService("RASReportFactory");            
            //Open the report file            
            return reportAppFactory.openDocument(infoObject, OpenReportOptions._refreshRepositoryObjects , Locale.ENGLISH);
            
        } catch(SDKException exe){            
            ReportLogger.error("SDKException occurred in IntenalReportGenerator.getDocumentInfoStore() method",exe);
            throw exe;
        } catch(Exception exe){
            ReportLogger.error("Exception occurred in IntenalReportGenerator.getDocumentInfoStore() method",exe);
            throw exe;
        } 
    }

Below is the method used to set the parameters.

private static boolean setParameter(Hashtable reportParam, ReportClientDocument clientDoc) throws Exception{
        try {
           
            ParameterFieldController paramFieldController = clientDoc.getDataDefController().getParameterFieldController();            
            Fields parameterFields = clientDoc.getDataDefinition().getParameterFields();
            for (int i = 0; i < parameterFields.size(); i++) {
                IParameterField paramToChange = (IParameterField) parameterFields.getField(i);
                String field = paramToChange.getName();             
                 
                if (field.substring(0, 1).equalsIgnoreCase("@"))
                    field = field.substring(1);
                else if (field.substring(0, 2).equalsIgnoreCase("V_"))
                    field = field.substring(2);
                String value = null;
                System.out.println("Fields:  :i= "+i+ "  "+field);
                if (reportParam.get(field) != null)
                    value = reportParam.get(field).toString();                
                else
                    value = "";
               
                
                IParameterFieldDiscreteValue newDiscreteValue = new ParameterFieldDiscreteValue();
                System.out.println("Setting Parameter value :i= "+i+ "  "+value);
                newDiscreteValue.setValue(value);
                ParameterField tempParam = new ParameterField();
                paramToChange.copyTo(tempParam, false);
                if (tempParam.getCurrentValues().size() > 0)
                    tempParam.getCurrentValues().remove(0);
                tempParam.getCurrentValues().add(0, newDiscreteValue);
                paramFieldController.modify(paramToChange, tempParam);
            }
            
        } catch (Exception exe) {
            ReportLogger.error("Exception occurred in IntenalReportGenerator.setParameter() method",exe);      
            throw exe;
        }
        return true;
    }
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers