nizam27391 Posted January 8, 2015 Share Posted January 8, 2015 Hi all,I have this requirement to generate a report with dynamic columns which is the course code. I manage to do this with the crosstab. But I have another extra details (GPA,CGPA,Result) which require me to add extra column to the crosstab.The data is retrieved from the database already. I'm not able to do this as there is no option for this.So any idea on how I can add extra column to the crosstab? Thanks Link to comment Share on other sites More sharing options...
AsadHaydar Posted January 8, 2015 Share Posted January 8, 2015 You can add columns, rows and measures in crosstab properties. Link to comment Share on other sites More sharing options...
nizam27391 Posted January 12, 2015 Author Share Posted January 12, 2015 Hi. Can you show me how? All I can see is to add column group / row group in Jasperstudio. Kindly help me with this..Thanks in advance. Link to comment Share on other sites More sharing options...
nizam27391 Posted January 12, 2015 Author Share Posted January 12, 2015 Hi.. Can you guide me on doing this. I dont see any add new column in jasperstudio. All I see is to add column group and row group which really wasn't what I'm looking for.. Link to comment Share on other sites More sharing options...
nizam27391 Posted January 12, 2015 Author Share Posted January 12, 2015 never mind.. I already achieve something.. Thanks. :D Link to comment Share on other sites More sharing options...
dstevens_2 Posted August 25, 2017 Share Posted August 25, 2017 I wasn't able to find a way to add a column without a group, so did the following work around:In my last columnI added a second text field element in the Column Group headerCrossTab > Column Groups > Total DateData.Date: This section contains two text fields <columnGroup name="dateSet.RecordDate" height="20" totalPosition="End"> <bucket order="Descending" class="java.sql.Timestamp"> <bucketExpression><![CDATA[$F{dateSet.RecordDate}]]></bucketExpression> </bucket> <crosstabHeader> <cellContents> <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/> </cellContents> </crosstabHeader> <crosstabColumnHeader> <cellContents mode="Opaque" style="Crosstab_CH"> <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/> <property name="com.jaspersoft.studio.unit.width" value="pixel"/> <textField pattern="MMM d, yyyy"> <reportElement mode="Opaque" x="0" y="0" width="70" height="20" forecolor="#FFFFFF" backcolor="#0096D1" uuid="b9639ac1-d6ff-41fd-b066-534a881548a2"/> <textFieldExpression><![CDATA[$V{dateSet.RecordDate}]]></textFieldExpression> </textField> </cellContents> </crosstabColumnHeader> <crosstabTotalColumnHeader> <cellContents mode="Opaque" style="Crosstab_CT"> <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/> <property name="com.jaspersoft.studio.unit.width" value="pixel"/> <textField> <reportElement mode="Opaque" x="0" y="0" width="60" height="20" forecolor="#FFFFFF" backcolor="#0096D1" uuid="b7d8e730-8fca-4b37-b6c0-6d2732444fea"/> <textFieldExpression><![CDATA["u0394"]]></textFieldExpression> </textField> <textField> <reportElement mode="Opaque" x="60" y="0" width="60" height="20" forecolor="#FFFFFF" backcolor="#0096D1" uuid="b6884931-0695-4142-9d49-34989de70de2"/> <textFieldExpression><![CDATA["Abs " + "u0394"]]></textFieldExpression> </textField> </cellContents> </crosstabTotalColumnHeader> </columnGroup>[/code] I added a second text field element in the Column Group Detail sectionCrossTab > DateData.Date/Detail: This section contains two text fields, with each of my $V{Variable_Measures}<crosstabCell width="120" height="20" columnTotalGroup="dateSet.RecordDate"> <cellContents mode="Opaque" style="Crosstab_CT"> <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/> <textField pattern="#,##0.00"> <reportElement mode="Opaque" x="0" y="0" width="60" height="20" forecolor="#000000" uuid="a753ecb5-d682-4ffc-8f41-3b4e8f6cce98"/> <textElement textAlignment="Right" verticalAlignment="Middle"> <font fontName="DejaVu Sans" size="10"/> </textElement> <textFieldExpression><![CDATA[$V{Diff_Measure}]]></textFieldExpression> </textField> <textField pattern="#,##0.00"> <reportElement mode="Opaque" x="60" y="0" width="60" height="20" forecolor="#000000" uuid="01e6bcd2-b0e4-4bb7-a353-6221af88415b"/> <textElement textAlignment="Right" verticalAlignment="Middle"> <font fontName="DejaVu Sans" size="10"/> </textElement> <textFieldExpression><![CDATA[$V{AbsDiff_Measure}]]></textFieldExpression> </textField> </cellContents></crosstabCell>[/code]Apologies, i don't seem to have permission to upload a screenshot, but src code aboveIm sure it's more complicated when your crosstab contains totals, mine was fortunately a very simple crosstab Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now