Skip to main content

Posts

Showing posts from November, 2018

< jr:table >..< /jr:table > component in Jaspersoft Studio

Welcome Guys...!!! Today v'll learn inserting table in a report using Jaspersoft Studio. Basically Table component is used for displaying records with SEPARATE DATASET  and different query other than Main Report query. Step 1  :  Table component is always placed under SUMMARY band. If its placement is under detail band, entire table will print all over again multiple times to which equals to the result of RECORD COUNT in SQL query. Step 2  :   Create Dataset dialog window will be shown as below as soon as we drag Table element from palette. Select which Dataset is required for table to display, if datasets is already present in a report.Click Next .   Step 3  :  Selection of Data Adapter for creating New Dataset and click Next  as shown in below screenshot : Step 4  :  Writing query of the data adapter selected.Click Next. Select Fields which are required in that dataset. Click Next .   Step 5  : ...

$X{....} Parameter in Jasper report

Welcome Guys..!!! Today v'll learn Third type of Parameter $X{..} which is most useful while filtering a query. $X{...} Parameter acts as "conditions" applied to SQL query in where clause separated by Logical Operators (and / or ). 3 Basic steps to use $X{} Parameter in a report. Step 1 :  Change in Parameter "Default Value Expression". Step 2 :  Change the Report's "Dataset and Query Editor" Property with below keywords with correct syntax. Step 3 :  Preview and check the report output which works exactly as required. Below are the various keywords used in $X{} Parameter with different syntax and explained briefly their meaning with executable report screenshots. 1) EQUAL 2) NOTEQUAL 3) BETWEEN 4)  [ BETWEEN ] 5)  [ BETWEEN 6) BETWEEN ] 7) GREATER 8)  [ GREATER 9) LESS 10) LESS ] 11) IN 12) NOTIN 1) EQUAL : Keyword "EQUAL" works exactly as "=" (equals) operator in SQL ex : select * from address wh...

$P{...} and $P!{...} parameter types in Jasper report

Welcome Guys...!!! Today v'll learn most important first 2 types of parameters out of 3. 1) $P{Parameter_Name} 2) $P!{Parameter_Name} 3) $X{.......} Third type of Parameter is briefly explained in my next post for more deeper understanding. Step 1 : Create a executable report with a query where there are no parameters at first. In current example I will be using " select * from address " .    Step 2 :   Assuming filter on Field "City", here we will use following code in query. "select * from address where city= $P{city_name} " $P{city_name} is a newly created parameter with properties set as shown in below screenshot. Check or uncheck "Is for Prompting" property as value mentioned in "Default Value Expression" is set to "Dallas" . Hence ResultSet will only return records with city which matches value as Dallas.   Step 3 :  Finally 1st type of Parameter $P{...} returns desired output as shown in be...