malang Posted November 20, 2006 Share Posted November 20, 2006 Hi, I'm having problems with parameters(input controls) in Jasperserver. I have succefully added a "Report Query" in iReport with the following query:Code:select * from pku where pku_kundnr=$P!{kundnr}Where kundnr is a parameter in iReport. How do I add this to JasperServer? /Martin Link to comment Share on other sites More sharing options...
anandharaj Posted November 20, 2006 Share Posted November 20, 2006 How to you added the Report (jrxml) to Jasper Intelligence(JI)? is using the JI + iReport plugin? Basically, you need to create the input field and set the name of the field match to the parameter. If you add a report in JI called report unit, there is a option to add the input (input control). Link to comment Share on other sites More sharing options...
malang Posted November 20, 2006 Author Share Posted November 20, 2006 It works now, thanks! /Martin Link to comment Share on other sites More sharing options...
pentaho Posted February 11, 2009 Share Posted February 11, 2009 Hi, select * from customer where $P!{WhereClause} order by customer, city This is my query with parameter name WhereClause.How do i filter the report on customer & city .......customer & city are optional parameters, i have added only WhereClause parameter in iReport........If i publish the report in Jasperserver, how can i add customer & city parameters..... WhereClause default value is 1=1, Query is :select * from customer where 1=1 order by customer, city I want the query like: (Optional values) select * from customer where customer='aa' and city='X' order by customer, city Link to comment Share on other sites More sharing options...
rkm258 Posted February 11, 2009 Share Posted February 11, 2009 Hi, Define 4 parameters, 2 each for the customer and cityParameters - make customer_where and city_where invisible, while defining input controls. Define customer and city parameters as visible input controls in JasperServer for the user to select values.Note: This solution cannot take care of "where 1=1" filter1. customer <parameter name="customer" isForPrompting="true" class="java.lang.String">2. customer_where <parameter name="customer_where" isForPrompting="false" class="java.lang.String"> <defaultValueExpression><![CDATA["customer=$P{customer}"]></defaultValueExpression> </parameter>3. city <parameter name="city" isForPrompting="true" class="java.lang.String">4. city_where <parameter name="city_where" isForPrompting="false" class="java.lang.String"> <defaultValueExpression><![CDATA["and city=$P{city}"]></defaultValueExpression> </parameter> Finally have your query asselect * from customer where $P!{customer_where}$P{city_where} order by customer, city Hope this will help.Ram Link to comment Share on other sites More sharing options...
pentaho Posted February 12, 2009 Share Posted February 12, 2009 Thanks for the Info..... Post Edited by pentaho pentaho at 02/12/09 05:47 Link to comment Share on other sites More sharing options...
pentaho Posted February 12, 2009 Share Posted February 12, 2009 Hi,Got the solution...............Single JRXML query can be filter based on WhereClause Values........For the below query...........select monitor_name, customer_name, server_name, monitor_typefrom Monitorwhere $P!{WhereClause}order by customer_name, server_namehttp://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/Test/incd&standAlone=true&ParentFolderUri=/reports/Test&WhereClause=customer_name='abc' and server_name='Ser1'The JRXML file i have added only one parameter WhereClause and the default value is 1=1........If you are publishing the jrxml file, add input control(parameter name) as WhereClause, Type as single value and locally defined & data type name as WhereClause, Type as Text/number/date/datetime. Finally in URL you can pass any parameters.............Filter the data by passing dynamic fields to WherClauseType 1:customer_name, & server_nameWhereClause=customer_name='abc' and server_name='Ser1'http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/Test/incd&standAlone=true&ParentFolderUri=/reports/Test&WhereClause=customer_name='abc' and server_name='Ser1'Type 2:monitor_name and monitor_typeWhereClause=monitor_name='mn1' and monitor_type='mt'http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/Test/incd&standAlone=true&ParentFolderUri=/reports/Test&WhereClause=monitor_name='mn1' and monitor_type='mt'Type 3:monitor_id and monitor_placeWhereClause=monitor_id='mid1' and monitor_place='mp'http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/Test/incd&standAlone=true&ParentFolderUri=/reports/Test&WhereClause=monitor_id='mid1' and monitor_place='mp' Filter the RecordsJust add the& WhereClause=monitor_id='mid1' and monitor_place='mp' at the end of your URL.......... Donot Filter(All Records)If you want to display all values without filtering the data, default vaue expression for WhereClause is 1=1Your URL will be without WhereClausehttp://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/Test/incd&standAlone=true&ParentFolderUri=/reports/TestPost Edited by pentaho pentaho at 02/12/09 07:58 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now