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

matthew.krohn

Members
  • Posts

    2
  • Joined

  • Last visited

matthew.krohn's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. I am trying to fill two tables in a report using different CSV datasources. I have datasources and datasets defined for each. Eventually I will be using a real data but I just can't seem to figure out how to get this to work. In the following code, only the data from the first table is displayed. I assume it's the <dataSourceExpression><![CDATA[(net.sf.jasperreports.engine.data.JRCsvDataSource) $P{REPORT_DATA_SOURCE}]]></dataSourceExpression> that is the problem? <subDataset name="Dataset1" uuid="ec0d49fe-f182-46d1-b9b9-8b3499d11708"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="TableAdapter"/> <queryString language="CSV"> <![CDATA[]]> </queryString> <field name="Caption" class="java.lang.String"/> <field name="Field" class="java.lang.String"/> </subDataset> <subDataset name="Dataset2" uuid="7b80730b-b759-47cd-a5e8-9c667e099a41"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="ParagraphAdapter"/> <queryString language="CSV"> <![CDATA[]]> </queryString> <field name="paragraph" class="java.lang.String"/> </subDataset> <queryString language="CSV"> <![CDATA[]]> </queryString> <field name="Caption" class="java.lang.String"/> <field name="Field" class="java.lang.String"/> <background> <band splitType="Stretch"/> </background> <title> <band height="79" splitType="Stretch"/> </title> <pageHeader> <band height="127" splitType="Stretch"> <staticText> <reportElement x="110" y="5" width="100" height="30" uuid="65b13941-53fa-469d-aae2-f3424cf9db5c"/> <text><![CDATA[RE:]]></text> </staticText> <componentElement> <reportElement x="230" y="5" width="200" height="23" uuid="5e69c3ab-1ec2-4b40-8aab-2dbe3edef468"/> <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="Dataset1" uuid="51319305-9562-4fbb-a924-dd3dc67c02fa"> <dataSourceExpression><![CDATA[(net.sf.jasperreports.engine.data.JRCsvDataSource) $P{REPORT_DATA_SOURCE}]]></dataSourceExpression> </datasetRun> <jr:column width="100" uuid="b8e2fa97-72e6-4573-9676-2eae44a59079"> <jr:detailCell style="Table 1_TD" height="30"> <textField> <reportElement x="0" y="0" width="100" height="30" uuid="266b582b-b382-42fd-8d33-3d0623347adc"/> <textFieldExpression><![CDATA[$F{Caption}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="100" uuid="0a2d9df0-8775-4bf7-b891-be0c8b1a5438"> <jr:detailCell style="Table 1_TD" height="30"> <textField> <reportElement x="0" y="0" width="100" height="30" uuid="59402bd4-be76-49be-a606-242c1c8710eb"/> <textFieldExpression><![CDATA[$F{Field}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> </jr:table> </componentElement> <componentElement> <reportElement x="110" y="47" width="319" height="67" uuid="36038e64-d2a9-478e-8836-0372628e5668"/> <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="Dataset2" uuid="7fc02aa2-7e2b-477e-be12-050c50ca6541"> <dataSourceExpression><![CDATA[(net.sf.jasperreports.engine.data.JRCsvDataSource) $P{REPORT_DATA_SOURCE}]]></dataSourceExpression> </datasetRun> <jr:column width="319" uuid="027ee2f2-7675-43c3-9d2e-3031406b636f"> <jr:detailCell style="Table 2_TD" height="30"> <textField> <reportElement x="0" y="0" width="200" height="30" uuid="773a6eeb-eb79-4d63-9c61-f51be53216de"/> <textFieldExpression><![CDATA[$F{paragraph}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> </jr:table> </componentElement> </band> </pageHeader>
  2. I'm trying to create an XML data source that will be used to load a pallete of fields into reports. A simple example of this is: <addressbook> <person> <name> <email/> <phone/> </person> </addressbook> If I use an Xpath expression of /addressbook/person this gets me the three fields I want, however all fields are defined as java.lang.String. How would I get phone for example, to be a data type other than String?
×
×
  • Create New...