[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[birt-report-engine-dev] How to set report parameter as query parameter

Hi...
I need to generate rptdesign programmatically, where i need to set runtime
report parameter as query parameter. This is what the code i wrote:

[code]

//Parameter Creation

ScalarParameterHandle
scalarParameterHandle=elementFactory.newScalarParameter("param");
		try {
		   
scalarParameterHandle.setValueType(DesignChoiceConstants.PARAM_VALUE_TYPE_STATIC);
		   
scalarParameterHandle.setDataType(DesignChoiceConstants.PARAM_TYPE_STRING);
		//    scalarParameterHandle.setParamType("simple");
		    scalarParameterHandle.setDefaultValue("abc");
		    scalarParameterHandle.setHidden(true);
		    scalarParameterHandle.setConcealValue(true);
		   
scalarParameterHandle.setControlType(DesignChoiceConstants.PARAM_CONTROL_TEXT_BOX);
		//    scalarParameterHandle.setDistinct(true);                            
		    scalarParameterHandle.setCategory("Unformatted");
		    reportDesignHandle.getParameters().add( scalarParameterHandle );
		} catch (Exception e1) {
		   e1.printStackTrace();
		   }

//DataSet Creation
 String extensionID =
"org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet";
    	  DataSet = elementFactory.newOdaDataSet("Data Set",extensionID);
    	  DataSet.setDataSource("Data Source");
    	  DataSet.setQueryText("select user_id,LOGGED_IN from pmtb_user_info
where user_id=?");
    	  designHandle.getDataSets().add(DataSet);
[/code]

Here i need to set parameter "param" to query text "user_id" as shown above.

Is anyone having idea about it?


-- 
View this message in context: http://www.nabble.com/How-to-set-report-parameter-as-query-parameter-tp21495973p21495973.html
Sent from the Eclipse BIRT - Report Engine - Dev mailing list archive at Nabble.com.