JasperReports: Export a xls/ods file with formulas - excel-formula

Recently, I had to export some reports using JasperReports under ods /xls format.
The export works fine but I didn't manage to find a way to add some excel formulas between the exported columns (let's simplify it by saying a sum of some columns as described below).
When user modifies the column A in the excel file, column C gets modified (basic excel formulas, nothing new...)
Based on some comments and answers here is what I've done
<detail>
<band height="134" splitType="Stretch">
<componentElement>
<reportElement x="-20" y="0" width="120" height="60" uuid="884b6c49-9006-464d-982e-e2a5f2cb3e3e">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
</reportElement>
<jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
<datasetRun subDataset="Empty Dataset1" uuid="b60c3bee-0624-4a6a-bbb1-e706521c0a9a">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource(java.util.Arrays.asList($F{dto}.getNbLgtA()))]]></dataSourceExpression>
</datasetRun>
<jr:column width="40" uuid="1dbb56d0-f25f-410b-9e02-d08b7fe84388">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Colonne1"/>
<jr:tableHeader height="30">
<staticText>
<reportElement x="0" y="0" width="40" height="30" uuid="ff8f394e-39ea-4d08-898f-601e92e6d1f3"/>
<text><![CDATA[A]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="30">
<staticText>
<reportElement x="0" y="0" width="40" height="30" uuid="c0c2b023-2d00-4080-88a3-a73f19fe9cda"/>
<text><![CDATA[1]]></text>
</staticText>
</jr:detailCell>
</jr:column>
<jr:column width="40" uuid="33f41b08-3d77-4076-9712-9514211dd3af">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Colonne2"/>
<jr:tableHeader height="30">
<staticText>
<reportElement x="0" y="0" width="40" height="30" uuid="ad2b74aa-95bf-43d7-83a4-6528f344b410"/>
<text><![CDATA[B]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="30">
<staticText>
<reportElement x="0" y="0" width="40" height="30" uuid="6d121f9e-e92d-45ba-9a48-82bf8b1245e0"/>
<text><![CDATA[2]]></text>
</staticText>
</jr:detailCell>
</jr:column>
<jr:column width="40" uuid="42d367d1-2be7-46bf-838b-ba4c1c6f3399">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Colonne3"/>
<jr:tableHeader height="30">
<staticText>
<reportElement x="0" y="0" width="40" height="30" uuid="63e3dd54-0297-463f-b061-4c536baf62a8"/>
<text><![CDATA[C]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="30">
<property name="net.sf.jasperreports.export.xls.formula" value="SUM(A2, B2)"/>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
But it doesn't work.

Here you could find some useful information about using Excel formulas:
http://jasperreports.sourceforge.net/sample.reference/xlsformula/index.html#xlsformula
For instance, below is an example of using SUM formula (the expression should be enclosed within quotes):
<propertyExpression name="net.sf.jasperreports.export.xls.formula">
<![CDATA["SUM(A1,B1)"]]>
</propertyExpression>
You need to ensure that isDetectCellType property is set to true for your report in order to make a formula to work.
A complete working example (using an empty datasource) is the following:
<detail>
<band height="134" splitType="Stretch">
<componentElement>
<reportElement x="-20" y="0" width="120" height="60" uuid="884b6c49-9006-464d-982e-e2a5f2cb3e3e">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
</reportElement>
<jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
<datasetRun subDataset="Empty Dataset1" uuid="b60c3bee-0624-4a6a-bbb1-e706521c0a9a">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource()]]></dataSourceExpression>
</datasetRun>
<jr:column width="40" uuid="1dbb56d0-f25f-410b-9e02-d08b7fe84388">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Colonne1"/>
<jr:tableHeader height="30">
<staticText>
<reportElement x="0" y="0" width="40" height="30" uuid="ff8f394e-39ea-4d08-898f-601e92e6d1f3"/>
<text><![CDATA[A]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="30">
<textField pattern="">
<reportElement x="0" y="0" width="40" height="30" uuid="b989d9e8-64d8-467f-a8a0-7b92a1746a0d"/>
<textFieldExpression><![CDATA[1]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="40" uuid="33f41b08-3d77-4076-9712-9514211dd3af">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Colonne2"/>
<jr:tableHeader height="30">
<staticText>
<reportElement x="0" y="0" width="40" height="30" uuid="ad2b74aa-95bf-43d7-83a4-6528f344b410"/>
<text><![CDATA[B]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="30">
<textField pattern="">
<reportElement x="0" y="0" width="40" height="30" uuid="3448c5dc-f887-415d-9833-4a22ea5b06c8"/>
<textFieldExpression><![CDATA[2]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="40" uuid="42d367d1-2be7-46bf-838b-ba4c1c6f3399">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Colonne3"/>
<jr:tableHeader height="30">
<staticText>
<reportElement x="0" y="0" width="40" height="30" uuid="63e3dd54-0297-463f-b061-4c536baf62a8"/>
<text><![CDATA[C]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="30">
<textField pattern="">
<reportElement x="0" y="0" width="40" height="30" uuid="63e3ed54-0567-463f-b0c1-4c676baf62a8">
<propertyExpression name="net.sf.jasperreports.export.xls.formula"><![CDATA["SUM(A" +($V{PAGE_COUNT}+2) + ",B" + ($V{PAGE_COUNT}+2) +")"]]></propertyExpression>
</reportElement>
<textFieldExpression><![CDATA[3]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>

Related

Text offset by 1 or 2 from its x in SVG

I have text in my SVGs that is offset by 1 or sometimes 2 from its assigned x. The text is set at x="6" however, the text is at 7 or even 8.
Here is an SVG with all the letters of the alphabet and numerals 0 through 9 to show the offset. I just can not figure out why there is an offset. It gets worse when the text is in italics for some characters. Should I just subtract 1 from x to get the text where I want it? Is this normal behavior for the arial font in SVG?
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
viewBox="0 0 111 1088"
width="111"
height="1088"
id="Alphabet_boxes"
>
<title id="Alphabet_boxes_title">Alphabet boxes</title>
<metadata id="Alphabet_boxes_metadata">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>Alphabet boxes</dc:title>
<dc:date>2020-05-19</dc:date>
<dc:creator>
<cc:Agent>
<dc:title>Lady Aleena</dc:title>
</cc:Agent>
</dc:creator>
<dc:language>en-US</dc:language>
</cc:Work>
</rdf:RDF>
</metadata>
<style id="Crossover_styles">
path { fill:none; stroke: #666666; stroke-width: 2; stroke-opacity: 1; stroke-linejoin: round; stroke-linecap: round; }
rect { paint-order: stroke; stroke: #666666; stroke-width: 4; stroke-opacity: 1; stroke-linejoin: round; fill-opacity: 1; fill: #ffffff; }
rect.inner { stroke: none; fill: #ccc; }
text { fill: #000000; font-family: arial, roboto, sans-serif; font-size: 16px; text-anchor: start; dominant-baseline: middle; }
g.normal_text { font-style: normal; }
g.italic_text { font-style: italic; }
g.bold_text { font-weight: bold; }
tspan { font-size: 90%; font-style: normal; }
</style>
<g id="Alphabet_boxes_chart" class="graph" transform="translate(5,5)">
<title id="Alphabet_boxes_chart_title">Alphabet boxes</title>
<g id="normal" class="normal_text">
<g id="normal_A" transform="translate(0,0)">
<title id="normal_A_title">A</title>
<rect id="normal_A_box_1" x="0" y="0" width="24" height="28" />
<rect id="normal_A_box_2" x="4" y="4" width="16" height="20" class="inner" />
<text id="normal_A_text" x="6" y="14">A</text>
</g>
<g id="normal_B" transform="translate(0,30)">
<title id="normal_B_title">B</title>
<rect id="normal_B_box_1" x="0" y="0" width="21" height="28" />
<rect id="normal_B_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="normal_B_text" x="6" y="14">B</text>
</g>
<g id="normal_C" transform="translate(0,60)">
<title id="normal_C_title">C</title>
<rect id="normal_C_box_1" x="0" y="0" width="23" height="28" />
<rect id="normal_C_box_2" x="4" y="4" width="15" height="20" class="inner" />
<text id="normal_C_text" x="6" y="14">C</text>
</g>
<g id="normal_D" transform="translate(0,90)">
<title id="normal_D_title">D</title>
<rect id="normal_D_box_1" x="0" y="0" width="22" height="28" />
<rect id="normal_D_box_2" x="4" y="4" width="14" height="20" class="inner" />
<text id="normal_D_text" x="6" y="14">D</text>
</g>
<g id="normal_E" transform="translate(0,120)">
<title id="normal_E_title">E</title>
<rect id="normal_E_box_1" x="0" y="0" width="21" height="28" />
<rect id="normal_E_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="normal_E_text" x="6" y="14">E</text>
</g>
<g id="normal_F" transform="translate(0,150)">
<title id="normal_F_title">F</title>
<rect id="normal_F_box_1" x="0" y="0" width="21" height="28" />
<rect id="normal_F_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="normal_F_text" x="6" y="14">F</text>
</g>
<g id="normal_G" transform="translate(0,180)">
<title id="normal_G_title">G</title>
<rect id="normal_G_box_1" x="0" y="0" width="24" height="28" />
<rect id="normal_G_box_2" x="4" y="4" width="16" height="20" class="inner" />
<text id="normal_G_text" x="6" y="14">G</text>
</g>
<g id="normal_H" transform="translate(0,210)">
<title id="normal_H_title">H</title>
<rect id="normal_H_box_1" x="0" y="0" width="22" height="28" />
<rect id="normal_H_box_2" x="4" y="4" width="14" height="20" class="inner" />
<text id="normal_H_text" x="6" y="14">H</text>
</g>
<g id="normal_I" transform="translate(0,240)">
<title id="normal_I_title">I</title>
<rect id="normal_I_box_1" x="0" y="0" width="15" height="28" />
<rect id="normal_I_box_2" x="4" y="4" width="7" height="20" class="inner" />
<text id="normal_I_text" x="6" y="14">I</text>
</g>
<g id="normal_J" transform="translate(0,270)">
<title id="normal_J_title">J</title>
<rect id="normal_J_box_1" x="0" y="0" width="19" height="28" />
<rect id="normal_J_box_2" x="4" y="4" width="11" height="20" class="inner" />
<text id="normal_J_text" x="6" y="14">J</text>
</g>
<g id="normal_K" transform="translate(0,300)">
<title id="normal_K_title">K</title>
<rect id="normal_K_box_1" x="0" y="0" width="22" height="28" />
<rect id="normal_K_box_2" x="4" y="4" width="14" height="20" class="inner" />
<text id="normal_K_text" x="6" y="14">K</text>
</g>
<g id="normal_L" transform="translate(0,330)">
<title id="normal_L_title">L</title>
<rect id="normal_L_box_1" x="0" y="0" width="20" height="28" />
<rect id="normal_L_box_2" x="4" y="4" width="12" height="20" class="inner" />
<text id="normal_L_text" x="6" y="14">L</text>
</g>
<g id="normal_M" transform="translate(0,360)">
<title id="normal_M_title">M</title>
<rect id="normal_M_box_1" x="0" y="0" width="24" height="28" />
<rect id="normal_M_box_2" x="4" y="4" width="16" height="20" class="inner" />
<text id="normal_M_text" x="6" y="14">M</text>
</g>
<g id="normal_N" transform="translate(0,390)">
<title id="normal_N_title">N</title>
<rect id="normal_N_box_1" x="0" y="0" width="22" height="28" />
<rect id="normal_N_box_2" x="4" y="4" width="14" height="20" class="inner" />
<text id="normal_N_text" x="6" y="14">N</text>
</g>
<g id="normal_O" transform="translate(0,420)">
<title id="normal_O_title">O</title>
<rect id="normal_O_box_1" x="0" y="0" width="24" height="28" />
<rect id="normal_O_box_2" x="4" y="4" width="16" height="20" class="inner" />
<text id="normal_O_text" x="6" y="14">O</text>
</g>
<g id="normal_P" transform="translate(0,450)">
<title id="normal_P_title">P</title>
<rect id="normal_P_box_1" x="0" y="0" width="21" height="28" />
<rect id="normal_P_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="normal_P_text" x="6" y="14">P</text>
</g>
<g id="normal_Q" transform="translate(0,480)">
<title id="normal_Q_title">Q</title>
<rect id="normal_Q_box_1" x="0" y="0" width="24" height="28" />
<rect id="normal_Q_box_2" x="4" y="4" width="16" height="20" class="inner" />
<text id="normal_Q_text" x="6" y="14">Q</text>
</g>
<g id="normal_R" transform="translate(0,510)">
<title id="normal_R_title">R</title>
<rect id="normal_R_box_1" x="0" y="0" width="23" height="28" />
<rect id="normal_R_box_2" x="4" y="4" width="15" height="20" class="inner" />
<text id="normal_R_text" x="6" y="14">R</text>
</g>
<g id="normal_S" transform="translate(0,540)">
<title id="normal_S_title">S</title>
<rect id="normal_S_box_1" x="0" y="0" width="22" height="28" />
<rect id="normal_S_box_2" x="4" y="4" width="14" height="20" class="inner" />
<text id="normal_S_text" x="6" y="14">S</text>
</g>
<g id="normal_T" transform="translate(0,570)">
<title id="normal_T_title">T</title>
<rect id="normal_T_box_1" x="0" y="0" width="22" height="28" />
<rect id="normal_T_box_2" x="4" y="4" width="14" height="20" class="inner" />
<text id="normal_T_text" x="6" y="14">T</text>
</g>
<g id="normal_U" transform="translate(0,600)">
<title id="normal_U_title">U</title>
<rect id="normal_U_box_1" x="0" y="0" width="22" height="28" />
<rect id="normal_U_box_2" x="4" y="4" width="14" height="20" class="inner" />
<text id="normal_U_text" x="6" y="14">U</text>
</g>
<g id="normal_V" transform="translate(0,630)">
<title id="normal_V_title">V</title>
<rect id="normal_V_box_1" x="0" y="0" width="23" height="28" />
<rect id="normal_V_box_2" x="4" y="4" width="15" height="20" class="inner" />
<text id="normal_V_text" x="6" y="14">V</text>
</g>
<g id="normal_W" transform="translate(0,660)">
<title id="normal_W_title">W</title>
<rect id="normal_W_box_1" x="0" y="0" width="27" height="28" />
<rect id="normal_W_box_2" x="4" y="4" width="19" height="20" class="inner" />
<text id="normal_W_text" x="6" y="14">W</text>
</g>
<g id="normal_X" transform="translate(0,690)">
<title id="normal_X_title">X</title>
<rect id="normal_X_box_1" x="0" y="0" width="23" height="28" />
<rect id="normal_X_box_2" x="4" y="4" width="15" height="20" class="inner" />
<text id="normal_X_text" x="6" y="14">X</text>
</g>
<g id="normal_Y" transform="translate(0,720)">
<title id="normal_Y_title">Y</title>
<rect id="normal_Y_box_1" x="0" y="0" width="23" height="28" />
<rect id="normal_Y_box_2" x="4" y="4" width="15" height="20" class="inner" />
<text id="normal_Y_text" x="6" y="14">Y</text>
</g>
<g id="normal_Z" transform="translate(0,750)">
<title id="normal_Z_title">Z</title>
<rect id="normal_Z_box_1" x="0" y="0" width="22" height="28" />
<rect id="normal_Z_box_2" x="4" y="4" width="14" height="20" class="inner" />
<text id="normal_Z_text" x="6" y="14">Z</text>
</g>
<g id="normal_zero" transform="translate(0,780)">
<title id="normal_zero_title">0</title>
<rect id="normal_zero_box_1" x="0" y="0" width="21" height="28" />
<rect id="normal_zero_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="normal_zero_text" x="6" y="14">0</text>
</g>
<g id="normal_one" transform="translate(0,810)">
<title id="normal_one_title">1</title>
<rect id="normal_one_box_1" x="0" y="0" width="17" height="28" />
<rect id="normal_one_box_2" x="4" y="4" width="9" height="20" class="inner" />
<text id="normal_one_text" x="6" y="14">1</text>
</g>
<g id="normal_two" transform="translate(0,840)">
<title id="normal_two_title">2</title>
<rect id="normal_two_box_1" x="0" y="0" width="21" height="28" />
<rect id="normal_two_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="normal_two_text" x="6" y="14">2</text>
</g>
<g id="normal_three" transform="translate(0,870)">
<title id="normal_three_title">3</title>
<rect id="normal_three_box_1" x="0" y="0" width="21" height="28" />
<rect id="normal_three_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="normal_three_text" x="6" y="14">3</text>
</g>
<g id="normal_four" transform="translate(0,900)">
<title id="normal_four_title">4</title>
<rect id="normal_four_box_1" x="0" y="0" width="21" height="28" />
<rect id="normal_four_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="normal_four_text" x="6" y="14">4</text>
</g>
<g id="normal_five" transform="translate(0,930)">
<title id="normal_five_title">5</title>
<rect id="normal_five_box_2" x="0" y="0" width="21" height="28" />
<rect id="normal_five_box_1" x="4" y="4" width="13" height="20" class="inner" />
<text id="normal_five_text" x="6" y="14">5</text>
</g>
<g id="normal_six" transform="translate(0,960)">
<title id="normal_six_title">6</title>
<rect id="normal_six_box_1" x="0" y="0" width="21" height="28" />
<rect id="normal_six_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="normal_six_text" x="6" y="14">6</text>
</g>
<g id="normal_seven" transform="translate(0,990)">
<title id="normal_seven_title">7</title>
<rect id="normal_seven_box_1" x="0" y="0" width="21" height="28" />
<rect id="normal_seven_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="normal_seven_text" x="6" y="14">7</text>
</g>
<g id="normal_eight" transform="translate(0,1020)">
<title id="normal_eight_title">8</title>
<rect id="normal_eight_box_1" x="0" y="0" width="21" height="28" />
<rect id="normal_eight_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="normal_eight_text" x="6" y="14">8</text>
</g>
<g id="normal_nine" transform="translate(0,1050)">
<title id="normal_nine_title">9</title>
<rect id="normal_nine_box_1" x="0" y="0" width="21" height="28" />
<rect id="normal_nine_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="normal_nine_text" x="6" y="14">9</text>
</g>
</g>
<g id="italic" transform="translate(37)" class="italic_text">
<g id="italic_A" transform="translate(0,0)">
<title id="italic_A_title">A</title>
<rect id="italic_A_box_1" x="0" y="0" width="23" height="28" />
<rect id="italic_A_box_2" x="4" y="4" width="15" height="20" class="inner" />
<text id="italic_A_text" x="6" y="14">A</text>
</g>
<g id="italic_B" transform="translate(0,30)">
<title id="italic_B_title">B</title>
<rect id="italic_B_box_1" x="0" y="0" width="23" height="28" />
<rect id="italic_B_box_2" x="4" y="4" width="15" height="20" class="inner" />
<text id="italic_B_text" x="6" y="14">B</text>
</g>
<g id="italic_C" transform="translate(0,60)">
<title id="italic_C_title">C</title>
<rect id="italic_C_box_1" x="0" y="0" width="23" height="28" />
<rect id="italic_C_box_2" x="4" y="4" width="15" height="20" class="inner" />
<text id="italic_C_text" x="6" y="14">C</text>
</g>
<g id="italic_D" transform="translate(0,90)">
<title id="italic_D_title">D</title>
<rect id="italic_D_box_1" x="0" y="0" width="24" height="28" />
<rect id="italic_D_box_2" x="4" y="4" width="16" height="20" class="inner" />
<text id="italic_D_text" x="6" y="14">D</text>
</g>
<g id="italic_E" transform="translate(0,120)">
<title id="italic_E_title">E</title>
<rect id="italic_E_box_1" x="0" y="0" width="24" height="28" />
<rect id="italic_E_box_2" x="4" y="4" width="16" height="20" class="inner" />
<text id="italic_E_text" x="6" y="14">E</text>
</g>
<g id="italic_F" transform="translate(0,150)">
<title id="italic_F_title">F</title>
<rect id="italic_F_box_1" x="0" y="0" width="23" height="28" />
<rect id="italic_F_box_2" x="4" y="4" width="15" height="20" class="inner" />
<text id="italic_F_text" x="6" y="14">F</text>
</g>
<g id="italic_G" transform="translate(0,180)">
<title id="italic_G_title">G</title>
<rect id="italic_G_box_1" x="0" y="0" width="24" height="28" />
<rect id="italic_G_box_2" x="4" y="4" width="16" height="20" class="inner" />
<text id="italic_G_text" x="6" y="14">G</text>
</g>
<g id="italic_H" transform="translate(0,210)">
<title id="italic_H_title">H</title>
<rect id="italic_H_box_1" x="0" y="0" width="25" height="28" />
<rect id="italic_H_box_2" x="4" y="4" width="17" height="20" class="inner" />
<text id="italic_H_text" x="6" y="14">H</text>
</g>
<g id="italic_I" transform="translate(0,240)">
<title id="italic_I_title">I</title>
<rect id="italic_I_box_1" x="0" y="0" width="17" height="28" />
<rect id="italic_I_box_2" x="4" y="4" width="9" height="20" class="inner" />
<text id="italic_I_text" x="6" y="14">I</text>
</g>
<g id="italic_J" transform="translate(0,270)">
<title id="italic_J_title">J</title>
<rect id="italic_J_box_1" x="0" y="0" width="21" height="28" />
<rect id="italic_J_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="italic_J_text" x="6" y="14">J</text>
</g>
<g id="italic_K" transform="translate(0,300)">
<title id="italic_K_title">K</title>
<rect id="italic_K_box_1" x="0" y="0" width="24" height="28" />
<rect id="italic_K_box_2" x="4" y="4" width="16" height="20" class="inner" />
<text id="italic_K_text" x="6" y="14">K</text>
</g>
<g id="italic_L" transform="translate(0,330)">
<title id="italic_L_title">L</title>
<rect id="italic_L_box_1" x="0" y="0" width="21" height="28" />
<rect id="italic_L_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="italic_L_text" x="6" y="14">L</text>
</g>
<g id="italic_M" transform="translate(0,360)">
<title id="italic_M_title">M</title>
<rect id="italic_M_box_1" x="0" y="0" width="26" height="28" />
<rect id="italic_M_box_2" x="4" y="4" width="18" height="20" class="inner" />
<text id="italic_M_text" x="6" y="14">M</text>
</g>
<g id="italic_N" transform="translate(0,390)">
<title id="italic_N_title">N</title>
<rect id="italic_N_box_1" x="0" y="0" width="25" height="28" />
<rect id="italic_N_box_2" x="4" y="4" width="17" height="20" class="inner" />
<text id="italic_N_text" x="6" y="14">N</text>
</g>
<g id="italic_O" transform="translate(0,420)">
<title id="italic_O_title">O</title>
<rect id="italic_O_box_1" x="0" y="0" width="24" height="28" />
<rect id="italic_O_box_2" x="4" y="4" width="16" height="20" class="inner" />
<text id="italic_O_text" x="6" y="14">O</text>
</g>
<g id="italic_P" transform="translate(0,450)">
<title id="italic_P_title">P</title>
<rect id="italic_P_box_1" x="0" y="0" width="24" height="28" />
<rect id="italic_P_box_2" x="4" y="4" width="16" height="20" class="inner" />
<text id="italic_P_text" x="6" y="14">P</text>
</g>
<g id="italic_Q" transform="translate(0,480)">
<title id="italic_Q_title">Q</title>
<rect id="italic_Q_box_1" x="0" y="0" width="24" height="28" />
<rect id="italic_Q_box_2" x="4" y="4" width="16" height="20" class="inner" />
<text id="italic_Q_text" x="6" y="14">Q</text>
</g>
<g id="italic_R" transform="translate(0,510)">
<title id="italic_R_title">R</title>
<rect id="italic_R_box_1" x="0" y="0" width="24" height="28" />
<rect id="italic_R_box_2" x="4" y="4" width="16" height="20" class="inner" />
<text id="italic_R_text" x="6" y="14">R</text>
</g>
<g id="italic_S" transform="translate(0,540)">
<title id="italic_S_title">S</title>
<rect id="italic_S_box_1" x="0" y="0" width="22" height="28" />
<rect id="italic_S_box_2" x="4" y="4" width="14" height="20" class="inner" />
<text id="italic_S_text" x="6" y="14">S</text>
</g>
<g id="italic_T" transform="translate(0,570)">
<title id="italic_T_title">T</title>
<rect id="italic_T_box_1" x="0" y="0" width="22" height="28" />
<rect id="italic_T_box_2" x="4" y="4" width="14" height="20" class="inner" />
<text id="italic_T_text" x="6" y="14">T</text>
</g>
<g id="italic_U" transform="translate(0,600)">
<title id="italic_U_title">U</title>
<rect id="italic_U_box_1" x="0" y="0" width="24" height="28" />
<rect id="italic_U_box_2" x="4" y="4" width="16" height="20" class="inner" />
<text id="italic_U_text" x="6" y="14">U</text>
</g>
<g id="italic_V" transform="translate(0,630)">
<title id="italic_V_title">V</title>
<rect id="italic_V_box_1" x="0" y="0" width="24" height="28" />
<rect id="italic_V_box_2" x="4" y="4" width="16" height="20" class="inner" />
<text id="italic_V_text" x="6" y="14">V</text>
</g>
<g id="italic_W" transform="translate(0,660)">
<title id="italic_W_title">W</title>
<rect id="italic_W_box_1" x="0" y="0" width="27" height="28" />
<rect id="italic_W_box_2" x="4" y="4" width="19" height="20" class="inner" />
<text id="italic_W_text" x="6" y="14">W</text>
</g>
<g id="italic_X" transform="translate(0,690)">
<title id="italic_X_title">X</title>
<rect id="italic_X_box_1" x="0" y="0" width="26" height="28" />
<rect id="italic_X_box_2" x="4" y="4" width="18" height="20" class="inner" />
<text id="italic_X_text" x="6" y="14">X</text>
</g>
<g id="italic_Y" transform="translate(0,720)">
<title id="italic_Y_title">Y</title>
<rect id="italic_Y_box_1" x="0" y="0" width="24" height="28" />
<rect id="italic_Y_box_2" x="4" y="4" width="16" height="20" class="inner" />
<text id="italic_Y_text" x="6" y="14">Y</text>
</g>
<g id="italic_Z" transform="translate(0,750)">
<title id="italic_Z_title">Z</title>
<rect id="italic_Z_box_1" x="0" y="0" width="23" height="28" />
<rect id="italic_Z_box_2" x="4" y="4" width="15" height="20" class="inner" />
<text id="italic_Z_text" x="6" y="14">Z</text>
</g>
<g id="italic_zero" transform="translate(0,780)">
<title id="italic_zero_title">0</title>
<rect id="italic_zero_box_1" x="0" y="0" width="21" height="28" />
<rect id="italic_zero_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="italic_zero_text" x="6" y="14">0</text>
</g>
<g id="italic_one" transform="translate(0,810)">
<title id="italic_one_title">1</title>
<rect id="italic_one_box_1" x="0" y="0" width="18" height="28" />
<rect id="italic_one_box_2" x="4" y="4" width="10" height="20" class="inner" />
<text id="italic_one_text" x="6" y="14">1</text>
</g>
<g id="italic_two" transform="translate(0,840)">
<title id="italic_two_title">2</title>
<rect id="italic_two_box_1" x="0" y="0" width="21" height="28" />
<rect id="italic_two_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="italic_two_text" x="6" y="14">2</text>
</g>
<g id="italic_three" transform="translate(0,870)">
<title id="italic_three_title">3</title>
<rect id="italic_three_box_1" x="0" y="0" width="21" height="28" />
<rect id="italic_three_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="italic_three_text" x="6" y="14">3</text>
</g>
<g id="italic_four" transform="translate(0,900)">
<title id="italic_four_title">4</title>
<rect id="italic_four_box_1" x="0" y="0" width="21" height="28" />
<rect id="italic_four_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="italic_four_text" x="6" y="14">4</text>
</g>
<g id="italic_five" transform="translate(0,930)">
<title id="italic_five_title">5</title>
<rect id="italic_five_box_1" x="0" y="0" width="21" height="28" />
<rect id="italic_five_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="italic_five_text" x="6" y="14">5</text>
</g>
<g id="italic_six" transform="translate(0,960)">
<title id="italic_six_title">6</title>
<rect id="italic_six_box_1" x="0" y="0" width="21" height="28" />
<rect id="italic_six_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="italic_six_text" x="6" y="14">6</text>
</g>
<g id="italic_seven" transform="translate(0,990)">
<title id="italic_seven_title">7</title>
<rect id="italic_seven_box_1" x="0" y="0" width="21" height="28" />
<rect id="italic_seven_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="italic_seven_text" x="6" y="14">7</text>
</g>
<g id="italic_eight" transform="translate(0,1020)">
<title id="italic_eight_title">8</title>
<rect id="italic_eight_box_1" x="0" y="0" width="21" height="28" />
<rect id="italic_eight_box_2" x="4" y="4" width="13" height="20" class="inner" />
<text id="italic_eight_text" x="6" y="14">8</text>
</g>
<g id="italic_nine" transform="translate(0,1050)">
<title id="italic_nine_title">9</title>
<rect id="italic_nine_box_1" x="0" y="0" width="20" height="28" />
<rect id="italic_nine_box_2" x="4" y="4" width="12" height="20" class="inner" />
<text id="italic_nine_text" x="6" y="14">9</text>
</g>
</g>
</g>
</svg>
Change the attributes in the svg tag and add the sodipodi:namedview lines of the SVG to the following if you want to open it in Inkscape. The grid and guidelines are added so you can see the offset.
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
sodipodi:docname="Alphabet_boxes_ink.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
viewBox="0 0 111 1088"
width="111"
height="1088"
id="Alphabet_boxes"
>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1280"
inkscape:window-height="979"
id="namedview5209"
showgrid="true"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="1"
inkscape:cx="52"
inkscape:cy="1.1e+03"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="Alphabet_boxes"
>
<inkscape:grid type="xygrid" id="grid5213" />
<sodipodi:guide position="11,1088" orientation="1,0" id="guide5215" inkscape:locked="false" />
<sodipodi:guide position="48,1088" orientation="1,0" id="guide5217" inkscape:locked="false" />
<sodipodi:guide position="85,1088" orientation="1,0" id="guide5219" inkscape:locked="false" />
</sodipodi:namedview>

Changeing an SVG from 238 to 266 and now I'm stuck

This was originally 238, I want to change it to 266, and now I'm stuck.
I've done this before, but I forgot how to do it.
I know 7 goes into 266 38 times. See, I forgot how to do all this math, how you're supposed to calculate it.
I'm confused now.
It should all fit evenly I think, or does it not?
<svg width="266" height="266" viewBox="0 0 266 266">
<rect x="0" y="0" width="266" height="266" fill="blue" />
<rect x="7" y="7" width="224" height="224" fill="black" />
<rect x="14" y="14" width="210" height="210" fill="red" />
<rect x="21" y="21" width="196" height="196" fill="black" />
<rect x="28" y="28" width="182" height="182" fill="yellow" />
<rect x="35" y="35" width="168" height="168" fill="black" />
<rect x="42" y="42" width="154" height="154" fill="orange" />
<rect x="49" y="49" width="140" height="140" fill="black" />
<rect x="56" y="56" width="126" height="126" fill="lime" />
<rect x="63" y="63" width="112" height="112" fill="black" />
<rect x="70" y="70" width="98" height="98" fill="teal" />
<rect x="77" y="77" width="84" height="84" fill="black" />
<rect x="84" y="84" width="70" height="70" fill="silver" />
<rect x="91" y="91" width="56" height="56" fill="black" />
<rect x="98" y="98" width="42" height="42" fill="#1155cc" />
<rect x="105" y="105" width="28" height="28" fill="black" />
<rect x="112" y="112" width="14" height="14" fill="gold" />
</svg>
Assuming the original looked like this:
<svg width="238" height="238" viewBox="0 0 238 238">
<rect x="0" y="0" width="238" height="238" fill="blue" />
<rect x="7" y="7" width="224" height="224" fill="black" />
<rect x="14" y="14" width="210" height="210" fill="red" />
<rect x="21" y="21" width="196" height="196" fill="black" />
<rect x="28" y="28" width="182" height="182" fill="yellow" />
<rect x="35" y="35" width="168" height="168" fill="black" />
<rect x="42" y="42" width="154" height="154" fill="orange" />
<rect x="49" y="49" width="140" height="140" fill="black" />
<rect x="56" y="56" width="126" height="126" fill="lime" />
<rect x="63" y="63" width="112" height="112" fill="black" />
<rect x="70" y="70" width="98" height="98" fill="teal" />
<rect x="77" y="77" width="84" height="84" fill="black" />
<rect x="84" y="84" width="70" height="70" fill="silver" />
<rect x="91" y="91" width="56" height="56" fill="black" />
<rect x="98" y="98" width="42" height="42" fill="#1155cc" />
<rect x="105" y="105" width="28" height="28" fill="black" />
<rect x="112" y="112" width="14" height="14" fill="gold" />
</svg>
Then all you have to do to scale it up to 266x266 is to update the width and height attributes.
<svg width="266" height="266" viewBox="0 0 238 238">
Because the SVG has a viewBox, the browser will scale the contents automatically for you.
<svg width="266" height="266" viewBox="0 0 238 238">
<rect x="0" y="0" width="238" height="238" fill="blue" />
<rect x="7" y="7" width="224" height="224" fill="black" />
<rect x="14" y="14" width="210" height="210" fill="red" />
<rect x="21" y="21" width="196" height="196" fill="black" />
<rect x="28" y="28" width="182" height="182" fill="yellow" />
<rect x="35" y="35" width="168" height="168" fill="black" />
<rect x="42" y="42" width="154" height="154" fill="orange" />
<rect x="49" y="49" width="140" height="140" fill="black" />
<rect x="56" y="56" width="126" height="126" fill="lime" />
<rect x="63" y="63" width="112" height="112" fill="black" />
<rect x="70" y="70" width="98" height="98" fill="teal" />
<rect x="77" y="77" width="84" height="84" fill="black" />
<rect x="84" y="84" width="70" height="70" fill="silver" />
<rect x="91" y="91" width="56" height="56" fill="black" />
<rect x="98" y="98" width="42" height="42" fill="#1155cc" />
<rect x="105" y="105" width="28" height="28" fill="black" />
<rect x="112" y="112" width="14" height="14" fill="gold" />
</svg>

Excel export cell background color

I am using iReport 5.6 and when I set conditional formatting for cells in a table preview in iReport works ok
When I save as xls document the table is shown the cells are colored and values are in the cells but they (values) are not displayed. If I set cell color to normal I can see the values. Any ideas how to fix it. Either in Excel or iReport (preferably)?
my xml
<?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="test_tabelegrafi" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<property name="ireport.zoom" value="1.4641000000000006"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="92"/>
<style name="table" lineSpacing="Single">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table_TH" mode="Opaque" backcolor="#F0F8FF" lineSpacing="Single">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_CH" mode="Opaque" backcolor="#BFE1FF" lineSpacing="Single">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_TD" mode="Opaque" backcolor="#FFFFFF" lineSpacing="Single">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="barva_rdeca" mode="Transparent" forecolor="#000000" backcolor="#FFFFFF" lineSpacing="Single" pattern="">
<conditionalStyle>
<conditionExpression><![CDATA[$F{count} > 100]]></conditionExpression>
<style mode="Opaque" backcolor="#FF0000" fill="Solid" lineSpacing="Single"/>
</conditionalStyle>
<conditionalStyle>
<conditionExpression><![CDATA[$F{count} <= 100]]></conditionExpression>
<style mode="Opaque" backcolor="#00CC33" fill="Solid" lineSpacing="Single"/>
</conditionalStyle>
</style>
<subDataset name="New Dataset 2">
<queryString>
<![CDATA[select
o_teacher,
o_class,
o_location,
count(*)
from outputs_txt
where o_date between '2014-05-30' and '2014-06-30' and o_class != '' and o_location is not null
group by o_teacher, o_class,o_location
order by o_class,o_teacher
limit 10]]>
</queryString>
<field name="o_teacher" class="java.lang.String"/>
<field name="o_class" class="java.lang.String"/>
<field name="o_location" class="java.lang.String"/>
<field name="count" class="java.lang.Long"/>
</subDataset>
<subDataset name="Graf">
<queryString>
<![CDATA[select
o_teacher,
o_class,
o_location,
count(*)
from outputs_txt
where o_date between '2014-05-30' and '2014-06-30' and o_class != '' and o_location is not null
and o_location IN ('tel1','tel2', 'tel3')
group by o_teacher, o_class,o_location
order by o_class,o_teacher
limit 10]]>
</queryString>
<field name="o_teacher" class="java.lang.String"/>
<field name="o_class" class="java.lang.String"/>
<field name="o_location" class="java.lang.String"/>
<field name="count" class="java.lang.Long"/>
</subDataset>
<queryString>
<![CDATA[select
o_teacher,
o_class,
o_location,
count(*)
from outputs_txt
where o_date between '2014-05-30' and '2014-06-30' and o_class != '' and o_location is not null
group by o_teacher, o_class,o_location
order by o_class,o_teacher
limit 10]]>
</queryString>
<field name="o_teacher" class="java.lang.String"/>
<field name="o_class" class="java.lang.String"/>
<field name="o_location" class="java.lang.String"/>
<field name="count" class="java.lang.Long"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="79" splitType="Stretch">
<staticText>
<reportElement x="154" y="0" width="234" height="38"/>
<textElement textAlignment="Center" lineSpacing="Single">
<font size="14"/>
</textElement>
<text><![CDATA[TESTNI REPORT TABEL IN GRAFOV]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band height="287" splitType="Stretch">
<componentElement>
<reportElement key="table" style="barva_rdeca" stretchType="RelativeToBandHeight" x="0" y="0" width="555" height="118"/>
<jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
<datasetRun subDataset="New Dataset 2">
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
</datasetRun>
<jr:column width="90">
<jr:columnHeader style="table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="90" height="30"/>
<textElement lineSpacing="Single"/>
<text><![CDATA[o_teacher]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table_TD" height="20" rowSpan="1">
<textField>
<reportElement x="0" y="0" width="90" height="20"/>
<textElement lineSpacing="Single"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{o_teacher}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90">
<jr:columnHeader style="table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="90" height="30"/>
<textElement lineSpacing="Single"/>
<text><![CDATA[o_class]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table_TD" height="20" rowSpan="1">
<textField>
<reportElement x="0" y="0" width="90" height="20"/>
<textElement textAlignment="Center" lineSpacing="Single"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{o_class}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90">
<jr:columnHeader style="table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="90" height="30"/>
<textElement lineSpacing="Single"/>
<text><![CDATA[o_location]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table_TD" height="20" rowSpan="1">
<textField>
<reportElement x="0" y="0" width="90" height="20"/>
<textElement textAlignment="Center" lineSpacing="Single"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{o_location}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90">
<jr:columnHeader style="table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="90" height="30"/>
<textElement lineSpacing="Single"/>
<text><![CDATA[count]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table_TD" height="20" rowSpan="1">
<textField>
<reportElement style="barva_rdeca" x="0" y="0" width="90" height="20"/>
<textElement textAlignment="Center" lineSpacing="Single" markup="none"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{count}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
<bar3DChart>
<chart>
<reportElement positionType="Float" x="0" y="141" width="555" height="146"/>
<chartTitle/>
<chartSubtitle/>
<chartLegend/>
</chart>
<categoryDataset>
<dataset>
<datasetRun subDataset="Graf">
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
</datasetRun>
</dataset>
<categorySeries>
<seriesExpression><![CDATA[$F{o_location}]]></seriesExpression>
<categoryExpression><![CDATA[$F{o_teacher}]]></categoryExpression>
<valueExpression><![CDATA[$F{count}]]></valueExpression>
</categorySeries>
</categoryDataset>
<bar3DPlot>
<plot/>
<itemLabel/>
<categoryAxisFormat>
<axisFormat/>
</categoryAxisFormat>
<valueAxisFormat>
<axisFormat/>
</valueAxisFormat>
</bar3DPlot>
</bar3DChart>
</band>
</pageHeader>
<columnHeader>
<band splitType="Stretch"/>
</columnHeader>
<detail>
<band splitType="Stretch"/>
</detail>
<columnFooter>
<band splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
The only solution I could find was that after export I selected the cells in Excel and changed type to Numeric or smth other then custom.

How to embed an image with rounded corners in svg

I want to embed an image with rounded corners inside a svg-file. how can i aproach this? I googled about that problem, but couldnt find anything useful...
I'm grateful for any help or hints.
<!DOCTYPE html>
<html>
<body>
<svg width="640" height="800">
<rect x="280" y="0" ry="10" width="80" height="100"
style="fill:limegreen; stroke:black;" />
<rect x="260" y="90" ry="15" width="120" height="30"
style="fill:mintcream; stroke:black;" />
<rect x="200" y="150" ry="10" width="80" height="100"
style="fill:limegreen; stroke:black;" />
<rect x="180" y="240" ry="15" width="120" height="30"
style="fill:mintcream; stroke:black;" />
<rect x="360" y="150" ry="10" width="80" height="100"
style="fill:limegreen; stroke:black;" />
<rect x="340" y="240" ry="15" width="120" height="30"
style="fill:mintcream; stroke:black;" />
<rect x="120" y="300" ry="10" width="80" height="100"
style="fill:limegreen; stroke:black;" />
<rect x="100" y="390" ry="15" width="120" height="30"
style="fill:mintcream; stroke:black;" />
<rect x="280" y="300" ry="10" width="80" height="100"
style="fill:limegreen; stroke:black;" />
<rect x="260" y="390" ry="15" width="120" height="30"
style="fill:mintcream; stroke:black;" />
<rect x="440" y="300" ry="10" width="80" height="100"
style="fill:limegreen; stroke:black;" />
<rect x="420" y="390" ry="15" width="120" height="30"
style="fill:mintcream; stroke:black;" />
</svg>
</body>
</html>
the greens are supposed to be different images. so how do i get the images to have rounded corners?
You can apply the same clipPath to multiple elements like this...
<!DOCTYPE html>
<html>
<body>
<svg width="640" height="800">
<clipPath id="clip" clipPathUnits="objectBoundingBox">
<rect ry="0.1" width="1" height="1" fill="black" />
</clipPath>
<rect x="280" y="0" width="80" height="100"
style="fill:limegreen;" clip-path="url(#clip)" />
<rect x="260" y="90" ry="15" width="120" height="30"
style="fill:mintcream; stroke:black;" />
<rect x="200" y="150" width="80" height="100"
style="fill:limegreen;" clip-path="url(#clip)" />
<rect x="180" y="240" ry="15" width="120" height="30"
style="fill:mintcream; stroke:black;" />
</svg>
</body>
</html>

Jasper Reports Excel Output Problems

I am new to Jasper Reports and iReports that I am using to design the reports.
I am currently designing a report in iReport and want to export it in excel (xls). Here is the screen shot of what I want to design and the second screen is what I am getting.
Shot at 2012-08-04
Here is what I have managed to get. As you can see there are many problems in the output.
Column A is missing
There are some problems with column D and E and Column C is also invisible.
I dont know how to add blank rows in my design from IReports
Shot at 2012-08-04
Here is the source to what I have done so far:
<?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="report1" language="groovy" pageWidth="792" pageHeight="612" orientation="Landscape" columnWidth="792" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="1e5ee76a-b072-4f31-a1ce-d0c921d2ce55">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.columns" value="true"/>
<property name="net.sf.jasperreports.export.xls.detect.cell.type" value="true"/>
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.rows" value="true"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="21" splitType="Stretch">
<staticText>
<reportElement uuid="557d6e9d-b389-4710-a66f-f15678ebb003" x="1" y="1" width="119" height="20"/>
<textElement>
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[Sample Heading]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band height="71" splitType="Stretch">
<staticText>
<reportElement uuid="3d8bfb44-a4ce-409f-a626-4bdba125b0a4" x="0" y="11" width="100" height="20"/>
<textElement verticalAlignment="Middle"/>
<text><![CDATA[Start Date]]></text>
</staticText>
<staticText>
<reportElement uuid="ee347fa8-037a-4fe1-8de2-98867d4903a3" x="0" y="31" width="100" height="20"/>
<textElement verticalAlignment="Middle"/>
<text><![CDATA[Start Date]]></text>
</staticText>
<staticText>
<reportElement uuid="beaa366e-2976-4b46-86ee-55af14249675" x="0" y="51" width="100" height="20"/>
<textElement verticalAlignment="Middle"/>
<text><![CDATA[Start Date]]></text>
</staticText>
<textField pattern="dd-MMM-yy">
<reportElement uuid="4f4124a7-5071-4ced-ba92-c39c6f6ffc54" x="100" y="11" width="100" height="20"/>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField pattern="dd-MMM-yy">
<reportElement uuid="9492ff27-6c11-417f-8ae9-43dddfcda405" x="100" y="31" width="100" height="20"/>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField pattern="dd-MMM-yy">
<reportElement uuid="b8baea82-84c4-42fa-bccd-62abc96eeded" x="100" y="51" width="100" height="20"/>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band height="69" splitType="Stretch">
<staticText>
<reportElement uuid="1c5d41a5-a86b-4cd0-bac8-19950c3eb5b3" x="0" y="49" width="100" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Heading]]></text>
</staticText>
<staticText>
<reportElement uuid="6d798309-0e10-4c11-8642-53edd66f8ed0" x="100" y="49" width="100" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Heading]]></text>
</staticText>
<staticText>
<reportElement uuid="7ca5ae53-47e2-46f9-90c6-2d8f5d66dc5e" x="200" y="49" width="100" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Heading]]></text>
</staticText>
<staticText>
<reportElement uuid="bae9670f-10fa-4932-9e1b-00c8e38cd009" x="300" y="49" width="100" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Heading]]></text>
</staticText>
<staticText>
<reportElement uuid="bcf09004-a0ca-479f-9d6d-fe2aab932452" x="400" y="49" width="100" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Heading]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="151" splitType="Stretch">
<staticText>
<reportElement uuid="418012e1-fbc2-4cb9-bf7f-2740061bbfd1" x="1" y="0" width="100" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Data]]></text>
</staticText>
<staticText>
<reportElement uuid="9b6a2c68-6327-4a8a-940f-41f5be8bc7ca" x="100" y="0" width="100" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Data]]></text>
</staticText>
<staticText>
<reportElement uuid="7e7ddc5f-31e7-4b76-bbd7-a6f0a2c11169" x="200" y="0" width="100" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Data]]></text>
</staticText>
<staticText>
<reportElement uuid="5f8c4ae6-d2c0-4ded-9e3e-8f1a69995043" x="300" y="0" width="100" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Data]]></text>
</staticText>
<staticText>
<reportElement uuid="f8f51e3b-5dcc-43f0-9f56-00a1bc703ad1" x="400" y="0" width="100" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Data]]></text>
</staticText>
<staticText>
<reportElement uuid="418012e1-fbc2-4cb9-bf7f-2740061bbfd1" x="0" y="20" width="100" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Data]]></text>
</staticText>
<staticText>
<reportElement uuid="418012e1-fbc2-4cb9-bf7f-2740061bbfd1" x="100" y="20" width="100" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Data]]></text>
</staticText>
<staticText>
<reportElement uuid="418012e1-fbc2-4cb9-bf7f-2740061bbfd1" x="200" y="20" width="100" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Data]]></text>
</staticText>
<staticText>
<reportElement uuid="418012e1-fbc2-4cb9-bf7f-2740061bbfd1" x="300" y="20" width="100" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Data]]></text>
</staticText>
<staticText>
<reportElement uuid="418012e1-fbc2-4cb9-bf7f-2740061bbfd1" x="400" y="20" width="100" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Data]]></text>
</staticText>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
Any help in this matter would be appreciated alot. Thanks a bunch!!
Every single time I had problems with that it was because the fields weren't properly aligned. So make sure the fields that should be vertically aligned have the same x value and have the same widths.
Your first Data field is located at x=1 (the other fields on that column are at x=0). Maybe this alone won't solve all the problems, but I am pretty sure the first Data will start to appear in the Excel output.
I ran into a similar issue with Excel exports. I had text fields in my title and report header bands that did not extend the whole width of the report, and some where the left position was not zero (that was intentional on my part, for design purposes). iReport then merged columns to handle this.
To get my Excel exports to look and behave the way I wanted, I had to make my text fields in my title and report header bands the full width of the report and make sure they were aligned to 0 at the left. You can add padding to text fields to position text within them. Anything that happens prior to your detail band needs to be wider than the output in your detail band.
I tried that before, it is because the layout setting doesnt match. You need to make sure the left starting position of each column a the same, and so as their width. If there are merged cells, the width of it need to be exact number of the total of the merged columns width.
go to Tools -> Options -> Export Tools -> Excel -> tick 2nd and 3rd and last 4 ...
Enjoy

Resources