Jump to content
We've recently updated our Privacy Statement, available here ×

sercolani

Members
  • Posts

    5
  • Joined

  • Last visited

sercolani's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. So is there no way to display the total number of pages in a report? What I'm trying to do is display on the page footer, something to indicate the current page of the total pages (Page X of Y). When using iReport 3.5.1-nb, there is a Page X of Y tool available which adds two text fields "Page "+$V{PAGE_NUMBER}+" of" and " " + $V{PAGE_NUMBER} - which is wrong because it displays the current page in both positions. I figured this was a bug in iReport 3.5.1 and the second use of the page number variable should be replaced with the page count variable instead since page count usually indicates the number of pages and not the number of records. Is there another way to display the total number of pages in the page footer? Post Edited by sercolani at 05/21/2009 16:52
  2. I seem to have a strainge problem with my page count fields on report that include groupings. When I include a page count ($V{PAGE_COUNT}) in the page footer section of a report, it displays the total number of pages for the report - which is perfect. The problem, is when I place a grouping on the report, the page count now displays the number of groups on the page. For example, if I have a two page report; the first page contains five groups, and the second page contains three; the first page will have a page count of 5 and the second will display a page count of 3. I'm not sure if this makes a difference or not, but I'm generating the report through Java code and am exporting the report to PDF. I'm using the library jasperreports-3.5.0.jar. I attached a sample of the report in PDF format to illustrate the problem. The report contains three group summary lines (the detail lines are hidden) and a totals for the report for all the groups. If anyone has any suggestions, as to how I can correct this, I would really appricate it. Thanks
  3. I'm not sure what the problem is with your code, but I do have JasperReports exporting to Excel in a very similar way. I've attached my code for you to reference. One difference that I saw, was your use of the ByteArrayOutputStream - where I use the FileOutputStream. Please let us know if you get this working. Code:JRXlsExporter excelExporter = new JRXlsExporter();OutputStream ouputStream = new FileOutputStream(new File(destFile));ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();excelExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);excelExporter.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, byteArrayOutputStream);excelExporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE);excelExporter.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE);excelExporter.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE);excelExporter.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);excelExporter.setParameter(JRXlsExporterParameter.CHARACTER_ENCODING, "UTF-8");excelExporter.exportReport();ouputStream.write(byteArrayOutputStream.toByteArray());ouputStream.flush();ouputStream.close();
  4. Thank so much for the information Giulio. The resolution that you provided wasn't quite what I needed because I'm generating the reports though Java code (I probably should have mentioned that). But it did get me thinking and I ended up figuring it out. The report parameter to auto detect the field type must be set through the Java code. I provided the code for reference. Thanks once again. Steve Code:JRXlsExporter excelExporter = new JRXlsExporter();excelExporter.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE);
  5. Hi everyone, I have a question regarding the export of reports to Excel format. When I export a report to Excel, all the fields in the spreadsheet are formatted as a text field including numeric fields. Having all the numeric fields formatted as text causes issues when trying to perform matimatiacal funcitons such as sum. The report field's type is set as double, but it seems when the export occurs, the field is translated as text. Another little piece of information is when I export the same report to CSV format, the fields do not include quotes around the numberic fields If anyone can provide insite into how I can resolve this issue, I would be really greatful. I attahced the spreadsheet to this post just in case it will help clarify the issue. Thanks, Steve
×
×
  • Create New...