Monday, May 4, 2015

Display $ sign before numeric amount field.

Use Pattern as : $#,##0.00

Tags: 
iReport
Jasper Studio

Monday, April 13, 2015

Display Column Total in Table Control - With the use of Variable






    Example :

    You can use the Table Control Footer Group Band and add variable in this Footer group band
    To achieve below output.

    Check mark the below highlighted check box to enable group band.
   


   Below is the report output.
Tags: 
iReport
Jasper Studio

Friday, April 10, 2015

REPORT SCHEDULING

You can schedule, set the output format, attachment, timing and notification with the use of below functionality



Before apply this step you have to follow the below instruction to set SMTP and parameter in two files.

Gmail Account Setting in Jasper
Setting mail account for Subscription of scheduled Jobs in JasperServer.

Prerequisites -
1. You should have working copy of JasperServer community/pro
2. You should have uploaded a report to the server
3. Shut down the jasperserver so that no sort of errors come in case of Editing/Saving documents.

After following the above prerequisites now we head on to edit two files as follows.
Both these files will be found at the location 
<directory of Jasperserver on Disk>/apache-tomcat/webapps/jasperserver/WEB-INF/

1. js.quartz.properties
   - Edit the file with the Text Editor
    -Change the portion of the document as 
    (Please select your own server details I have used a gmail account )
report.scheduler.mail.sender.host=smtp.gmail.com
report.scheduler.mail.sender.username=test@gmail.com
report.scheduler.mail.sender.password=password
report.scheduler.mail.sender.from= test@gmail.com
report.scheduler.mail.sender.protocol= smtp
report.scheduler.mail.sender.port= 587
- Make the changes and save the file.

2.   applicationContext-report-scheduling.xml
  -  Locate the bean reportSchedulerMailSender
  -  Locate the property javaMailProperties
  -  Do the changes as below - This will enable java to interact the smtp/startls authentication.      
         <props>
                <prop key="mail.smtp.auth">true</prop>
    <prop key="mail.smtp.starttls.enable">true</prop>
         </props>
  - Now save the document.
  
Now the report subscription is ready for run, just start the Jasperserver and you are good to go.

Tags: 
Jasperserver.

Sunday, February 15, 2015

Use Variable or With clause in Jasper Server.

With or Variable not working in Jasper Server.


I am getting error in subsequent report. if I use “common table expression” in MY/MS sql query in Jasperserver.

for example:
declare @var integer
or
with a as ( select…)

Solution for this problem:

Change the below parameter in /jasperserver-pro/WEB-INF/classes/esapi/security-config.properties  to generate the report.

security.validation.sql.on=true
and 
Go to // WEB-INF/classes/esapi/validation.properties

Find property:
Validator.ValidSQL=(?is)^\\s*(select)\\s+[^;]+;?\\s*$
And change in to:
Validator.ValidSQL=(?is)^\\s*(select|with|declare)\\s+[^;]+;?\\s*$

If you want to use other sql constructions (in start of query string), just add to regular expressions your sql command.


Tags: 
Mysql
Mssql
Jasperserver.

Thursday, September 25, 2014

Java Function - Fetch Last 4 Characters From String


Java Function V/S Jasper Expression.


Fetch Last 4 Characters From String
$V{VARIABLE_NAME}.substring(Math.max($V{VARIABLE_NAME}.length() - 4, 0))


tags: 
Java Functions.
Java Expression
String Manipulation

Thursday, August 14, 2014

Enable No Data Band


No data band use to display content/warning/error while main query not return a single row.





Follow the below step to use the"No Data" band of jasper report.

Step 1 : Right click on "No Data" band and select "Add Band" If it is not visible, More detail follow the section 1 of above image.

Step 2: select report (as mention in section 1 of above image) and right click as well select property option. Set "When No Data" as "No Data Section" property (detail display in section 2 of above image) 

Step 3 : Now run the report with no data query i.e. select 'Yes' where 1=2 so this query not return a single row so the result will display as mention in no Data section.


Tags: 
No Data Section.
When no data found display alert message.

Tuesday, August 5, 2014

Dynamic Columns Cross Tab Report.


Multi Columns Cross Tab Report.

You can generate the multiline cross tab report as par below output by providing raw data (There is 8 rows are the input and below table is the output of the cross tab report.)
Tags: 

Jasper Report
Multi Columns Report
Dynamic Columns

Cross Tab Report