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)
Header Data
grtgatsby
I have a report that has a grid with a table inside the grid. The top part of the grid is acting as my header. I can't get the data in the header to change when I go from one page to another. I'm running out of options. I attached a sample using Classic cars database. I'm sure it's something simple I'm missing.
Find more posts tagged with
Comments
mwilliams
Hi grtgatsby,
Check out the modifications I made to your design. You remove the binding to the dataSet from the grid and let it use the table bindings. I also moved the grid and the label down from the table header to the group header so it will update with each changing group.
Hope this helps.
grtgatsby
That worked. Thanks for your help. How can I make two show up on one page before a page break.
mwilliams
grtgatsby,
There may be other ways to achieve this, but this is one pretty simple way. Since the dataSet is ordered by CustomerNumber, which is what our table is grouped on, I created a computed column that counted these group. I then added another group to the table before the current group and made it an interval group of 2. This way we could set a page break after the group to always. Check out the design and let me know if you have any questions.
grtgatsby
That worked ... Thanks for your help. I need to put a grid at the bottom of each work order for material, and I figured I could put the grid inside the footer. That didn't work as I planned. It prints one grid per page. I need two grids per page. So then I put the grid in the header and footer. It kind of worked, but it always left an extra grid at the bottom of the page. I attached both ways I tried this method with classic cars db.
mwilliams
grtgatsby,
You should be able to put the grid into the "work order" group footer. This would be group footer #2 since our outer group is the interval group.
grtgatsby
I might be getting closer ... I added a new group for the grid and used your column that you defined. Trying to figure out page breaks.
mwilliams
In your sample.rptdesign, select the table, right click on group header #2, choose to insert a group footer, then move the grid up to that footer from group footer #1. That should put two on each page the way you want. Let me know.
grtgatsby
Micheal,
I computed a new column that counts the number of orders, because if there are more than 14 orders I need to go to the next page. If one work order takes up more than half a page we want to print it on a page by itself, because of overlapping. Attached is my newest sample.
mwilliams
So, are you still having issues? Or is everything solved for now?
grtgatsby
I can't get it to break to a new page properly if there are more than 14 orders. It's breaking at 14 and printing the rest of the orders on a new page. I need it to print a new page after it finishes the orders.
mwilliams
grtgatsby,
What is your main output type? PDF?
grtgatsby
PDF is our main output type. I've come across this snippet of script:
grpCount = grpCount + 1;
if (grpCount >= 14) {
this.getStyle().pageBreakAfter = "Always";
reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Trans").setPageBreakInterval(30);
}
I set this script on the notes group row ... nothing happened. Don't really know script.
grtgatsby
I've tried all day to get it to page break when I want to and can't do it. I've attached a sample using classic cars. I know I'm going to need to use some script for what I want to accomplish. Basically what I need is ... Right now I'm page breaking on every two groups, but if my orders are greater than 15 rows; I need to finish the orders out before I page break. Leaving just one worker per page.
mwilliams
grtgatsby,
Take a look at this design. I removed some groups and added a aggregation binding to the table and some script to the groups. Let me know if this does what you are looking for and/or if you have any questions.
grtgatsby
Ok, you got me ... where is the script at?
mwilliams
If you click on the groups in the outline and then click on the script tab, you'll find the script I added. I defined a variable in the initialize method of the report, reset it to 0 in the page break scripts and incremented it by the aggregation in the onCreate of the inner group. Let me know if you still have questions and if this is doing what you're looking for.
grtgatsby
It is really close ... I'm having a issue after the hard break. The next page after the hard break is breaking. After that page everything is working fine. Take a look at my output ... On page 1 and 7 there is a hard break, and it breaks again on the next page when it shouldn't. Something needs to be reset after a hard break and I can't figure it out.
mwilliams
grtgatsby,
Ok, I see what's happening, I think. Try the script in the attached report. I deleted the outer group and handled all the page breaking myself. Let me know if this logic works better.
grtgatsby
Your script should work ... I don't know why it's breaking on the next page after a hard break. Everything is getting reset. Don't know if it's a bug. I guess I'll leave it as is.
I promise I'll stop bugging you after this question ... I appreciate all your help.
When I print two orders per page ... Can I get the second order to print on the second half of the page instead of right after the first one?
mwilliams
grtgatsby,
Can you attach your real report design? I'll just double check that everything is in there correctly for you.
grtgatsby
Here u go.
mwilliams
grtgatsby,
You're still using the page break group in your report design. In the last one I just posted, I get rid of the interval group and manually page break to keep 2 per page except when there is a large group.
grtgatsby
Michael,
It's 99% working. That will work for me. I don't know if you read my last question ... When I have two orders per page; can I start the second order in the middle of the page? Right now it is right below the first order.
mwilliams
grtgatsby,<br />
<br />
You might be able to do something like the following devShare post to extend a blank section to halfway down the page.<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/devshare/designing-birt-reports/989-extend-table-to-fit-page/#description'>Extend
Table to Fit Page - Designs & Code - BIRT Exchange</a>
grtgatsby
That worked ... Thanks again for all your help Michael.
mwilliams
No problem. Always glad to help!
grtgatsby
I thought I was done with this, but it was brought to my attention that my notes are doubling up when I have more than one transaction. I figured I could put the notes with group 1. That works, but it only prints one line of the notes. There are several notes per ticket. Attached are examples with notes in the detail and notes in the group. I couldn't duplicate it with classic cars since there is only one comment per order. Page 3 in the PDF's show the problem.
mwilliams
grtgatsby,
Do you have a height set on the group footer line? This could cause the row to not expand to show all the notes.
grtgatsby
I do not see height set anywhere.
mwilliams
grtgatsby,
Hmmm. Could you attach your design? Cause this is exactly where you should put it and I'm not sure why that would not work out correctly.