Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Transpose rows to columns
Fly_PT
Hi,<br />
<br />
I have a scripted data set that is populated with an injected parameter through RunAndRenderTask (the parameter is a list of objects returned from an EJB).<br />
<br />
This data set renders into something like (using a table):<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
label1 label2 label3 label4 label5
year1 | value1 value2 value3 value4 value5
year2 | value6 value7 value8 value9 value10
(...)
</pre>
<br />
I need to draw a table in the report but with those rows transposed into columns:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
year1 year2
label1 | value1 value6
label2 | value2 value7
label3 | value3 value8
label4 | value4 value9
label5 | value5 value10
</pre>
<br />
The number of columns can be fixed or dynamic and has to support page break when the width is too large.<br />
<br />
<br />
Is it possible to achieve this with a table or a crosstab component?<br />
<br />
<br />
Thanks in advance
Find more posts tagged with
Comments
mcremer
<blockquote class='ipsBlockquote' data-author="'Fly_PT'" data-cid="81654" data-time="1313673412" data-date="18 August 2011 - 06:16 AM"><p>
Hi,<br />
<br />
I have a scripted data set that is populated with an injected parameter through RunAndRenderTask (the parameter is a list of objects returned from an EJB).<br />
<br />
This data set renders into something like (using a table):<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
label1 label2 label3 label4 label5
year1 | value1 value2 value3 value4 value5
year2 | value6 value7 value8 value9 value10
(...)
</pre>
<br />
I need to draw a table in the report but with those rows transposed into columns:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
year1 year2
label1 | value1 value6
label2 | value2 value7
label3 | value3 value8
label4 | value4 value9
label5 | value5 value10
</pre>
<br />
The number of columns can be fixed or dynamic and has to support page break when the width is too large.<br />
<br />
<br />
Is it possible to achieve this with a table or a crosstab component?<br />
<br />
<br />
Thanks in advance<br /></p></blockquote>
<br />
What you discribe sounds like the Cube and the Cross tab based from the Cube. I sugest looking in to that.
Fly_PT
I took a look at the crosstab but it's not exactly what I need. I just need to transpose the rows, no aggregation is necessary, and the rows have harcoded labels.
Are there any examples available for this?
mcremer
<blockquote class='ipsBlockquote' data-author="'Fly_PT'" data-cid="81678" data-time="1313698715" data-date="18 August 2011 - 01:18 PM"><p>
I took a look at the crosstab but it's not exactly what I need. I just need to transpose the rows, no aggregation is necessary, and the rows have harcoded labels.<br />
<br />
Are there any examples available for this?<br /></p></blockquote>
<br />
You can use a Cube without the agrigations just for this type of stuff other wise you need to change your query hevely and do that transposing in the query it self.