« Return to Thread: How can I fill a list-box with Birt Report Designer API ?

How can I fill a list-box with Birt Report Designer API ?

by flo_rian :: Rate this Message:

Reply to Author | View in Thread

Hi,
I've got a little problem.
I'd like to create a report (.rptdesign file) with Birt API (without using eclipse graphic tool).
I'd like to create a 'report parameter' which have a static list.
How can I add values to this static list ?

Here is an extract of my code :

public static void buildReportParameters(ElementFactory designFactory, ReportDesignHandle designHandle){
                ScalarParameterHandle scalarParameterHandle = designFactory.newScalarParameter("filtre_service");
               
                try {
                        scalarParameterHandle.setValueType(DesignChoiceConstants.PARAM_VALUE_TYPE_STATIC);
                        scalarParameterHandle.setDataType(DesignChoiceConstants.PARAM_TYPE_STRING);
                        scalarParameterHandle.setParamType("simple");
                        scalarParameterHandle.setPromptText("Application");
                        scalarParameterHandle.setControlType(DesignChoiceConstants.PARAM_CONTROL_LIST_BOX);
                       
                       
                       
                        scalarParameterHandle.setDistinct(true);
                        scalarParameterHandle.setCategory("Unformatted");
                                               
                        designHandle.getParameters().add(scalarParameterHandle);
                } catch (SemanticException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
       
        }
Thanks.
flo

 « Return to Thread: How can I fill a list-box with Birt Report Designer API ?