Jump to content
Changes to the Jaspersoft community edition download ×

arbitary

Members
  • Posts

    23
  • Joined

  • Last visited

arbitary's Achievements

Explorer

Explorer (4/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. Hi, I need to craete a report in CSV format(which I ahve already done), but when the user downloads it, it should be zipped and should contain the csv file. How do I do this? I understand that the exportReport() function at the end of the method will create the file, so when excatly will I zip it. I also have a method taht will zip any file, but am not sure where it fits in. Code: JRCsvExporter exporter = new JRCsvExporter(); res.setContentType("text/plain"); ((HttpServletResponse) res).setHeader( "Content-Disposition", "inline; filename="" + ipTxtFileName+".csv" + "";" ); OutputStream out = res.getOutputStream(); exporter.setParameter(JRCsvExporterParameter.FIELD_DELIMITER, "|"); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, out); exporter.exportReport(); Method call to zipping - where should this go? this.doZip(ipTxtFileName+".csv", ipTxtFileName+".zip");
  2. Try increasing the height/width of the column. Sometimes in XLS/CSV reports, the data is not shown because it does not fit.
  3. The line that I have suggested will be of fixed width. Sorry, can't really think of a way to have a flexible dotted line. Will let you know if I come across something for this.
  4. From the top of my head: Draw a 'line' (is available on the top menu in iReports). In its Properties --> Graphics Element, set Pen to 'Dotted'. You have a dotted line now. Simply drag it and place it below your static text.
  5. I don't know if this will solve your problem but try and set Floating Column Footer as checked in Report Properties. You can also modify the xml file directly and add this line isFloatColumnFooter="true" in the <jasperReport> tag at the top.
  6. Look here: http://www.javalobby.org/articles/hibernatequery103/ You really should check on Google before posting questions.
  7. I am running JasperReports on JBoss. I need to hyperlink one of the report columns to an external file. The file is on a Unix machine, outside of my server/application setup. I am trying create a 'Reference' hyperlink with this expression: $P{Path}+$P{FileName}+".html" where $P{Path} = home/reports/ $P{FileName} = reportFile This resolves to: http://www.mywebsite.com/home/reports/reportFile.html but the file is not found. What am I doing wrong? Thanks.
  8. I came across this while trying to export a report as xls. One of the cells have values 1A, 1B, 1C, 1D, 1E or 1F. The column that I am printing this in, is designated as String. When the report renders, all values are shown correctly, except for 1D and 1F, which are shown only as 1. After putting debug statements in the JRXlsExporter file, I found that the flow is as follows: 1) method createTextCell --> isDetectCellType is false 2) Control goes to else part: isAutoDetectCellType which is true. Here it first parses the value as Double. 1D and 1F are accepted as double and float values and shown as 1. Others are shown as 1A, 1B, 1C. I understand that the best way is to have the control go into (1), where the cell type is detected as String/text. My question is - how is isDetectCellType set to true? If my column datatype in the layout is set to String, shouldn't this be String too??
  9. If you don't check 'isStretchWithOverflow' the value will automatically get truncated without altering the width or height. If you need to dynamically increase the width to fit the cell contents, then that is not possible.
  10. The file will get saved on the server. However, what you can do is, delete the file from the server after it opens, like I am doing. The person viewing the open file always has a choice to save it locally.
  11. After your report has been generated and saved to the machine, you need to open it for viewing. Code: res.setContentType("application/pdf"«»); BufferedInputStream in; try { in = new BufferedInputStream(new FileInputStream(opReport)); OutputStream out = res.getOutputStream(); int bt = -1; while((bt = in.read()) != -1) out.write(bt); out.flush(); out.close(); in.close(); File opReportFile = new File(opReport); opReportFile.delete(); } In the above code, opReport is the string name of the file(alongwith the path). Once the report is viewed, the PDF viewer will allow the user to save it. I delete the report once it is viewed(since the user has a copy), but you can choose to retain it.
  12. I am not sure if this could be your problem, but I had the same issue while viewing reports in iReport virtualizer on Windows .vs. via an application on Unix. Sometimes when the data is too 'tall' it simply does not show up. I increased the height of the cells that were showing up as blank and it worked fine. Try it out..might help.
  13. My report data source is a csv file, which usually has over 1 million records. Since I do not want to show that many, I have to limit the report to about 10 pages. To do this, I put a condition in 'PrintWhenExpression' for all bands - new Boolean(($V{PAGE_NUMBER}).intValue()<11) So, I want the bands to print as long as page number is less than 11. The problem is, the report shows 11 pages and the last one is blank. Can anyone please figure out what is happening? My summary band has size 0, so that is not the problem. Thanks in advance.
  14. The property that I modify is different. You select the column that should stretch, then right-click. This brings up the 'Properties' option. Click on it. There are multiple tabs at the top - go to the 'TextField' tab and check 'Stretch with overflow'. I have just 1 field in my report that has enough data to wrap and the result is pretty decent looking. It increases the row height just enough to accomodate the data.
  15. I don't think there is an option to dynamically alter the width. Infact, if your text is too long for the width, it gets truncated. What I do is set the 'Stretch with overflow' preprty to true. That way, if it is a long text, it wraps.
×
×
  • Create New...