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

jstoneburner

Members
  • Posts

    5
  • Joined

  • Last visited

jstoneburner'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. I'm having a problem when it comes to setting the backgroud color of my report when it is exported to Excel. Our organizatin is still using JasperReports version 3.0 for the time being. The report itself is filled correctly and displays the correct information minus any colors I added. I've tried to use both the backcolor property of the report elements for the individual fields as well as adding a colored rectangle. behind the fields. This approach works fine if I export the report to PDF format. I am using the colors #C0C0C0 and #969696 which I found as being Excel "safe." The code I'm using to generate the Excel file itself is as follows: JRXlsExporter exporterXLS = new JRXlsExporter(); exporterXLS.setParameter(JRXlsExporterParameter.JASPER_PRINT, jasperPrint); exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_FILE_NAME, filePath); exporterXLS.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, true); exporterXLS.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS, true); exporterXLS.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, true); exporterXLS.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, false); exporterXLS.exportReport(); As I said, the report is filled correctly, but is just missing the colors. Is there any advice on how to solve this?
  2. I think that what you want to do is not used the Hibernate object as the field in your JRXML. Instead, try using the member variables from your object as the fields. For example, if you have a bean that has properties a, b, and c, you would want your JRXML to contain fields named a, b, and c. That way, I understand it to be working, JasperReports will call the getter method of each field listed in the JRXML on whatever the data source you pass into it is. In your code, instead of putting in Code:<field name="fMast" class="ch.bergauer.rcp.ncset.ds.genbeans.CustMast"/> You should put in a field for each part of the CustMast object that you wish to access. For example: Code:[code]<field name="nr" class="java.lang.Integer" /> Then reference these fields directly in the rest of your JRXML like: Code:[code]<textFieldExpression class="java.lang.Integer">$F{nr}</textFieldExpression>
  3. I have a tabular report that contains a set of standard text fields and a set of optional text fields. The optional fields will only be displayed if the user selects them from a list. If any optional fields are selected, they need to be displayed under the standard fields (by increasing the detail band height and setting the Y attribute to the height of the standard text fields). Currently, the JRXML file contains the layout for only the standard text fields. Any optional fields are added to the JasperDesign object at run time. The problem I'm running into is that the text fields need to have their isStretchWithOverflow attribute set to true to fit in the occasional large text entry. However, when the standard fields do stretch, this causes the Y attribute to no longer be correct for the optional fields. Is there a way in the Java code to push these optional fields down if the standard field becomes stretched so that the optional fields aren't overlapping with the stretched standard fields?
×
×
  • Create New...