augarte
Members-
Posts
270 -
Joined
-
Last visited
augarte's Achievements
-
Hi, I'm trying to create a report using an excel datasource as subreport connection. If I create the subreport itself with the excel datasource it works ok. It has a numeric type column "COLUMN_2" defined as java.lang.Float. I would like to attach the files but don't find where can I do it. After that, I've created the main report with an empty datasource and a subreport connection defined as follows: new net.sf.jasperreports.engine.data.JRXlsxDataSource("...\SubreportDataSource.xlsx") When I try to preview the main report I get the following error: Error filling print... net.sf.jasperreports.engine.JRException: Unable to get value for field 'COLUMN_2' of class 'java.lang.Float' net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Unable to get value for field 'COLUMN_2' of class 'java.lang.Float' at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:782) at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:331) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:384) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:358) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2046) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:778) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:288) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:151) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:909) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:841) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:88) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:653) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:569) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:915) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:928) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Caused by: net.sf.jasperreports.engine.JRException: Unable to get value for field 'COLUMN_2' of class 'java.lang.Float' at net.sf.jasperreports.engine.data.JRXlsxDataSource.getFieldValue(JRXlsxDataSource.java:253) at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:1331) at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1232) at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1208) at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1554) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:149) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:909) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:841) at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:655) at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59) at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:203) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724) Caused by: java.lang.IllegalStateException: Cannot get a numeric value from a text cell at org.apache.poi.xssf.usermodel.XSSFCell.typeMismatch(XSSFCell.java:843) at org.apache.poi.xssf.usermodel.XSSFCell.getNumericCellValue(XSSFCell.java:208) at net.sf.jasperreports.engine.data.JRXlsxDataSource.getFieldValue(JRXlsxDataSource.java:231) ... 13 more Print not filled. Try to use an EmptyDataSource... I've been reading about possible causes of the error and didn't find a solution. I guess the problem comes because the connection defined in the first case and the connection I'm passing to the subreport have configured different numeric formats and one of them is reading it as number and the other one as text. Anyway, don't know how to solve it. Could anybody help be? Thanks in advance and best regards.
-
Hi, I was wrong, you have to set the expression in "Initial Value Expression" and not in "Variable expression". By the way, your expression is wrong. As rownum is Integer type, the expression should be set as follows: $F{rownum}== 1 ?$F{sum}:new Double("0") Hope this helps. Regards, Aitor
-
Hi, If you want to compare a field with a parameter, I think both have to be the same type, you can't compare a String field with a Date parameter. In your case, you should put the following in the print when expression: $F{fromdate}.equals($P{startdate}.toString()) ? Boolean.TRUE : Boolean.FALSE But take into account that in this case, if fromdate is different to startdate, nothing will be printed, and I guess you want to print "0". In this case, you should create a variable (Double type), and put the following in the "Variable Expression": $F{fromdate}.equals($P{startdate}.toString()) ? $F{Sum} : new Double("0") Hope this helps, Regards Aitor
-
Hi, I've never used it but I think this is what you need: https://www.jaspersoft.com/analysis Hope this helps. Regards, Aitor
-
I need to do a report like this picture, this is possible?
augarte replied to matudelatower's topic in Products
Hi, It's difficult to know what happens with this explanation. What I see is that you have the same data in the first and second sheet but don't know how have you created the report and how you receive the data from your datasource. Could you give us more information? Regards -
Hi, If you add to the classpath the jar file that contains the class "net.sourceforge.jtds.jdbc.Driver", iReport should recognize it. For adding it, go to "Tools-->Options-->Classpath-->Add JAR"
-
I need to do a report like this picture, this is possible?
augarte replied to matudelatower's topic in Products
Yes, It is possible and quite easy -
Hi, I have a problem in my application. I have a text field with the following value: "<b>Developments</b> in "+$F{prt} + " ("+$F{iniDat}+" to "+$F{finDat}+")" I use "html markup" in order to show "Developments" word in bold and the rest as normal text (no bold) When I preview the pdf file from iReport it works ok and the result is the one I want (in both, jasper and pdf files). The problem comes when I export it from my application (java code that uses JRPdfExporter), because the text that was suposed to be shown with bold font is shown as normal text. I guess it is a exporter property that iReport has inherited and I need to add it to my code, but I can't find out the property I need to add. The iReport/jasperreports version I'm using is the 5.1.0. Any help? Kind regards, Aitor
-
Hi, It seems you don't have java installed in your computer. You have to install it, and then in your ireport installation, inside "etc" folder you can see that you have a "ireport.conf" file, where you can define a "jdkhome" property, which is the directory where you have installed java. Hope this helps. Regards
-
Hi Gaizka, I've tried to set it through iReport but didn't work for me. Im my case, as I export the reports through java, I have a exporter method, to which I have added the both properties mentioned in the previous post: public void ExpToPdf (String Nam, List JasLst) /************************************************************************************************/ { try{ JRPdfExporter PdfExporter = new JRPdfExporter (); PdfExporter.setParameter (JRExporterParameter.JASPER_PRINT_LIST, JasLst); PdfExporter.setParameter (JRExporterParameter.OUTPUT_FILE_NAME, Nam); PdfExporter.setParameter (JRPdfExporterParameter.METADATA_AUTHOR, "Aitor Ugarte"); PdfExporter.setParameter (JRPdfExporterParameter.METADATA_CREATOR,"Ugarte Aitor"); PdfExporter.exportReport (); } catch (Exception e){ e.printStackTrace(); } } This worked for me, don't know if it is a valid solution for you. Hope this helps. Regards, Aitor
- 3 replies
-
- ireport designer
-
(and 1 more)
Tagged with:
-
Hi Robert, I don't understand what you mean exactly with subdatasets... are you using subreports? In your first post you say that each detail contains 1 table of a dataset. Aren't you able to create a variable for each dataset and then use the same condition (with the corresponding variable in each detail band) to hide/show the band? May be attaching your jrxml will be easier to understand your problem and help you. Regards
-
Not sure if it is the best one, but a possible solution could be the following one: You create a Variable, which counts the number of elements you have in your query. For example, imagine that you retrieve the field "Fld" in your query. You can create a variable with the following properties: - Name: NumRow - Calculation: Count - Variable Expression: $F{Fld} This variable will calculate the number of rows you have in your query, if it is 0, it means there is not any row so you can hide the band. In the "Print When Expression" you should set something like: $V{NumRow} != 0 ? Boolean.TRUE : Boolean.FALSE Hope this helps. Regards
-
Hi, You can use "Print When Expression" to hide report bands. You have to get in a parameter of field if your query returns and empty set and set an expression as follows: $F{data} != null ? Boolean.TRUE : Boolean.FALSE In this case, if the field "data" is null the band in which you set the expression will be hided, otherwise it will be shown. Hope this helps, Regards
-
Hi Gaizka, Not sure how it works because I've never used it but it seems that this is what you want: http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/export/JRPdfExporterParameter.html#METADATA_AUTHOR Maybe you can directly set the property and its value in iReport: net.sf.jasperreports.engine.export.JRPdfExporterParameter.METADATA_AUTHOR There is a similar property METADATA_CREATOR. I really don't know which one is the difference between them but maybe you can use any of them to achieve what you want. Hope this help. Regards, Aitor
- 3 replies
-
- ireport designer
-
(and 1 more)
Tagged with:
-
how to print user photo dynamically in jasper report
augarte replied to udumanajmeer's topic in Products
Hi, If I understood well you have all the images stored in "D:NewWorkspace.metadata.pluginsorg.eclipse.wst.server.coretmp0wtpwebappsloginhiresharedphotoprofile" Then, you have the names of the photos in database, so I guess you are retrieving this value as a field. For example: $F{Img} If this is right, you only have to add an image and set the following in you image expression: "D:NewWorkspace.metadata.pluginsorg.eclipse.wst.server.coretmp0wtpwebappsloginhiresharedphotoprofile"+$F{Img} Hope this helps. Regards