Jump to content
Changes to the Jaspersoft community edition download ×

How to create table in ireport


moyphus

Recommended Posts

How to create table in ireport...It throws an error

Code:
<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="RequestApproval">							<dataSourceExpression><![CDATA[$F{requestApproval}]]></dataSourceExpression>						</datasetRun>						<jr:column width="90">							<jr:columnHeader style="table 1_CH" height="30">								<staticText>									<reportElement x="0" y="0" width="90" height="30"/>									<textElement/>									<text><![CDATA[ApprovalId]]></text>								</staticText>							</jr:columnHeader>							<jr:detailCell style="table 1_TD" height="20">								<textField>									<reportElement x="0" y="0" width="90" height="20"/>									<textElement/>									<textFieldExpression class="java.lang.String"><![CDATA[$F{ApprovalId}]]></textFieldExpression>								</textField>							</jr:detailCell>						</jr:column>						<jr:column width="90">							<jr:columnHeader style="table 1_CH" height="30">								<staticText>									<reportElement x="0" y="0" width="90" height="30"/>									<textElement/>									<text><![CDATA[status]]></text>								</staticText>							</jr:columnHeader>							<jr:detailCell style="table 1_TD" height="20">								<textField>									<reportElement x="0" y="0" width="90" height="20"/>									<textElement/>									<textFieldExpression class="java.lang.String"><![CDATA[$F{Status}]]></textFieldExpression>								</textField>							</jr:detailCell>						</jr:column>						<jr:column width="90">							<jr:columnHeader style="table 1_CH" height="30">								<staticText>									<reportElement x="0" y="0" width="90" height="30"/>									<textElement/>									<text><![CDATA[statusDescription]]></text>								</staticText>							</jr:columnHeader>							<jr:detailCell style="table 1_TD" height="20">								<textField>									<reportElement x="0" y="0" width="90" height="20"/>									<textElement/>									<textFieldExpression class="java.lang.String"><![CDATA[$F{StatusDescription}]]></textFieldExpression>								</textField>							</jr:detailCell>						</jr:column>						<jr:column width="90">							<jr:columnHeader style="table 1_CH" height="30">								<staticText>									<reportElement x="0" y="0" width="90" height="30"/>									<textElement/>									<text><![CDATA[ApprovalType]]></text>								</staticText>							</jr:columnHeader>							<jr:detailCell style="table 1_TD" height="20">								<textField>									<reportElement x="0" y="0" width="90" height="20"/>									<textElement/>									<textFieldExpression class="java.lang.String"><![CDATA[$F{ApprovalType}]]></textFieldExpression>								</textField>							</jr:detailCell>						</jr:column>						<jr:column width="90">							<jr:columnHeader style="table 1_CH" height="30">								<staticText>									<reportElement x="0" y="0" width="90" height="30"/>									<textElement/>									<text><![CDATA[RecordUpdatedUserId]]></text>								</staticText>							</jr:columnHeader>							<jr:detailCell style="table 1_TD" height="20">								<textField>									<reportElement x="0" y="0" width="90" height="20"/>									<textElement/>									<textFieldExpression class="java.lang.String"><![CDATA[$F{RecordUpdatedUserId}]]></textFieldExpression>								</textField>							</jr:detailCell>						</jr:column>						<jr:column width="90">							<jr:columnHeader style="table 1_CH" height="30">								<staticText>									<reportElement x="0" y="0" width="90" height="30"/>									<textElement/>									<text><![CDATA[RecordUpdatedOn]]></text>								</staticText>							</jr:columnHeader>							<jr:detailCell style="table 1_TD" height="20">								<textField>									<reportElement x="0" y="0" width="90" height="20"/>									<textElement/>									<textFieldExpression class="java.sql.Timestamp"><![CDATA[$F{RecordUpdatedOn}]]></textFieldExpression>								</textField>							</jr:detailCell>						</jr:column>						<jr:column width="90">							<jr:columnHeader style="table 1_CH" height="30">								<staticText>									<reportElement x="0" y="0" width="90" height="30"/>									<textElement/>									<text><![CDATA[RequestId]]></text>								</staticText>							</jr:columnHeader>							<jr:detailCell style="table 1_TD" height="20">								<textField>									<reportElement x="0" y="0" width="90" height="20"/>									<textElement/>									<textFieldExpression class="java.lang.String"><![CDATA[$F{RequestId}]]></textFieldExpression>								</textField>							</jr:detailCell>						</jr:column>						<jr:column width="90">							<jr:columnHeader style="table 1_CH" height="30">								<staticText>									<reportElement x="0" y="0" width="90" height="30"/>									<textElement/>									<text><![CDATA[ApprovedBy]]></text>								</staticText>							</jr:columnHeader>							<jr:detailCell style="table 1_TD" height="20">								<textField>									<reportElement x="0" y="0" width="90" height="20"/>									<textElement/>									<textFieldExpression class="java.lang.String"><![CDATA[$F{ApprovedBy}]]></textFieldExpression>								</textField>							</jr:detailCell>						</jr:column>					</jr:table>
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

What is the error?

Remember to use in the table only the Fields of your subdataset "RequestApproval"

You cannot use other Fields.... but i'm not know it is the problem... i need you send the error...

If interest, i made a video showing how to use the table:


http://bit.ly/cY4xMH   (audio only in portuguese, but i think you will not need the audio)

 



Post Edited by danielsb2 at 28/06/2010 11:55
Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...