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

kent.vickery

Members
  • Posts

    14
  • Joined

  • Last visited

kent.vickery's Achievements

Apprentice

Apprentice (3/14)

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

Recent Badges

0

Reputation

  1. Oh - I see you meant setting that pattern for the actual textField atrribute, as a Custom Format. That does change things, but then I am not getting the amount as a currency on any output (PDF, CSV). I need the dollar sign.
  2. Using the pattern suggested above made no difference. When the CSV opens up the (red for negative) ($1,1234.10) pattern is still what is set for the column.
  3. Note at the top of my jrxml I am setting the property: <property name="net.sf.jasperreports.export.xls.detect.cell.type" value="true"/>
  4. I am using Jasper Reports Library 6.0.0. I am trying to export currency values to a CSV file. In Jasper, I have the BigDecimal textField using pattern "$ #,##0.00", with the following properties added: <property name="net.sf.jasperreports.export.csv.column.name" value="ChangeOverallBalance"/> <property name="net.sf.jasperreports.export.xls.pattern" value="$ #,##0.00"/> But when I export to CSV the cell is formatted as Currency, but using the (red for negative) ($1,1234.10) pattern - what I want is the -$(1,234.10) pattern. I've tried different patterns with net.sf.jasperreports.export.xls.pattern, but nothing seems to make any difference to how the CSV ends up. What am I doing wrong?
  5. Thanks Hozawa. Adding the lastPageFooter band as shown in the thread above did the trick.
  6. <textField> <reportElement uuid="47f37d6a-667f-42f2-9aa7-f6fed5204191" style="Table_PROJECT_TEXT" x="0" y="0" width="116" height="30" forecolor="#000000"> <property name="net.sf.jasperreports.export.csv.column.name" value="First"/> </reportElement> <textElement/> <textFieldExpression><![CDATA[$F{PROJECT_NAME}]]></textFieldExpression> </textField>
  7. String[] csvColumnNames = new String[] { "First", "Second", "Third" } JRCsvMetadataExporter exporter = new JRCsvMetadataExporter(); SimpleCsvMetadataReportConfiguration configuration = new SimpleCsvMetadataReportConfiguration(); exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); exporter.setExporterOutput(new SimpleWriterExporterOutput(outputStream)); configuration.setColumnNames(csvColumnNames); configuration.setWriteHeader(true); exporter.setConfiguration(configuration); exporter.exportReport();
  8. When I export to CSV, if my report has multiple detail rows, everything is good. But if there is just one detail row then the column heading row is missing from the CSV - only the data row is generated. Any thoughts on what is going on here?
  9. Changing the splitType to "Immediate" (or any of the other options) had no effect. When an even number of detail records are being reported in the detail band, a page break gets generated before the summary band. Note the same problem happens when running this 'sub-report' as a stand-alone report, so the JRXML in the main report is not a factor. At the moment the only work-around I can think of is testing the number of details records present before calling the Jasper report and generating a null/blank detail record to ensure an odd number of details are present.
  10. <?xml version="1.0" encoding="UTF-8"?> <?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="mps_market_price_summary.rpt" columnCount="2" printOrder="Horizontal" pageWidth="588" pageHeight="792" whenNoDataType="AllSectionsNoDetail" columnWidth="294" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="491a4542-3fa8-4fcb-a9d7-6ac6c80b9875"> <property name="ireport.jasperserver.reportUnit" value="/JCRS/GAS2/Reports/GAS2/worksheet_details_cmps_portrait.rpt"/> <property name="ireport.jasperserver.url" value="http://10.10.30.128:8080/jasperserver/services/repository"/> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <parameter name="P_APPRAISED_STUMPAGE_RATE_ID" class="java.math.BigDecimal"/> <parameter name="ORACLE_REF_CURSOR" class="java.sql.ResultSet" isForPrompting="false"/> <parameter name="LoggedInUser" class="com.jaspersoft.jasperserver.api.metadata.user.domain.User" isForPrompting="false"/> <parameter name="p_report_id" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA["mps_market_price_summary.rpt"]]></defaultValueExpression> </parameter> <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA[($P{REPORT_CONTEXT} != null) ? "repo:" : "H:\"]]></defaultValueExpression> </parameter> <parameter name="SUBREPORT_EXT" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA[($P{REPORT_CONTEXT} != null) ? ".jrxml" : ".jasper"]]></defaultValueExpression> </parameter> <queryString language="plsql"> <![CDATA[{call GAS2_REPORTING.FIND_MPS_MARKET_PRC_SUBTOTALS( P_RESULTS => $P{ORACLE_REF_CURSOR}, P_APPRAISED_STUMPAGE_RATE_ID => $P{P_APPRAISED_STUMPAGE_RATE_ID} )}]]> </queryString> <field name="SUBTOTAL_DESC" class="java.lang.String"/> <field name="STUMPAGE_RTE_SUBTOTAL_TYP_CODE" class="java.lang.String"/> <field name="SUBTOTAL_VALUE" class="java.math.BigDecimal"/> <field name="APPRAISAL_METHOD_CODE" class="java.lang.String"/> <field name="MARKET_PRICE" class="java.math.BigDecimal"/> <field name="BASE_MARKET_PRICE" class="java.math.BigDecimal"/> <field name="CPIF_ADJUSTMENT" class="java.math.BigDecimal"/> <field name="TOTAL_SPEC_OPS" class="java.math.BigDecimal"/> <field name="FINAL_MARKET_PRICE" class="java.math.BigDecimal"/> <variable name="CCF0_Market Price" class="java.lang.String" resetType="None"> <variableExpression><![CDATA[$F{APPRAISAL_METHOD_CODE}.equals("C") ? "Estimated Winning Bid" : "Market Price (present)"]]></variableExpression> </variable> <variable name="CCF1_Final Market Price" class="java.lang.String" resetType="None"> <variableExpression><![CDATA[$F{APPRAISAL_METHOD_CODE}.equals("C") ? "Final Estimated Winning Bid" : "Final Market Price"]]></variableExpression> </variable> <variable name="CCF2_Section Name" class="java.lang.String" resetType="None"> <variableExpression><![CDATA[$F{APPRAISAL_METHOD_CODE}.equals("C") ? "Final Estimated Winning Bid Summary" : "Market Price Summary"]]></variableExpression> </variable> <title> <band height="42"> <textField> <reportElement uuid="e4c1732a-d6eb-47f9-bd55-79146965bc3d" mode="Opaque" x="0" y="2" width="586" height="14" forecolor="#000000" backcolor="#C0C0C0"/> <textElement textAlignment="Left"> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <paragraph lineSpacing="Single"/> </textElement> <textFieldExpression><![CDATA[" " + $V{CCF2_Section Name}]]></textFieldExpression> </textField> <staticText> <reportElement uuid="b2b1bb64-e634-4fbe-a442-57d2a7339c95" x="18" y="24" width="95" height="12" forecolor="#000000"/> <textElement textAlignment="Left"> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="true" isStrikeThrough="false"/> <paragraph lineSpacing="Single"/> </textElement> <text><![CDATA[Variable]]></text> </staticText> <staticText> <reportElement uuid="e68a8b7b-e9f0-4181-97d4-7f50b649134f" x="210" y="23" width="67" height="12" forecolor="#000000"/> <textElement textAlignment="Right"> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="true" isStrikeThrough="false"/> <paragraph lineSpacing="Single"/> </textElement> <text><![CDATA[Contribution]]></text> </staticText> <staticText> <reportElement uuid="d2786c34-95e5-4341-adc8-45d1712492c8" x="304" y="23" width="95" height="12" forecolor="#000000"/> <textElement textAlignment="Left"> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="true" isStrikeThrough="false"/> <paragraph lineSpacing="Single"/> </textElement> <text><![CDATA[Variable]]></text> </staticText> <staticText> <reportElement uuid="f6e9df90-1e49-426f-a8d4-5c22f8ef8cb5" x="504" y="23" width="67" height="12" forecolor="#000000"/> <textElement textAlignment="Left"> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="true" isStrikeThrough="false"/> <paragraph lineSpacing="Single"/> </textElement> <text><![CDATA[Contribution]]></text> </staticText> </band> </title> <detail> <band height="14" splitType="Prevent"> <textField pattern="0.00" isBlankWhenNull="true"> <reportElement uuid="c6150097-9767-4496-85fe-f8b7d85354de" x="200" y="1" width="68" height="12" forecolor="#000000"/> <textElement textAlignment="Right"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <paragraph lineSpacing="Single"/> </textElement> <textFieldExpression><![CDATA[$F{SUBTOTAL_VALUE}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement uuid="47f37d6a-667f-42f2-9aa7-f6fed5204191" x="18" y="2" width="178" height="12" forecolor="#000000"/> <textElement> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <paragraph lineSpacing="Single"/> </textElement> <textFieldExpression><![CDATA[$F{SUBTOTAL_DESC}]]></textFieldExpression> </textField> </band> </detail> <summary> <band height="100" splitType="Prevent"> <line> <reportElement uuid="00b33963-f754-4839-8154-eac1b2c5719a" x="509" y="9" width="62" height="1"/> <graphicElement> <pen lineWidth="1.0" lineStyle="Solid"/> </graphicElement> </line> <line> <reportElement uuid="fbb76443-ba72-49d9-8047-5b59e41884d7" x="509" y="44" width="62" height="1"/> <graphicElement> <pen lineWidth="1.0" lineStyle="Solid"/> </graphicElement> </line> <line> <reportElement uuid="ad074180-1359-4959-b1c4-54a3e6eb59a8" x="509" y="78" width="62" height="1"/> <graphicElement> <pen lineWidth="1.0" lineStyle="Solid"/> </graphicElement> </line> <staticText> <reportElement uuid="caab7c22-d5f5-454c-91b0-5eb718ba8fe6" x="304" y="58" width="113" height="12" forecolor="#000000"/> <textElement textAlignment="Left"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <text><![CDATA[specified Operations]]></text> </staticText> <staticText> <reportElement uuid="df30b72d-3d30-4418-821b-0979645c3faa" x="304" y="23" width="95" height="12" forecolor="#000000"/> <textElement textAlignment="Left"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <text><![CDATA[CPIF Adjustment]]></text> </staticText> <staticText> <reportElement uuid="cdd61693-a432-42d1-8bdc-b6534a16fa5d" x="304" y="11" width="95" height="12" forecolor="#000000"/> <textElement textAlignment="Left"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <text><![CDATA[Market Price (base)]]></text> </staticText> <textField pattern="0.00" isBlankWhenNull="true"> <reportElement uuid="e7194307-b1c5-47e1-b576-4ba552310953" x="519" y="46" width="52" height="12" forecolor="#000000"/> <textElement textAlignment="Right"> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <textFieldExpression><![CDATA[$F{MARKET_PRICE}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement uuid="f67ba592-c883-4d69-8d47-386b8829299f" x="304" y="80" width="181" height="12" forecolor="#000000"/> <textElement> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <textFieldExpression><![CDATA[$V{CCF1_Final Market Price}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement uuid="1715fafa-5b6c-4350-8f88-a106c07efbee" x="304" y="46" width="128" height="12" forecolor="#000000"/> <textElement> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <textFieldExpression><![CDATA[$V{CCF0_Market Price}]]></textFieldExpression> </textField> <textField pattern="0.00" isBlankWhenNull="true"> <reportElement uuid="953c81df-dc1e-49bb-b68c-c43ae1196f18" x="523" y="11" width="48" height="12" forecolor="#000000"/> <textElement textAlignment="Right"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <textFieldExpression><![CDATA[$F{BASE_MARKET_PRICE}]]></textFieldExpression> </textField> <textField pattern="0.00" isBlankWhenNull="true"> <reportElement uuid="46c28b51-4373-42af-808c-5f8d5aa1d120" x="523" y="23" width="48" height="12" forecolor="#000000"/> <textElement textAlignment="Right"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <textFieldExpression><![CDATA[$F{CPIF_ADJUSTMENT}]]></textFieldExpression> </textField> <textField pattern="0.00" isBlankWhenNull="true"> <reportElement uuid="2f2a9019-635a-422a-87f8-d8d738e84e73" x="523" y="58" width="48" height="12" forecolor="#000000"/> <textElement textAlignment="Right"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <textFieldExpression><![CDATA[$F{TOTAL_SPEC_OPS}]]></textFieldExpression> </textField> <textField pattern="0.00" isBlankWhenNull="true"> <reportElement uuid="ead5d8c2-7cd5-4204-ac04-0e83ae10b279" x="519" y="80" width="52" height="12" forecolor="#000000"/> <textElement textAlignment="Right"> <font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> </textElement> <textFieldExpression><![CDATA[$F{FINAL_MARKET_PRICE}]]></textFieldExpression> </textField> </band> </summary> </jasperReport>
  11. Sorry - I should have said either 7 or 8 detail records in my example above.
  12. Thanks for the feedback, but I should have said I had tried all of the obvious solutions. With further testing I found the unwanted page break before the Summary Band only happens if there is an even number of detail records being reported in the detail band. So, if there are either 9 or 10 detail records there are 4 rows written in the detail band (because it is a two column sub-report) - but the page break only shows up when both columns of there detail band are filled in (no matter how many rows are written).
  13. I have a two-column subreport that has a header band, detail band, and summary band. For some reason Jasper generates a page break before the summary band even though there is lots of space left on the report for the next subreport. If I swtich to one-column OR disable printing of the summary band, then the unwanted page break goes away. I've made sure all of the content fits within the page. Help!
×
×
  • Create New...