Filter by tags:
August 17, 2015
How to resolve can't add a cell error - While Exporting to excel in Jasperserver
( AgileTech - Ankur Gupta )
Something of this sort
For resolving this you should check some of these errors:
1. Number to string cast exception:
This means that a number is wrongly appended to a string in which wrongly cast number into string.
In order to fix this, you will have to use the command as
new DecimalFormat("##,#0.00").format(number).toString()
This will cast your number into two decimal places with the thousand separator.
2. Another error that can be checked is of any other cast errors, or formatting of the data in the report.
Cheers!!
August 17, 2015
February 11, 2015
Setting mail account for Subscription of scheduled Jobs in JasperServer.
( AgileTech - Ankur Gupta )
I wanted to document the process from a long time but due to crunch of time I could not, but now I will like to explain the process in simple easy to follow steps.
First of all I would like to give an idea to problem addressed in the blog, basically when a report runs as a daily status or daily count one need not run it manually it could be scheduled, but when the report is scheduled the export in desired form is exported on jasper server.
But wait a minute do we really login and see what the results came as in the PDF, Excel etc. export, no we need not the problem is handled by mail subscription attached to the scheduler, which will automatically send the Exports to the subscribers on their email accounts and send a confirmation to the administrator.
So lets cut the explanation and lets jump directly into how to do.
Prerequisites -
1. You should have working copy of JasperServer community/pro
2. You should have uploaded a report to the server
3. Choose you favourite text editor (Windows(default) - Notepad/MacOS(default) - TextEdit)
4. Shut down the jasper server 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- Make the changes and save the file.
report.scheduler.mail.sender.username=testpanda@gmail.com
report.scheduler.mail.sender.password=password
report.scheduler.mail.sender.from= testpand@gmail.com
report.scheduler.mail.sender.protocol= smtp
report.scheduler.mail.sender.port= 587
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>
February 11, 2015
January 20, 2015
Before following the steps there would be requirement of following softwares-
1. WinSCP - To browse the files in Linux machine
2. PuTTy - To run the commands for export/import in the Linux shell
January 20, 2015
January 12, 2015
So the post will have two portions, namely Installation and Setup.
- Java –
As Jasper Reports is built on Java platform, so a proper installation of Java Development kit (jdk) is required. For official steps to install java one can refer to the link
https://www.java.com/en/download/help/windows_manual_download.xml - iReport Designer –
This is a third party Jasper Report designing software. iReport is the most popular visual designer tool for JasperReports Library and JasperReports Server (Business Intelligence).
The software can be downloaded in an exe run able format for windows machine, or other types of files as per the platform demands.
http://community.jaspersoft.com/project/ireport-designer/releases - Jasper Server –
This is the software which acts as the interface which provides web touch to the reports rather makes it interactive in terms of external links and the drill downs
Below is the link from where the file could be downloaded.
http://community.jaspersoft.com/project/jasperreports-server/releases - Database Server -
The database server or the datasource which serves the purpose of feeding data to the report, in this projects case the setup was in the SQL Server 2008, which could vary from project to project .
- Netbeans(Optional) –
https://netbeans.org/downloads/ (Download the SE version)
- Java –
Download and install java 7, please do mind not to install Java 8 as it is yet not supported by iReport. - iReport Designer –
After installing the iReport, first thing you need to do is that the inclusion of java connector
Below is the process to include the Java Connector
i. Download the Java connector for the Datasource, as we have the SQL Server datasource we need to download
http://www.java2s.com/Code/Jar/s/Downloadsqljdbc120jar.htm
For more info on the Connector follow the link -- https://docs.oracle.com/cd/E19501-01/819-3658/gcfoy/index.html
ii. Navigate to Tools—> Options Classpath
And select the Add JAR, and then browse to the downloaded path of the connector
Now we need to add a JDBC datasource
i. Click on the icon shown below on the top of the iReport window
- ii. In the popup select New Select The Datasource type as Database JDBC Connection
iii. Now Enter the name of the connection, select the SQL Server driver and enter the name of the database in the url of the database, also key in your credentials, refer to the screenshot below
iv. Now test the connection, it will say the connection successful.
We are now ready to create reports. - Jasper Server –
After installation in order to run Jasper Server open the browser and key in
localhost:8080/jasperserver
Then login using the credentials jasperadmin/jasperadmin
Then setup the connection, righ click on the node and add a datasource
Enter the details below, for the connector and setup the datasource.
January 12, 2015
November 20, 2014
2. If that does not resolves the issue then you can set the property Error type to Blank
November 20, 2014
November 2, 2014
Jasper Reports Server is basically a stand alone as well as embedded reporting server which can be easily used for deploying the Jasper Reports. It provides a way to embed reports as well as analytics into a web or mobile application, as well as act a informational hub.
Server is made to securely share and manage the Jasper reports and analytic views. The security feature is implemented via role management and user creation facility in Jasper Server.
Now there are two ways you can use Jasper Server
1. Standalone application
2. Embed into services, or applications.
Now moving on to the Source Code Management,
What benefits do Source Code Management tools provide?
- Collaboration: SCM tools prevent one user from accidentally overwriting the changes of another, allowing many developers to work on the same code without stepping one each other's toes.
- History: SCM tools track the complete development history of the software, including the exact changes which have occurred between releases and who made those changes.
- Release notes generation: Given the tracking of each change, the SCM can be used to generate notes for their software releases which accurately capture all of the changes included in the new release.
- Documentation and test management: SCM tools can be used to manage not just software source code, but also test suites and documentation for their software.
- Change notifications: To keep interested members of the team informed when changes occur to the source code.
Who uses SCM tools?
- Project developers who are writing source code.
- Project testers who need to download the very latest changes.
- Advanced users who want to try out code that is not yet stable, mature or released.
Jasper Server always keeps the original content on the server and provides the user with an instance of the report which is directly stored in the Temp folder, and if you need the modified version you have created as the current version then you need to replace the report with the current version of the report, by right clicking on the report in the repository and then replacing the report.
In light of this feature there is also a extreme care to be taken that which version is being replaced, because if once replaced the version of the report will be changes and it would be not possible to roll back the change.
This feature is really very great when you need to work on the small modification in the report as you can draw a copy on the local system and work onto that until you get the desired modification as well as you can simultaneously compare the previous version of the report and if you get the desired changes executed you can replace the report and have a new version of the report.
Hope this information helps you a lot!!
Cheers!!
November 2, 2014
September 16, 2014
- Select the datasource, if subdataset is created then we can use that or simply the main dataset could be used. For the tutorial Main dataset is used
- Next will appear the grouping criteria for the rows which in short means that which field(s) will come on the Rows of the Cross Tab. We need the car companies on as the rows which are unique.
- Next will appear the grouping criteria for the Columns which in short means that which field(s) will come on the Columns of the Cross Tab. We need the Years on as the rows which are unique
- Next will be the Measure or the count of the value in particular grid.
Which in our case would be the number of cars of a particular company in a particular Year - Then will come the window to select the layout of the crosstab, this means here we can customize the looks of the cross tab by defining the colors and which columns to show/hide.
6. Now this brings to the completion of the crosstab, now we could see that a tab at the bottom left corner appeared showing the name of the Crosstab, as Crosstab 1. There we could see the columns and design of the Crosstab.
7. Now a very critical point is placement of the crosstab, this should be really placed in a report band wherein the data is calculated already and then is to be shown in crosstab, the most favorable band to show the CrossTab is Summary band, else it will throw an Error Incrementing crosstab dataset/ Crosstab already been processed.
Now to Explain the exceptionWhat "Crosstab data has already been processed" exception means?This exception is thrown if more data is added to the crosstab dataset after the crosstab has already been rendered.
This usually happens when a crosstab element is linked to the main dataset of the report (does not use a subdataset run) and the resetType attribute of the crosstab dataset does not match the place where the crosstab is rendered.
Crosstabs are special components that display aggregated data. And when they are linked to the main dataset of the report, you simply cannot put them in the detail section, because there is no data to aggregate from a single record.
Such crosstabs could only reside on a group footer or on the summary section of the report and have the appropriate resetType value, so that their dataset is initialized each time after they are rendered.
If you still think you need to render one crosstab for each detail in the master document, then almost certainly this crosstab should be linked to a subdataset and not to the main dataset of the report.

