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

domurtag

Members
  • Posts

    24
  • Joined

  • Last visited

domurtag'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, If I view the generated HTML for one of my reports in IE7 I see the following: <DIV id="report"><BR /><BR /><A name="JR_PAGE_ANCHOR_0_1"> <TABLE style="WIDTH: 1000px" cellSpacing="0" cellPadding="0" bgColor="#ffffff" border="0"> <-- table body omitted --> </TABLE> The two <BR/> tags are added by myself via the JRHtmlExporterParameter.HTML_HEADER parameter. After these tags and before the beginning of the report table that there's an unclosed anchor tag <A>. The fact that this tag is not correctly closed is messing up the formatting of my report because IE is hyperlinking the entire table. I'm not actually using this anchor tag, so if I could prevent Jasper from generating it, that would solve my problem. Incidentally, this problem only occurs in IE, in Firefox everything works fine because the anchor tag is properly closed. Thanks in advance, domurtag
  2. Hi, When running a report in which the SQL is embedded in the report file itself, is it possible to see the SQL that is executed. Ideally, I'd also like to see the values that are substituted for each of the '?' placeholders. Cheers, domurtag
  3. Hi, The report shown in the attached file contains an e-mail field. I've noticed that if the e-mail address is too long to be displayed and the part of the e-mail before '@' contains a '.' then the e-mail address is truncated immediately after the '.' For example an email address such as 'foo.barbarbarbarbarbar@example.com' will be truncated to 'foo.' even though there is enough room to display much more of the address, although not enough to display the whole address. The XML definition of the text field that contains the address is shown below. Notice that I've defined a right-margin of 20 in order to leave a gap between the e-mail address field and the date field to it's right. How can I prevent this premature truncation of the email addresses without removing the margin completely? Cheers, Don Code:<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement style="reportData" x="240" y="0" width="166" height="17" forecolor="#000000" key="textField"/> <box rightPadding="20"> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement> <font/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{user}]]></textFieldExpression></textField>
  4. Congrats on the new release. Are there instructions about how to switch reports from the DTD to the XSD? Are there any changes (apart from the declaration) that need to be made in order to use the new schema?
  5. For the scheduling, you may find Quartz useful. http://www.opensymphony.com/quartz/
  6. Yes, you can create a report at runtime via the Jasper API. An example dynamic report is available in the Jasper download at: jasperreports-3.0.0-projectjasperreports-3.0.0demosamplesnoxmldesign
  7. I found this post which describes: How to force Excel to store cell contents as numbers rather than strings How to format these cells[/ul] Unfortunately, this approach is still not working for me. Here's an example of a report detail field that I would like to be stored as a currency-formatted number in Excel: Code:<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement style="currency" x="1034" y="0" width="71" height="17" forecolor="#000000" key="textField"/> <box/> <textElement textAlignment="Right"> <font size="12"/> </textElement> <textFieldExpression class="java.math.BigDecimal">$F{sale}</textFieldExpression> </textField>The 'currency' style referenced above is defined thus: Code:[code]<style name="currency" pattern="$ #,##0.00" isDefault="false"/> I've also added the following exporter parameters: Code:[code]JExcelApiExporter exporter = new JExcelApiExporter(); exporter.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, Boolean.True); Map numberFormats = new HashMap(); numberFormats.put("$ #,##0.00", "$#,##0.00;-$#,##0.00"«»); exporter.setParameter(JRXlsExporterParameter.FORMAT_PATTERNS_MAP, numberFormats); However, Excel is still storing these fields as strings, what am I doing wrong? Thanks in advance, domurtag Post edited by: domurtag, at: 2008/07/04 18:53
  8. Hi, When I export my report to Excel, the following warning appears in each cell containing a monetary amount: "The number in this cell is formatted as text or preceded by an apostrophe" In an effort to get Excel to recognise the contents of these cells as currency amounts, I've added the pattern "$ #,##0.00" to the corresponding <reportElement> in the .jrxml file. I've also added the export parameter: net.sf.jasperreports.engine.export.JRXlsExporterParameter.IS_DETECT_CELL_TYPE=true Although the values look like monetary amounts when displayed in Excel, they are obviously stored as strings, which causes those annoying warnings to appear. Does anyone knows how to persuade Excel that these cells contain monetary amounts? Thanks in advance, domurtag Post edited by: domurtag, at: 2008/07/04 12:44
  9. Hi, I have a report that looks like this: Code:Field1 |Field2 -------------------------- Value of fi|Value of field2 Value of fi|Value of field2 Value of fi|Value of field2 Basically the problem is that the value of Field1 is so long that it runs right up to the start of the value of Field2. This is aesthetically unappealing and makes it hard to determine where the value of Field1 ends and Field2 starts. I'd prefer to leave a space between the two fields, even though it would mean further truncating the value of Field1, something like: Code:[code]Field1 |Field2 -------------------------- Value of f |Value of field2 Value of f |Value of field2 Value of f |Value of field2 One way I could achieve this is by adding empty <textField> elements between fields 1 and 2 in both the <columnHeader> and <detail> bands. However, I'm reluctant to do this because it's an ugly hack and doesn't follow the [url=http://www.jasperforge.org/jaspersoft/opensource/business_intelligence/jasperreports/faq.html#FAQ9]grid-friendly report guidelines. Is there a better way? Thanks in advance, domurtag
  10. Thanks you very much Lucianc, I really appreciate your help, and will try out your suggestions.
  11. I've uploaded an example of the report in HTML and PDF formats. As you can see, several features shown in the PDF version are missing from the HTML (and XLS) version. These include: - Column header - Horizontal line between report detail items - Orange background colour shown in group header and summary section Any suggestions about why these are missing from the HTML version would be very welcome. Post edited by: domurtag, at: 2008/06/21 20:57
  12. Hi, The Jasper FAQ provides information about how to layout a report such that it will suitable for exporting to a grid-based format such as Excel or HTML: http://www.jasperforge.org/jaspersoft/opensource/business_intelligence/jasperreports/faq.html#FAQ9 My question is whether iReports provides any features which automate the process of making a report's layout more grid-friendly? Thanks, domurtag
  13. Thanks for the suggestion. I've attached my .jrxml. If anybody can figure out why the columnHeader elements are not being displayed correctly in HTML (or XLS) format, I'd be very grateful. Everything works fine when using an absolutely-positioned format (e.g. PDF), so I suppose there is something about my report which is "grid layout unfriendly". I've checked in iReport and it doesn't appear that anything is overlapping the column header. Thanks in advance, DM [file name=transactions.jrxml size=28788]
  14. By the way, I thought the problem might be caused by the absence (from my classpath) of certain libraries that are required to render the HTML correctly. However, if I export the report to HTML directly from iReport, I have the same problem, so this theory now seems unlikely.
  15. Thanks for the tip Matt. I've adapted your suggestion to make it a bit simpler. Here are the relevant parameters: Code: <parameter name="campaignId" isForPrompting="true" class="java.lang.Integer"/> <parameter name="ignoreCampaignId" isForPrompting="false" class="java.lang.Boolean"> <defaultValueExpression >$P{campaignId} == null ? Boolean.TRUE : Boolean.FALSE</defaultValueExpression> </parameter> And the SQL is: Code:[code]and (ult.campaign_id = $P{campaignId} or $P{ignoreCampaignId}) Post edited by: domurtag, at: 2008/06/19 21:04 Post edited by: domurtag, at: 2008/06/19 21:05
×
×
  • Create New...