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)
Minimun Number of rows
Daimonio
Here is my question... (Same as the title)
How do I make a table have a minimun number of rows...even when there's no data to fill up the remaining rows?
In practice..
My query broght 5 records but i want 13 rows to be displayed (8 rows blank 5 rows with data )
Help!
and thanks for the help in advance
Find more posts tagged with
Comments
mwilliams
You might be able to create a dummy scripted dataSet with 13 rows and join your data to it with a joint dataSet. If you're already using a scripted dataSet, you could just create blank rows on the end of your dataSet.
Another option could be to simply extend your table like in the following example:
http://www.birt-exchange.org/org/devshare/designing-birt-reports/989-extend-table-to-fit-page/
Daimonio
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="73752" data-time="1298479237" data-date="23 February 2011 - 09:40 AM"><p>
You might be able to create a dummy scripted dataSet with 13 rows and join your data to it with a joint dataSet. If you're already using a scripted dataSet, you could just create blank rows on the end of your dataSet.<br />
<br />
Another option could be to simply extend your table like in the following example:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/designing-birt-reports/989-extend-table-to-fit-page/'>http://www.birt-exchange.org/org/devshare/designing-birt-reports/989-extend-table-to-fit-page/</a><br
/></p></blockquote>
<br />
<br />
Leaning more towards adding blank rows to my data set.. Dummy data set woudnt work for my group by<br />
<br />
How do i add blank rows? <br />
<br />
Ive used this function to rewrite some of my query on the beforeopen phase...<br />
<br />
this.queryText.replace <br />
<br />
I imagine there's a similar function to add rows?
mwilliams
The problem with trying to figure this out in the beforeOpen is that you don't know how many rows your dataSet is going to return at this point, so you wouldn't know how many rows to add. There's probably a way you could write your query to return blank rows for up to 13 rows. I'm not a SQL master, so I don't know this for sure, though.
You could always have a dummy table or grid below your table or in your group footer that you could show/hide the rows of depending on the size of your group.
Daimonio
Think youve tackle this issue before
http://www.birt-exchange.org/org/forum/index.php/topic/21657-minimun-number-of-rows/page__gopid__73756&
;
This could def work...Just need to know how to set the visibility on the footer rows?
mwilliams
What is your BIRT version? I'll try to come up with something real quick for you.
Daimonio
ver 3.5.2
adding the footers didnt work...=(
mwilliams
Can you set up a similar report to yours with the sample database so I know how your report is set up and test with it? How you're grouping your report and all. Thanks. I still want to see if I can make the "dummy" dataSet work somehow. Worst case, you can build an HTML table from the group data and add blank rows as needed and display that table in the group footer using a HTML type text control.
Daimonio
Setting up the report. Question thou.. How do you determine your group size? ive been using row._rownum to hide/show the rows set up on the footer, but as youve just said since i have a group by in my table row._rownum tells me the rownumber for the hole dataset and dosent filter by group.. so not working when theres a page break on the report (caused by the group by).
mwilliams
If you add rows to the group footer and choose to hide or display them based on the rows in the group, you should be able to do it. To determine the rows, you can add an aggregation to your group that gives you the count. You can then use this value to determine to show/hide the extra group footer rows.
I can build an example showing this if you'd like. Let me know.
Daimonio
Here is the dummy report... in theory thats exactly how the report is layed out, a lot of more columns and data fields but only consists of one table
Daimonio
Yea!! that would def work (I beleive and hope)
do tell
mwilliams
Here, take a look at this report. It is grouped and shows a minimum of 10 rows for the group using extra group footer rows.
Daimonio
Hmm
Trying to create the aggregation to the group by..but i can only affect the dataset (all of the data set)
so the countdistinct or count would again have the same problem as the row._rownum
Is there a way to create that aggregation to the group clause on the table?? Hope your having better luck than I
Daimonio
Thanks for the report major help!!
See what you mean.. let me set it up and let you know
Again thanks!
Daimonio
Cheers for you my friend...
It worked thanks
mwilliams
Not a problem, at all! Let us know whenever you have questions!
Daimonio
So here is another question... Dunno if you want me to open up another post
If the data set is empty the table and hidden rows dont display...
How do i display the table even if dataset is empty?
mwilliams
Are you talking about for a given group that doesn't exist? Or any data in the table period? If it's any data in the table at all, you can set a variable to 0 in your initialize script and increment it in you onFetch() script of you dataSet. In your visibility for your grid, you'd show the grid if the variable was still 0 and hide it if the variable was greater than 0. Let me know.
Daimonio
any data in the table ...
So i would have to place the table inside a grid and do the filter in the visibility property ?
mwilliams
No, you'd place the grid right after your table. Another thing you could do would be to create a scripted dataSet that had the amount of rows you want, use that in a separate table behind your current table and hide it like I described for the grid.
Daimonio
would work... Having problems setting up the variable
Dont seem to find the on initialize script..have only beforeOpen, BeforeClose, Onfetch,afteropen,afterclose
The scripting would be done on the dataset right?
mwilliams
Oh, no, sorry, initialize the variable in your initialize of your report, so that it will for sure be available.
Daimonio
Perfect again cheers to you!!
Used the grid at the end of the table..Worked perfect thanks man
mwilliams
No problem!