3. Open iReport and set up the Excel Datasource using the sampleds.xls
Cheers!!
September 16, 2014
March 24, 2014
Now how to create styles, there are two methods basically:
1. External Style Sheet (jrtx file)
2. Declaring Internal Styles in the report itself.
The advantages of using external Style sheet is that it provides modularity and re-usability of the style over large number of reports using similar kind of styles. On the other hand, Internal styles would only contains the styles definitions for a particular report.
How to apply styles in the reports(iReport).
1. Locate the Styles node in the Report Inspector.
2. Right Click on the node and add a new Style
3. Then you could define the properties of the Style in the in the properties pane. Properties like background-color,forecolor, outline,.. etc/
4. You could even click on the Style and add a conditional Style and define conditional styles, like alternate coloring and much more.
5. After defining the styles now in the application part, locate the element onto which you want to apply the style.
6. Select the particular style in the property called Style(could be found in the properties pane) of the Element.
I have created a simple tutorial video demonstrating the Styles in Jasper Reports. Click Here
Download the sample demonstrated in the video tutorial from here. The ZIP file contains :
1. The JRXML File
2. The jrtx Style.
The Sample uses the Sample database so no need to worry about the datasource.
Happy Coding.
March 24, 2014
Parameter Name | Type | Notes | |
LoggedInUser | User | Not usable in query input control, but is used as parameter to report | |
LoggedInUsername | String | Of logged in user | |
LoggedInUserFullName | String | Of logged in user | |
LoggedInUserEmailAddress | String | Of logged in user | |
LoggedInUserEnabled | Boolean | Is logged in user enabled? | |
LoggedInUserExternallyDefined | Boolean | Is logged in user externally defined? ie. authenticated externally | |
LoggedInUserTenantId | String | Of logged in user. Only relevant in Pro/Enterprise. | |
LoggedInUserRoles | Collection<string> | Current set of roles of logged in user. Useful for $X parameter | |
LoggedInUserAttributes | Map<string, string> | Not usable in query input control, but is used as parameter to report. Empty map if no attributes | |
LoggedInUserAttributeNames | Collection<string> | User profile attribute names. Useful for $X parameters. Empty collection if no attributes | |
LoggedInUserAttributeValues | Collection | - | |
LoggedInUserAttribute_<attribute name> | String | Attribute value for matched attribute name (like "att1") on the user. Empty string if no match. Only provided if defined in a query or as a report parameter. |
March 24, 2014
March 6, 2014
I’ve been working with Infor PM OLAP Server for almost four years now, I knew it when it was known as MIS Alea, before Infor took over MIS AG. It is one of those products you don’t select, a client has it and you have to work with it. I’ve always used Infor products, like Infor Office Plus and Infor Application Studio, in order to access to this OLAP database, but, last week, I tried to do it using my favourite reporting platform: JasperReports Server, so I’d like to share my findings.
First of all, i’d like to point out that Jaspersoft hasn’t certified this OLAP DB as a source of data. It is obvious, but I must say that I just want to tell you my experience, so I am not responsible for any misfunction caused, if you try to do what I did.
Infor PM OLAP Server (10.1.7 version, in my case) is tightly coupled to Microsoft Windows. Therefore, the interaction with JasperReports has to run through a standard, in this case XML for Analysis (XMLA). It is difficult to find information about Infor PM OLAP products on the Internet, so I relied on the documentation of the DVD which has the software, specially the “Provider for Infor PM OLAP” manual.
The default installation of Infor had the XML interface up and running. I just had to change the name of the server in the file C:\Program Files\Infor PM\OLAP\XMLA\DataSources.xml, I replaced the default host, localhost, by the name of my server (for this post inforserver), I also enabled the Basic Authentication on the site InforPMOLAPXmla. After I restarted IIS, I browsed through the URL of the interface: http://inforserver/InforPMOlapXMLA/XmlaWebService.asmx
Later on, I started to work with iReport by creating an OLAP connection (option XMLA Server of the datasources dialog). I could test the connection and get the metadata I needed: datasource, catalog and cube. The problems began when I tried to execute a MDX query through iReport, I didn’t get an error but nothing happened. I searched for a solution on the Internet and I realized that you have to perform the fields mappings manually, the JasperReports Ultimate Guide was very helpful at this point. After an effort, I had my first test report and, of course, it didn’t run:
Error filling print... XML/A fault: The server did not recognize the value of the header
HTTP SOAPAction: "urn:schemas-microsoft-com:xml-analysis:Execute".; Code: Client;
net.sf.jasperreports.engine.JRRuntimeException: XML/A fault: The server did not recognize the
value of the header HTTP SOAPAction: "urn:schemas-microsoft-com:xml-analysis:Execute".; Code: Client;
at net.sf.jasperreports.olap.xmla.JRXmlaQueryExecuter.handleResultFault(JRXmlaQueryExecuter.java:494)
at net.sf.jasperreports.olap.xmla.JRXmlaQueryExecuter.parseResult(JRXmlaQueryExecuter.java:335)
at net.sf.jasperreports.olap.xmla.JRXmlaQueryExecuter.createDatasource(JRXmlaQueryExecuter.java:130)
at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1112)
at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:689)
at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1281)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:900)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:152)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:464)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:300)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:757)
I researched the issue and, finally, I had to modify the source code (version 5.2.0) of the class net.sf.jasperreports.olap.xmla.JRXmlaQueryExecuter I changed the line 222 of the method createQueryMessage:
mh.setHeader("SOAPAction", "\"urn:schemas-microsoft-com:xml-analysis:Execute\"");
to
mh.setHeader("SOAPAction", "urn:schemas-microsoft-com:xml-analysis:Execute");
This is the great advantage of the open source! I compiled the source code, took the file jasperreports-5.2.0 and changed the one shipped with iReport. I tried a preview of my report and, ufs, another exception:
net.sf.jasperreports.engine.JRRuntimeException: Could not find dimension "MONTH" on axis 1.
at net.sf.jasperreports.olap.JROlapDataSource.getDimensionIndex(JROlapDataSource.java:451)
at net.sf.jasperreports.olap.mapping.MappingParser.getDimensionIndex(MappingParser.java:75)
at net.sf.jasperreports.olap.mapping.MappingParser.tuplePosition(MappingParser.java:363)
at net.sf.jasperreports.olap.mapping.MappingParser.member(MappingParser.java:263)
at net.sf.jasperreports.olap.mapping.MappingParser.memberMapping(MappingParser.java:163)
at net.sf.jasperreports.olap.mapping.MappingParser.mapping(MappingParser.java:133)
at net.sf.jasperreports.olap.JROlapDataSource.init(JROlapDataSource.java:322)
at net.sf.jasperreports.olap.JROlapDataSource.(JROlapDataSource.java:122)
at net.sf.jasperreports.olap.xmla.JRXmlaQueryExecuter.createDatasource(JRXmlaQueryExecuter.java:141)
at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1112)
at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:689)
at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1281)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:900)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:152)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:464)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:300)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:757)
This time it was a bit more difficult to find the error, I had to debug and I found that Infor PM return the dimension name between [], so I modified the class net.sf.jasperreports.olap.JROlapDataSource, changing the line 431 of the method getDimensionIndex
if (dimension.equals(hierarchy.getDimensionName()))
to
if (dimension.equals(hierarchy.getDimensionName()) ||
(("[" + dimension + "]").equals(hierarchy.getDimensionName())))
Once I compiled and changed the file on iReport, I could run the report properly.
The next step was to move the report to JasperServer. The first task here was to replace the default jasperreports-5.2.0.jar by the one I modified. After that, I restarted JasperReports Server. When I tried to run the report, I got the following exception:
net.sf.jasperreports.engine.JRRuntimeException: Message-Call failed.
at net.sf.jasperreports.olap.xmla.JRXmlaQueryExecuter.executeQuery(JRXmlaQueryExecuter.java:310)
at net.sf.jasperreports.olap.xmla.JRXmlaQueryExecuter.createDatasource(JRXmlaQueryExecuter.java:127)
...
Caused by: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl:
java.security.PrivilegedActionException:
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl:
Bad response: (401Unauthorized at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:157)
at net.sf.jasperreports.olap.xmla.JRXmlaQueryExecuter.executeQuery(JRXmlaQueryExecuter.java:306) ... 16 more
It was exasperating! According to this forum post, the cause rely on the JVM, so I adapted me to the circumstances and revert the first change I made on the source code (“\”urn:schemas-microsoft-com:xml-analysis:Execute\””). I know have two different versions of the file jasperreports-5.2.0.jar: one for iReport and one for JasperServer.
March 6, 2014
Pages
About
Planet Jaspersoft aggregates blog posts from our community. If you would like your blog to be included in the Planet, please follow this help guide. Or just click this link to go straight to your Planet Feeds.
Feed Sources
- (-) Remove AgileTech - Ankur Gupta filter AgileTech - Ankur Gupta
- (-) Remove Paco Saucedo's blog » JasperReports filter Paco Saucedo's blog » JasperReports
- JasperSoft BI Suite Tutorials - Sadakar Pochampalli (159) Apply JasperSoft BI Suite Tutorials - Sadakar Pochampalli filter
- Jaspersoft Tutorials (50) Apply Jaspersoft Tutorials filter
- Technology Blog (50) Apply Technology Blog filter
- Jaspersoft Tech Talks (47) Apply Jaspersoft Tech Talks filter
- The Open Book on BI (26) Apply The Open Book on BI filter
- Bekwam Data as a Service (21) Apply Bekwam Data as a Service filter
- Ankur Gupta - Youtube (17) Apply Ankur Gupta - Youtube filter
- Rajesh Sirsikar (16) Apply Rajesh Sirsikar filter
- Digital Gene (15) Apply Digital Gene filter
- Tech Poet (13) Apply Tech Poet filter
- iTransparent - Jaspersoft Blog (9) Apply iTransparent - Jaspersoft Blog filter
- David Hoppmann's JasperServer Posts (2) Apply David Hoppmann's JasperServer Posts filter
- Jasper Related Posts from Wedjaa (1) Apply Jasper Related Posts from Wedjaa filter
- Kamal's YouTube videos (1) Apply Kamal's YouTube videos filter