FAQ Database Discussion Community


Jasper report Boolean

jasper-reports
I have a Boolean property in the domain object; so can be false, true or N/A if is null. I don't how could be the best option to represent it <field name="isOSX" class="java.lang.Boolean"> <fieldDescription><![CDATA[device.isOSX]]></fieldDescription> </field> ...

How to get last date of the month in Jasper Report date parameter input control?

jasper-reports,ireport
I am working on a jasper report using ireport and in that I am taking two input dates START_DATE and END_DATE from user. Now what I want is the END_DATE should be last date of the month for START_DATE. I searched on internet but I couldn't get write/get a condition...

Download Jasper report instead of opening in browser

jsf,jasper-reports
I am using PrimeFaces 5.1 and JSF 2.2 Following is my code: I am generating PDF file from TableModelDate method all works fine. But it is opening in my browser How can i download it without opening. public void PDF() throws JRException, IOException { HttpServletResponse httpServletResponse = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse(); simpleReport();...

Passing parameters to `In` clause

sql,jasper-reports,jaspersoft-studio
I am trying to pass parameters to Jasper report In clause. Below is what I tried in Jasper reports. SELECT * FROM `medication` WHERE $X{IN,idMeidication,$P!{parameter_name}} However it is keep on saying the parameter_name does not exists. If I convert my Jasper SQL to normal SQL, it will look like this...

Font embedded in main jasperreport but not in subreport when exporting to PDF

java,fonts,jasper-reports,ireport,jaspersoft-studio
When previewing my report in jasper studio everything looks fine, both mainreport and subreports use the correct font. Whenever I export the report to pdf it only displays the correct font in my main report and my header subreport. The footer subreport is using the standard font. The title in...

Jasper Reports:java.sql.SQLException: ORA-22905: cannot access rows from a non-nested table item

oracle,plsql,jasper-reports
I have requirment same output format have different reports and different tables.So what i implemented Oracle Piplined functions and jasper report >Report Query wrote below Oracle Stored Procedure FUNCTION VENDOR_TYPE(REPORT_TYPE IN VARCHAR2) RETURN T_VENDOR_TYPE pipelined C1 sys_refcursor; out_rec VENDOR_TYPE := VENDOR_TYPE(0, null, null, null); BEGIN IF REPORT_TYPE='1' THEN OPEN C1...

JBOSS 7.1.1 server hangs during the compilation of jasper reports

java,jboss,jasper-reports,client,server
My developer server is JBOSS AS 7.1.1 final and I have an app where I make dynamically an jasper report based on some arguments with these basic operations(download, compile, export to pdf, encode to base64, display on screen). The thing is that on my JBOSS it works perfectly, but when...

how to generate dynamic columns in dynamicreports via java

java,arrays,swing,jasper-reports,dynamic-reports
I wrote an app that gathers details about clients and generates a monthly report with Jasper Dynamic Report. until now , my report shows all fields, and some might be blank with some clients, and full in others. I want to make a dynamic report that chooses only the non...

Cannot cast from BigDecimal to String in jasper (weird error //$JR_EXPR_ID=18$)

jasper-reports,ireport
I have a jrxml file which has a field of BigDecimal value and when i try to execute the report. I get an error called " Cannot cast from BigDecimal to String in jasper". Im doing the report using ireport 5.6.0, and i get a weird error like this, 1....

Multiple Subreports in Main Report using same datasource

jasper-reports,jaspersoft-studio
I have a main report with 2 subreports. I am using a custom datasource to fetch the report contents. But only one subreport gets displayed when the main report is previewed in jasper studio (whichever subreport comes first). For eg. only report1.jrxml gets displayed.If I remove that subreport then report2.jrxml...

Jasper string functions method undefined error

function,jasper-reports
Using Jasper Reports 5.6.1. Added some text functions to a previously working text field jrxml (just want to truncate if longer than 75 chars). Works in iReport Studio, but not in Java. <textFieldExpression><![CDATA[IF(LEN($F{AccountName})<75,$F{AccountName},LEFT($F{AccountName},75)+"...")]]></textFieldExpression> Error message: Error occured while trying to fetch the HTML Output from the Jasper Service (Errors were...

Dot matrix printer is not continuing with half letter paper size

pdf,printing,jasper-reports,dot-matrix
I'm using an epson lx 300+II dot matrix printer and I'm using half letter size paper (tractor feed) and I have set custom paper size to width 8.5" and height 5.5". When I print one page it prints fine but if print more than one pages first page print fine...

set content header name in response in java

java,jasper-reports
I write this following code to write jasper report in rtf format.It works well, but it open or save with default name file.rtf. I want to set the name as Report name. oConn = oPool.getConnection(); ServletContext sServletContext = request.getSession().getServletContext(); String sReportPath = sServletContext.getRealPath(sFileName); JasperReport jReport = (JasperReport) JRLoader.loadObject(sReportPath); JasperPrint jPrint...

Updated JasperReports jasperserver to 6.1, but can't start it

jasper-reports,jasperserver
I updated jasperreports from version 5.0 to 6.1. I ran the jasperreports update script, and it appeared to run successfully. I installed it to a new folder, following all of the update directions. I am running Tomcat and Postgresql. However, I previously started jasperreports by running a script called: ./ctlscript.sh...

How to pass in-memory JasperReport Design to Spring View

java,spring,spring-mvc,jasper-reports,spring-boot
I've been working on this for quite a while but I can't find an exact solution for what I'm searching for. In short: I have a Spring Boot MVC application, that integrates JasperReports. These reports are supposed to be resizable. Therefore, I want to read the .jrxml via the XML-loader,...

jasper-reports generate empty pdf in linux

java,linux,pdf,fonts,jasper-reports
i have used jasper-reports 3.* my application-server is jboss OS is windows : every things is ok and generated pdf shown correctly but the problem is: 1. when OS is Linux : generated pdf is empty caused by : 1.maybe for fonts not exist!! i have tried these ways...

Creating XML for Jasper Reports

java,xml,jasper-reports
I use the following Java code to create an .xml file public static void main(String[] args) { try { ArrayList<MyBean> ll = new ArrayList<>(); ll.add(new MyBean(1)); ll.add(new MyBean(2)); FileOutputStream fos = new FileOutputStream("C:\\temp\\mybean.xml"); BufferedOutputStream bos = new BufferedOutputStream(fos); XMLEncoder xmlEncoder = new XMLEncoder(bos); xmlEncoder.writeObject(ll); xmlEncoder.close(); } catch (Exception e) {...

Jasper Reports Parse XML column-blob

java,xml,postgresql,jasper-reports
I am using postgresql as database. In db i have one column which contains xml with language codes. I want to parse that xml and get value trough the report language. select o.name,o.price from bookdefinations o This o.name contains that xml value: <?xml version="1.0" encoding="UTF-8"?> <values> <en-us>en value</en-us> <es>es value</es>...

Conditionally select a list node in iReport?

xpath,jasper-reports
How can I select a node from XML datasource by condition? Eg I have an xml that has multiple customer nodes. I now want to select all the customer whose type=business. <list> <customer> <type>business</type> <amount>10</amount> </customer> <customer> <type>private</type> <amount>20</amount> </customer> </list> What is the iReport jrxml expression for this? Do...

JSON Array in ireport

java,json,jasper-reports,ireport
I'm using ireport and json datasource to generate report, Issue is ireport is not looping through json array, My JSON file content is, { "PartOn":[ { "TypeOfPart":"Rotable" }, { "TypeOfPart":"Rotable1" }] } My jrxml file content is, <?xml version="1.0" encoding="UTF-8"?> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"...

How to call a jasper report through REST_V2 service with a specification what dataSource from repository should be used?

jasper-reports,jaspersoft-studio
I have this scenario: Created a jasper report and uploaded to JasperSoft Server: "MyTestReport" Uploaded report does not have a link to dataSource in JSS In JasperSoft Server I have defined two datasources: AGD and AGL I would like to call report through "rest_v2" service from database. My URL to...

IReport Java Long subtraction incorrect (possibly overflow)

java,jasper-reports,ireport
Trying to make a Jasper Report and I'm having troubles using Java's Date class. I am working with a .CSV file so unfortunately can't use SQL to solve my issues. I've narrowed it down to this statement: new Long( 1L * $V{Date2Long} - 1L * $V{Date1Long}) Where Date2Long and Date1Long...

Reporting tool for a java application

java,jasper-reports,report
I am developping a web application (front end Angularjs, back end Java). I am looking for a reporting tool. My client want editable reports (ie reports with inputs inside, like text input, combo box, ...) so he can fill them himself and then print them. (I know Ms Access can...

Field not found in jasperreports 3.5.3

jasper-reports,ireport
I added a data source to my report in iReport Designer , I then dragged some "Text Field"s from the Report Elements palette to the Detail band and I got an error compiling a jasper report: net.sf.jasperreports.engine.design.JRValidationException: Report design not valid : [jrc] 1. Field not found : deviceCostsDTO even...

SQL if statement with more conditions

sql,jasper-reports,jaspersoft-studio
I'm creating a automatic raport generator, hes getting al hes information out an database. You can see the progress in the pdf, in that progress you have an specific status, wich is always 0, 1, 2 or 3. If the status is 0-1 he should change an image to an...

Understanding the basics of Jasper reporting with Java

java,jasper-reports
I am just starting learning Jasper reports with Java. I searched through the web and did not find a good tutorial which teaches reporting from the very beginning. Tutorialspoint.com have a good one, but they use ANT for that. I can learn them after, but what I need now is...

NoClassDefFoundError: com/itextpdf/text/DocumentException when exporting jasper to pdf

java,jasper-reports,itext
I created a jasper report and now I need to export that report to pdf format. This is my code for that. // compiles jrxml JasperCompileManager.compileReportToFile(reportName + ".jrxml"); // fills compiled report with parameters and a connection JasperPrint print = JasperFillManager.fillReport(reportName + ".jasper", parameters, connection); // to view the report...

java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFSheet.setColumnWidth(II)V

java,jasper-reports
I am trying to generate Jasper Excel report.I am getting the exception like java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFSheet.setColumnWidth(II)V at net.sf.jasperreports.engine.export.JRXlsExporter.setColumnWidth(JRXlsExporter.java:212) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.setColumnWidths(JRXlsAbstractExporter.java:654) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportPage(JRXlsAbstractExporter.java:527) at...

Jasper Reports Dynamic Reports - DRException in HTTPServlets

java,servlets,jasper-reports,dynamic-reports
I have a servlet that calls the Jasper report class. protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub ReportGeneratorModel.generateReport(); response.sendRedirect("report.jsp"); } The ReportGeneratorModel calls a MYSQL database and then generates a report. public static void generateReport() { Connection connection = null; try {...

Using parallelism to generate a large number of PDF files in UNIX

java,unix,jasper-reports
So ultimately I need to write a large number of PDFs (40,000) on disk on a UNIX server and I'm trying to figure out a way to do this efficiently(faster/consuming less memory). I have been using JasperReports to create a template which recieves as Parameters(meaning the report doesn't hit the...

How to put two jasperReports in one zip file to download?

jsf-2,jasper-reports,outputstream,zipoutputstream
public String generateReport() { try { final FacesContext facesContext = FacesContext.getCurrentInstance(); final HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse(); response.reset(); response.setHeader("Content-Disposition", "attachment; filename=\"" + "myReport.zip\";"); final BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream()); final ZipOutputStream zos = new ZipOutputStream(bos); for (final PeriodScale periodScale : Scale.getPeriodScales(this.startDate,...

In Jaspersoft Studio, how do I use the DATEFORMAT() function?

jasper-reports,jaspersoft-studio
Here's a screenshot. I'm trying to turn the current date into July 1st of the current year using DATEFORMAT(). I learned how to do that in MySQL from this question, and I hoped it would work similarly in Jaspersoft Studio- turns out date_format( curdate(), '%Y-07-01' ) doesn't translate into DATEFORMAT(...

Jasper compilation error java.lang.NoClassDefFoundError it/businesslogic/ireport/IReportScriptlet

java,jasper-reports,ireport
Can you please guide which jar file need to be included to resolve this error in jasper compilation env. I am using IReports version 3.7.6 java.lang.NoClassDefFoundError:  it/businesslogic/ireport/IReportScriptlet     at java.lang.ClassLoader.defineClass1(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:791)     at java.lang.ClassLoader.defineClass(ClassLoader.java:634)   ...

Does JDK 8 supports JasperReports 6?

java,jasper-reports,java-8
I've been trying to get my report working for few days but still no luck. I have no idea if it's something wrong with the dependencies. I asked this question previously. Anyway i just want to know if anyone have used JasperReports 6 with JDK 8? after all i doubt...

JAVA_HOME not defined correctly

java,jasper-reports,jasperserver,java-home
I am attempting to update Jasper Reports Server, and having an issue with Java. It uses Tomcat to run java. I did not install java on this server, and I am not very familiar with java. Java was installed in a folder called /opt/jasperreports-server-cp-5.0.0/apache-tomcat/java/bin/. I do not believe Java was...

Jasperreports Textbox shouldn't split across page

jasper-reports
currently I'm trying to have a small PDF rendered with Jasperreports. The PDF is really really simple, it contains some info on the left and a Text that changes in his size on the right. However currently the List Subreport gots splitten so that the text box will got cut...

Jaspersoft - Can end user write data back to database?

sql,sql-server,jasper-reports,jasperserver,jaspersoft-studio
Is it possible to allow a Jasperreports/Jasperserver end user to write data back to the source database? For example, if a user is viewing a report that lists customer information, could the report be designed to allow the user to edit or write to a database field, such as a...

How to get date six month before current date in single line in Java?

java,jasper-reports
I want to get a date six month before from present date. The code that I tried is: SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd"); Calendar c = Calendar.getInstance(); c.add(Calendar.MONTH, -6); System.out.println(format.format(c.getTime())); But I want to reduce this to a single line expression which I want to use in my Jasper report...

How to put Subtotal in multiple col cells?

jasper-reports,dynamic-reports
How to put a subtotal in multiple cells? AggregationSubtotalBuilder totalBase = sbt.sum(total_, config.getColumn("base").getCol()); AggregationSubtotalBuilder member_count = sbt.text("Total Employes :", config.getColumn("code").getCol()); jrb.subtotalsAtGroupFooter( emp_number_group, member_count, totalBase ); ...

Anyone have an experience to embedding Visualize.js into APEX Application to integrate JasperServer Reports?

javascript,jasper-reports,jasperserver
does anyone have an experience in embedding Visualize.js into APEX Application to integrate JasperServer Reports ?! Using the REST or iFrame is not a case i'm afraid. Not a big fan of JavaScript, but it looks like the only way this time. Done some research and didn't find any usefull...

cascading Input Control sql query return error: “ORA-01427: single-row subquery returns more than one row”

oracle,jasper-reports,jasperserver
looking for solution on my sql query error.I'm trying to create second cascading Input Control in JaspersoftServer. The first Input Control works fine, however when I try to create a second cascade IC it returns with the error. I have 3 tables (user, client, user_client), many to many, so 1...

A XML related exception occurred while compiling the JasperReport

java,maven,jasper-reports
I'm getting this exception while compiling my jasper report which the exception is : net.sf.jasperreports.engine.JRException: org.xml.sax.SAXException: http://java.sun.com/xml/jaxp/properties/schemaSource at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:247) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:230) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:218) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:172) at...

iReport could not parse mapping document

hibernate,jasper-reports,ireport
I'm using Jasper iReport Designer 5.6.0 with Hibernate. I added my Class path which is related to my project but every time I try to test my Hibernate connection it comes up with the error like Could not parse mapping document from source../file.hbm.xml But everything seems to work just fine...

how to log mysql queries fired in jasper reports server?

jasper-reports,jasperserver,jaspersoft-studio
i have seen many results with same query in Google some i understood/tries and some not working and some suggests a solution which start from the middle. like this and tried this one made change in log4j.properties not working and this i have tried making those changes and saw catelina.out...

DynamicJasper & Webstart

java,jasper-reports,java-web-start,dynamic-jasper
I've got a problem using DynamicJasper 5.0.2 with a Webstart application. In eclipse -> No problem but in webstart I've got this error : \\storage1\homes\sourin-v\Bureau\DJR_5724_1433511783056_171003.java:4: error: package net.sf.jasperreports.engine does not exist import net.sf.jasperreports.engine.*; But I'm sure that JasperReport libraries (6.0.4) are in classpath because if I generate a "standard" jasper...

unsuported class version error ireport java maven vraptor

java,maven,jasper-reports,ireport,vraptor
i made jasper report with a field mapping to my project class and the report wont compile anymore. I put in classpath report the jar of my project which was generated from my exported project in eclipse. This project is a web java with framework vraptor and maven. my class...

DynamicReports/JasperReports third party unicode Font issue

java,pdf,printing,jasper-reports,dynamic-reports
I am using DynamicReports and struggling with getting the corrent printout, when i call .show() everything is perfect, but when i print it, either to an image using image printer or to PDF using Foxit Printer or even to my LaserJet Printer, result is same as shown in the picture...

How to install JasperReports as an Eclipse plugin with no internet connection? [duplicate]

java,plugins,eclipse-plugin,jasper-reports
This question already has an answer here: Installing a plain plugin jar in Eclipse 3.5 3 answers I need to create a report in Java with Spring. So I need to install a plugin for Eclipse, more specifically JasperReports as a plugin. The problem is that I don't have...

Jasper Report — Resource not found

php,jasper-reports,jasperserver,jaspersoft-studio
I am developing a jasper report in PHP I have tried embedded jasper library 0.9d -- PhpJasperLibrary-master After fixing part of the code in the library, It works normally but it cannot display table format which is very important for me to develop Jasper report so I give up in...

download jasper report to a specific location in the server

java,servlets,jasper-reports
My application is running in a tomcat server, and I have already developed a method to download a pdf file using jasper. What i need to do is, download that certain pdf to a location inside the server. I tried and I am not sure how to do it. jasperReport...

Error retrieving field value from bean

java,jasper-reports
I have a problem I'm trying to generate a report from java using JasperReports but i get an error. public void init() throws JRException { list= ef.comisionReporte(); JRBeanCollectionDataSource beanCollectionDataSource = new JRBeanCollectionDataSource(list); String reportPath = FacesContext.getCurrentInstance().getExternalContext().getRealPath("report2.jasper"); jasperPrint = JasperFillManager.fillReport(reportPath, new HashMap(), beanCollectionDataSource); } public void PDF() throws JRException, IOException {...

net.sf.jasperreports.engine.JRRuntimeException: Category series name is null

java,jasper-reports
I want to display a simple report with a textfield : "hello world". The problem is i'm getting an error message category series name is null and i don't know why. Does anybody have a clue? The server log net.sf.jasperreports.engine.JRRuntimeException: Category series name is null. at net.sf.jasperreports.charts.fill.JRFillCategoryDataset.customIncrement(JRFillCategoryDataset.java:142) at net.sf.jasperreports.engine.fill.JRFillElementDataset.increment(JRFillElementDataset.java:191) at...

How to pass fields from parent to sublist in JasperReports?

java,jasper-reports
I have a field variable that I get from a JavaBean as follows in my main report view: <field name="username" class="java.lang.String"> <fieldDescription><![CDATA[username]]></fieldDescription> </field> Now I also have a sublist for some nested objects, but the sublist should also have access to the username. The following does not work: <subDataset name="sublist">...

Report's text field's “stretch with over flow” option add empty row in PDF export

jasper-reports
I have set the "Stretch With Overflow" option True to some text fields , when the data over flow in the jasper viewer is working correctly, the text is on 2 rows but in PDF document the second row is empty: it just adds an empty row. Exemple xml code...

Jasper - Oracle - query result table is repeated

oracle,jasper-reports,rownum
I cannot get a complex query for a table in jasper to return a single table. It repeats the resultant table the same number of times as the number of rows that are returned. With a simple query I could overcome this by using where rownum<=1. With the following query,...

How to generate a doc file using Jasper Report

java,jasper-reports,doc
Using jasper-reports 5.6.1 I am able to generate the reports in pdf format, but I am not able figure out how to generate a .doc format by using jasper. byte[] exportReportToPdf = JasperExportManager.exportReportToPdf(print); is for generating a pdf format file like this is there any similar view class for doc...

Why can't I reference net.sf.jasperreports.engine.DefaultJasperReportsContext from JSF?

java,jsf,jasper-reports
I grabbed an old JSF (in Netbeans) project that I needed to update. I noticed that the libraries were missing, so I went and snagged the current version of JasperReports (.jar) and all the commons/other support .jars necessary. Ultimately, when I try to run the project it fails at the...

Report design not valid. Field not found Jasper Reports

java,jasper-reports
Im trying to create a basic jasper report with JRBeanCollectionDataSource. In there im having a list of objects inside the javabean. public class Course { private int id; private List<Student> students; } Student object looks like public class Student { private String name; private int id; } I want to...

How to use object of a class which contain object of another class as datasource in jasper report?

jasper-reports,jasperserver,jaspersoft-studio
I have two different classes, One is Person and another one is Address. The Person class has an object of Address class as one of its property. For example class Person{ String name; Address address; } I cannot change the structure of the class and cannot add any new collections...

JasperReport with spring MVC : print report on client side without displaying it

java,angularjs,spring-mvc,printing,jasper-reports
I am developping a Spring MVC - Angularjs application. I need to print reports, I chose JasperReport to do that. Before I move on, I want to know if I can generate a report, then directly print it on the default printer set up on the client computer (printer which...

Visualize.js authentication error after second login

jasper-reports,visualize
I have a website—utilizing Visualize.js—that has a simple login/logout feature. Everytime I login I call the authenicateUser() function and logout destroySession(). When I try login and then logout and then login again, when I try to render my existing reports I get this thrown error: HTTP Status 401 - Full...

How to create a sum variable in ireport?

jasper-reports
I am new to JasperReports and iReport designer. Now I have table in that I have a column salary . So I want to display the sum of all employees salary. for that I took a table from pallet created dataset. It displays the table perfectly , in footer I...

iReport : set a fixed height for detail band

jasper-reports,ireport
I'm using iReport with eclipse. I have to display a list of values and I need to set a fixed height for the area (detail band) where will be displayed the values. Let's say 10rows. Then below this detail band I have two fields that represent sums of the value...

How to add Multiple Variables in THEN clause When using WHEN THEN in Select statement

mysql,sql,jasper-reports,ireport,case-when
I am trying to use IN statement in where clause, I have written the following statement, and its giving me missing right parenthesis error message. I have google it but unable to find related solutions. The problem is in the following statement, it works fine when i use single arguments,...

Jasper server rest service returns unauthorized

c#,jasper-reports,httpclient,jasperserver
Using .NET Http client i login to jasper server. HttpResponseMessage loginResponse = loginClient.PostAsync("http://localhost:8080/jasperserver/rest/login", formContent).Result; IEnumerable<string> jaspsessid = loginResponse.Headers.GetValues("Set-Cookie"); Using above session id i pass to next request. HttpClient httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Add("Cookie", jaspsessid); httpClient.DefaultRequestHeaders.Accept.Add(new...

How to prevent page split between details band in JasperReports

jasper-reports
I have a report with two detail bands. First band shows an image, second shows its filename. However, on an occasion, an image would fit into a page in such a way that there is no place left for the text line below. And the filename would go to the...