Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
[Help] Newbie's crosstab design problems
dgtnk
<p>Hello!</p><p> </p><p>I'm a newbie to birt (Version 4.3.1) and currently learning to design reports. I created a crosstab in the report as attached. I used JavaScript to set the background color and number format of each cell. But i still have several problems:</p><p> </p><p>1. Could I dynamiclly set the width of each ROW HEADER column (green background part) to keep the row header in one line?</p><p> </p><p>2. Could I repeat the ROW HEADER columns (green background part) on the right side of the crosstab? Because sometimes the crosstab is so wide and this repeat could help users to read the report.</p><p> </p><p>3. Can I merge the blank cells on the topleft corner (orange background part) into one cell and write something in the cell?</p><p> </p><p> </p><p>Any suggestions are appreciated!</p>
Find more posts tagged with
Comments
kclark
<p>To alternate the row colors for your crosstab you could set some sort of counter variable from the initialize of the report</p><pre class="_prettyXprint">reportContext.setPersistentGlobalVariable("counter", "0")</pre><p>Then you could create a highlight rule. Use something like the following for the expression.</p><pre class="_prettyXprint">var counter = parseInt(reportContext.getPersistentGlobalVariable("counter"))if(counter == 0) { reportContext.setPersistentGlobalVariable("counter", "1");}else{ reportContext.setPersistentGlobalVariable("counter", "0");}counter</pre><p>Then have the check "equal to" 0 and select your background color.</p><p> </p><p>I don't think you can merge thoes cells in a crosstab but you might be able to remove the border from some JavaScript.</p>
dgtnk
<p>Hi Kclark!</p><p> </p><p>Thanks for your reply. I think you misunderstood my first two questions.</p><p> </p><p>1. I want to set the width of ROW HEADER columns dynamically so that all text contents are shown in one line. That's to say: no wrap of ROW HEADER text contents. Like:</p><pre class="_prettyXprint">1.this is a very long row header </pre><p>but not this</p><pre class="_prettyXprint">1.this is a very long row header</pre><p>because i don't know the text header contents in advance. so i want to set the width of these columns dynamically by using javascript. somthing like this: cell.width = length(cell.contents) * 10 px</p><p> </p><p> </p><p>2. i want to repeat the ROW HEADER columns on the right side of the crosstab. because ROW HEADER columns are shown on the left side of the crosstab by default. like:</p><pre class="_prettyXprint"> COLUMN HEADERROW_HEADER1 ROW_HEADER2 AGG VALUE</pre><p>but i want this:</p><pre class="_prettyXprint"> COLUMN HEADERROW_HEADER1 ROW_HEADER2 AGG_VALUE ROW_HEADER2 ROW_HEADER1</pre>