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)
Table header and row summary label
csmsmk3
<p>Hi all,</p>
<p> </p>
<p>I'm very new to BIRT (Analytics Designer Pro 4.4). I have a stored proc with 2 input parameters: account_name, as_of_date ("acct_1", "04-30-2000"). The resultset returns "Period_Summary","MTD", "QTD", "YTD" and "Inception". I wanted to append the "as_of_date" to the "Inception" table header. It should look like this: "Inception (04-30-2000)".</p>
<p> </p>
<p>Additionally I have a sumary row, "Ending Market Value" and also would like to append the as_of_date as well: "Ending Market Value (04-30-2000").</p>
<p> </p>
<p>The report should look like the attachment.</p>
<p> </p>
<p>Thanks.</p>
Find more posts tagged with
Comments
pricher
<p>Hi,</p>
<p> </p>
<p>Assuming that you bind a report parameter to the stored procedure parameter, you can easily display the value of the report parameter as part of your table. In the attached example, I have created a report parameter called AsOfDate. (In your situation, the value of AsOfDate would be bound to the stored procedure parameter as_of_date). To display the AsOfDate value in the column header "Quantity in Stock", simply concatenate its value in a Text Item like this:</p>
<p> </p>
<p><span style="font-family:arial, helvetica, sans-serif;">Quantity in Stock (<VALUE-OF format="Medium Date">params["AsOfDate"].value</VALUE-OF>)</span></p>
<p> </p>
<p>For the summary row, the case may be a bit different if the summary values are calculated in the stored procedure as opposed to being calculated in BIRT. For the latter, use the same technique as above. For the former situation, modify the expression in the data binding to concatenate the parameter value when the row being displayed is the summary. An expression like this one will work:</p>
<p> </p>
<p>if (dataSetRow["PRODUCTLINE"] == "Total")<br>
dataSetRow["PRODUCTLINE"] + " (" + Formatter.format(params["AsOfDate"].value,"Medium Date") + ")"<br>
else<br>
dataSetRow["PRODUCTLINE"]</p>
<p> </p>
<p>Hope this helps,</p>
<p> </p>
<p>P.</p>
csmsmk3
<p>It works!!! Thanks.</p>
csmsmk3
<p>Hi,</p>
<p> </p>
<p>I have a slight change of requirement regarding the table I mentioned above. As I mentioned above, I have a stored proc with 2 input parameters: account_name, as_of_date ("acct_1", "04-30-2000"). The resultset returns "Period_Summary","MTD", "QTD", "YTD" and "Inception".</p>
<p> </p>
<p>Now instead of using the date parameter that will be appended to the "Inception" header column, the date should be coming from a different dataset which has a result of : acct_name, inception_date ["John Doe", "01-20-2001"].</p>
<p> </p>
<p>The table header should look like this:</p>
<p> "Period Summary", "MTD", "QTD", "YTD", "INCEPTION (01-20-2000)".</p>
<p> </p>
<p>Does the table element allows using 2 dataset? What I found that it can support it but using the join dataset. But in my case the 2nd dataset is only used for the table column header not part of the detail.</p>
<p> </p>
<p>Thanks.</p>
pricher
<p>Hi,</p>
<p> </p>
<p>You are right : a table can be bound only to one data set at a time. If joining the data sets beforehand doesn't make sense in your scenario, you can always store the value you need from the summary data set into a variable and use it later in the table that is bound to the detail data set. In the attached example the first table is bound to the "Last Order Data Set". In the onCreate method of the Detail Row, the value of "LastOrder" is stored in a report variable (assumption here is that the Data Set returns one and only one row.) Then, the Visibility property of the table is set to hide. The second table is bound to the "All Orders Data Set" and the value of the report variable is retrieved in the onCreate method of the label in the last column to display the date of the last order.</p>
<p> </p>
<p>Hope this helps,</p>
<p> </p>
<p>P.</p>
csmsmk3
<p>Thank you sir. It's working for me.</p>