queries question

View: New views
1 Messages — Rating Filter:   Alert me  

queries question

by csharpfan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I need to select a some table in query. The name of that table is given in java class that passes it to my .jrxml file to be used in my querystring.

I set parameters in javacode like this:

Map<String, String> inputParameters = new HashMap<String, String>();
...
inputParameters.put(jrxmlFieldName1,jrxmlParameter1);
                        inputParameters.put(jrxmlFieldName2,jrxmlParameter2);
                        jasperReport = JasperCompileManager.compileReport(getJRXMLName());
                        jasperPrint = JasperFillManager.fillReport(jasperReport,
                                        inputParameters, connection);

I am trying to run the following query:

             <parameter name="selFileVersion" class="java.lang.String" isForPrompting="true" >
                <defaultValueExpression ><![CDATA["someFileVersion"]]></defaultValueExpression>
        </parameter>
        <parameter name="selId" class="java.lang.String" isForPrompting="true" >
                <defaultValueExpression ><![CDATA["Id"]]></defaultValueExpression>
        </parameter>
<queryString>
             <![CDATA[select * from $P{selFileVersion} where Id = $P{selId} ]]>
</queryString>
        <field name="Id" class="java.lang.String"/>

That querystring doesnt work. What is wrong?

Thank you in advance for soon reply!
LightInTheBox - Buy quality products at wholesale price!