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

coopni

Members
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

coopni'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. Thank you for your reply :-) and thanks for the article too, as some interesting stuff to know in it. I just want to share, just in case anyone else has the same problem, that the best solution to this is to mark the left and right margin lengths 0 leftMargin="0" rightMargin="0" on the jasperReport tag. I found using IS_ONE_PAGE_SHEET makes the excel report come out in 30 row max sheets, which wasn't really want I wanted. You can get around this by making the pageHeight attribute a higher number, but the real solution is to make the left and right margins zero, as above and not set IS_ONE_PAGE_SHEET to true. I assume that like me many people us iReport to make the reports and its not obvious unless you go to xml format to see what the margins are set to.
  2. Problem fixed. IGNORE_PAGE_MARGINS does nothing, maybe a bug? Added IS_ONE_PAGE_SHEET to true and this solved my problem. Thanks for all the replies! Code: Post Edited by coopni at 03/05/2010 17:22
  3. Can some one PLEASE tell me if there excel export reports are starting on column A at all? I really need to know if this is just how Jasper does things! If your reports exported to excel also start in column B please say! I really need to know if this is the functionality of Jasper Reports, because if so it does not meet requirements. I hope some one can please comment, even if it is just to say there export reports to Excel also start on column B. I have attached an example to what I am getting. Many thanks.
  4. Can any one please tell me if there excel exports start on column A please? I need to know if this is possible asap and if I'm doing something not quite right. If I can not get the excel report to start the data on column A (for some reason it always starts on column b) I will have to re-write these reports in POI.
  5. Hi, I have successfully got my reports working and being exported to xls format, but the resulting spreadsheet starts the report on column B and not Column A. I have set the following parameters, but nothing seems to help. Can someone please tell me how to start the excel report on column A and not B? Many thanks. Code:ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();JRXlsExporter exporterXls = new JRXlsExporter ();exporterXls.setParameter(JRXlsExporterParameter.JASPER_PRINT, print);exporterXls.setParameter(JRXlsExporterParameter.IGNORE_PAGE_MARGINS, false);exporterXls.setParameter(JRXlsExporterParameter.IS_COLLAPSE_ROW_SPAN, true);exporterXls.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, false);exporterXls.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS, true);exporterXls.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, true);exporterXls.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, true);exporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, System.currentTimeMillis() + reportName + ".xls");exporterXls.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, byteArrayOutputStream);exporterXls.exportReport(); response.setContentType("application/vnd.ms-excel");response.setHeader("Content-Disposition", "attachment;filename=" + System.currentTimeMillis() + ".xls");ServletOutputStream servletOutputStream = response.getOutputStream();servletOutputStream.write(byteArrayOutputStream.toByteArray());servletOutputStream.flush();servletOutputStream.close();
  6. Seemed to have fixed the problem. I re-developed the report again within iReport and this time with no problems. I guess this could be a problem with iReport. I'm using version 3.6 Problem solved anyway, just scrapped the old report and re-built it and it worked second time. Thanks.
  7. Hi, My report export to xls format reports. Here is my simple code: Connection conn = getConnection(); JasperPrint print = JasperFillManager.fillReport("reports/SwapFeeExport.jasper", new HashMap(), conn); JRXlsExporter exporterXls = new JRXlsExporter (); exporterXls.setParameter(JRExporterParameter.JASPER_PRINT, print); exporterXls.setParameter(JRExporterParameter.IGNORE_PAGE_MARGINS, true); // sets the export to have the grid lines, else default is white page. exporterXls.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, false); //Removes any unwanted columns. exporterXls.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS, true); exporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,"C:/demo2.xls"); exporterXls.exportReport(); The report xml starts with this: <?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" name="report name" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <property name="net.sf.jasperreports.print.keep.full.text" value="true"/> <queryString> As you can see I have set the keep.full.text to true. The report runs using the above code, but when I try to open the demo2.xls file Excel complains with a info box saying, 'Excel found unreadable content in 'demo2.xls'. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes.' When I click yes Excel then opens the report and informs me with another prompt saying, 'Excel was able to open the file by repairing or removing the unreadable content. Excel recovered your formulas and cell values, but some data may have been lost. Looking at the report at the bottom I notice data missing. Removing <property name="net.sf.jasperreports.print.keep.full.text" value="true"/> from my report solves the problem and I do not have a corrupt or any of the above issues when opening the file, except obviously my report now does not have the print.keep.full.text functionality. The version of Excel is Excel 2007 and the jar is jasperreports-3.5.3.jar Any ideas on this??? Files attached. Thanks, Nick
  8. I'm getting the same problem. It happens when I preview the report and it fails to preview and then corrupts the report. It corrupted my report by putting in null values for textAlignment values.
×
×
  • Create New...