spmkkmps
-
Posts
38 -
Joined
-
Last visited
Content Type
Forum
Downloads
Featured Visualizations
Knowledge Base
Documentation (PDF Downloads)
Blog
Documentation (Test Area)
Documentation
Dr. Jaspersoft Webinar Series
Security Advisories
Events
Profiles
Posts posted by spmkkmps
-
-
Hi
In my application there is a field "Period" of type BigDecimal. i need to check for a condition like,
($F{Period} != 0)?value1:value2
but it says, Incompatible operand types BigDecimal and int
and another condition like,
($F{Period} < 0)?value1:value2
but it gives me the following error,
the operator < is undefined for the argument type(s) BigDecimal, int
Can you please tell me what needs to be changed in my syntax. Please post your answers soon. Its very urgent. Thanks a lot.
Madhan!!!!
-
no just i have added the previous given code in the printWhenExpression of the detail band. where i need to set it to print after 50 records in a page. can you please provide me the steps.
-
when i put this in the detail band, it displays only the 50th record alone and not 50 records per page.
-
Srikanth, Thanks for your reply. Can you explain me more clear on this. In detail band i need to display 4 fields and where i need to place the code and what is that REPORT_COUNT. can you please get the complete code, what and all has to be done.
-
no ramesh, it is not working. it gives me the following error,
net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :
Source text : new DecimalFormat("###0.00;-###0.00").format($F{Period})
at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:197)
at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:537)
at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:505)
at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:826)
at net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:368)
at net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:353)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:275)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:426)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1380)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:692)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:255)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:113)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:879)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:123)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:420)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:383)
at com.jeevan.ProfitLossBusiness.runReport(ProfitLossBusiness.java:259)
at com.jeevan.RunReport.doGet(RunReport.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Cannot format given Object as a Number
at java.text.DecimalFormat.format(Unknown Source)
at java.text.Format.format(Unknown Source)
at IncomeReportNew45july08_1247046899293_679318.evaluate(IncomeReportNew45july08_1247046899293_679318:271)
at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:186)
... 31 more
any idea from your side.
-
Hi Ramesh
Thanks for your Reply. And one more thing where do i need to place the code in iReport.
-
Hi,
I need to apply pattern for textfield of type String. Please post your answers as soon as possible. It is of high priority and I need to do it in a short period of time.
Thanks
S. PradeepMadhanKumar
-
Hi All,
Am using jasper report for my application wherein i need to export it to browser containing 50 records per page out of 'n' number of records. Please post your replies immediately if you faced similar problem with the code what i need to do exactly. Thanks in advance.
Madhan!!!!
-
hi
in my application i have kept the .jasper file in a separate folder and the java file in a separate folder. in java file i have read the jasper file as given,
/reports/filename.jasper.
i get the following error when i try to execute it. please get me the solution if anybody faced similar issue in your experience. thanks.
please see the runReport(...) method in attached java file and guide me what has to be changed.
net.sf.jasperreports.engine.JRException: java.io.FileNotFoundException: \reports\ReportPDFFormat.jasper
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:75)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:254)
at net.sf.jasperreports.engine.JasperRunManager.runReportToPdf(JasperRunManager.java:225)
at com.jeevan.ProfitLossBusiness.runReportToPDFFormat(ProfitLossBusiness.java:182)
at com.jeevan.ProfitLossBusiness.runReport(ProfitLossBusiness.java:156)
at com.jeevan.ReportPDFFormat.doGet(ReportPDFFormat.java:74)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: \reports\ReportPDFFormat.jasper -
hi,
when i try to execute runReport ToPdfFormat, it gives me the following error,
WARNING: The supplied java.sql.Connection object is null.
Please post your replies asap if you find solution to this issue. got stuck up for more than a week and i need to do it immediately.
i will attach the java code and jrxml. get me what has to be changed or anything has to be added.
Thanks in advance.
madhan
-
hi,
i have kept the two jar files in the build path. after removing poi-2.5.1.jar it works fine for me. thanks.
-
hi
When i try to export it to excel using JRXlsExporter it gives the following error,
java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFSheet.setColumnHidden(SZ)V net.sf.jasperreports.engine.export.JRXlsExporter.removeColumn(JRXlsExporter.java:214) net.sf.jasperreports.engine.export.JRXlsAbstractExporter.removeEmptyColumns(JRXlsAbstractExporter.java:636) net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream(JRXlsAbstractExporter.java:439) net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReport(JRXlsAbstractExporter.java:197) com.jeevan.ReportExcelFormat.doGet(ReportExcelFormat.java:89) javax.servlet.http.HttpServlet.service(HttpServlet.java:617)can anybody tell me if anything needs to be changed or do i need to add any jar files.and i have added poi-2.5.1.jar and poi-3.0.1-FINAL-20070705.jar in the appln but even it doesnot work.please do reply asap. its very urgent. Thanks in advance.madhan
Code: public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ServletOutputStream outputStream = response.getOutputStream(); InputStream reportStream = getServletConfig().getServletContext().getResourceAsStream("ReportPDFFormat.jasper"); CsvDataSource csvDataSource = new CsvDataSource(new InputStreamReader(getServletConfig().getServletContext().getResourceAsStream("ReportPDFFormat.csv"))); try{ //ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); JasperPrint jasperPrint = null; File f = new File("C:/reportexcel.xls"); jasperPrint = JasperFillManager.fillReport(reportStream, new HashMap(), csvDataSource); OutputStream out = new FileOutputStream(f); JRXlsExporter exporterXLS = new JRXlsExporter(); exporterXLS.setParameter(JRXlsExporterParameter.JASPER_PRINT, jasperPrint); exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, outputStream); exporterXLS.setParameter(JRXlsExporterParameter.OFFSET_X,0); exporterXLS.setParameter(JRXlsExporterParameter.OFFSET_Y,0); exporterXLS.setParameter(JRXlsExporterParameter.START_PAGE_INDEX,0); exporterXLS.setParameter(JRXlsExporterParameter.IS_IGNORE_GRAPHICS,true); exporterXLS.setParameter(JRXlsExporterParameter.MAXIMUM_ROWS_PER_SHEET,65000); exporterXLS.setParameter(JRXlsExporterParameter.IS_FONT_SIZE_FIX_ENABLED,false); exporterXLS.setParameter(JRXlsExporterParameter.IS_IGNORE_CELL_BORDER,false); exporterXLS.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET,false); exporterXLS.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE,false); exporterXLS.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, false); exporterXLS.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,true); exporterXLS.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS,true); exporterXLS.exportReport(); System.out.println("fsdfsd"); response.setContentType("application/vnd.ms-excel"); outputStream.flush(); outputStream.close(); System.out.println("fsdfsd1234"); //out.write(outputStream.toByteArray()); // byte[] buf2 = new byte[(int)f.length()]; //httpSession.setAttribute("fileupload_bytes",buf2); //httpSession.setAttribute("fileupload_type", "application/vnd.ms-excel"); //httpSession.setAttribute("fileupload_name", realpath+"/SpecImages/download/"+report.substring(lastslashindex+1, lastdot)+"_"+empId+".xls"); } catch (JRException e){ e.printStackTrace(); } }
Need to apply pattern for String Field
in Products
Posted
Hi
In my application i have a String field which is to be displayed in the report. I need to apply the following pattern to that field,
#,##0.00;-#,##0.00
I tried applying pattern for the field by creating pattern from the properties window of the field. But it doesn't work.
Can you please tell me is there any other way to apply pattern for the string field. If so, please provide me the solution with all the steps to be followed. Post your answers soon. Its very urgent. Thanks a lot.
Madhan