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)
Two column report does not line up
javaguy
I have created a newspaper style two column report. It works great, and when I look at in the report designer preview mode, everything lines up and looks perfect. However, when I open it in the viewer, it only puts one column on a page at a time. Sometimes it's the left column, sometimes the right, but never both together, like they are supposed to be. Any ideas?
Find more posts tagged with
Comments
mwilliams
Hi javaguy,
Can you recreate this issue with the sample database so I can run it and test on it? Also, what version of BIRT are you using?
javaguy
I'll try. I am using v 2.5.2
javaguy
OK, well, as I figured would happen, the sample report lines up perfectly in the viewer. I don't know why mine doesn't.
The major difference between this sample report I attached and mine, is that I am embedding a table within a table within a table, and filtering the two inner tables on the outer row of the next table up. Could that have something to do with it?
mwilliams
javaguy,
I'd have to see how you have it set up. If you could post your report design, I'll take a look at it to see if I see anything. If you could build a more similar report with the sample database to where it messes up, that'd be helpful for if we don't solve this by me looking at yours.
javaguy
OK, here is my design. I don't know if it will help without data.
mwilliams
Ok, is this what you're getting with your report? Something like with the following report design?
javaguy
Pretty much, except that your design displayed SOME pages correctly, with both columns.
My design doesn't have ANY pages that show both columns at the same time.
But at a basic level, you've recreated the problem.
mwilliams
javaguy,
Ok, one more question. Do any PCTGCD field values have more than one PSCGCD value? And do any PSCGCD field values have more than one product under it? Let me know so I can try to set up a solution. Thanks.
javaguy
Yes, PCTGCD is one-to-many with PSCGCD and PSCGCD is one-to-many with PRODUCT
mwilliams
javaguy,
Ok, if you can add PCTGCD to your detail dataSet and just use that one dataSet and grouping to display your report, it would work just fine. It seems that the first nested table causes problems with the pagination. You can see how it works when I do the above with the sample report. I modified it and reattached it. The first table is the original, the second is the one dataSet and grouping way. When you run the report with the web viewer, the second table starts on page 89. Let me know if this is something that'll work for you.
javaguy
your solution worked! Thanks a bunch!
mwilliams
Just an FYI, BIRT 2.6.0 is going to have a newspaper style layout option that will automatically roll to a second column before going to the next page.
javaguy
Actually, I did notice that the grouping is doing something weird to the data.
As the left table gets to the page break number, if the group of PCTGCD is not finished, it continues in the right table, but the left table keeps populating with the next group of PCTGCD.
This results in PCTGCD groups being split up in either column on the same page. What it should do is continue with the same group of PCTGCD in the same column until it is done, and then start the next one, and only move to the next column when it reaches the page break.
mwilliams
I'm guessing this has something to do with the filter. Can you post a screenshot so I'm sure I get exactly what you're saying though?
javaguy
I messed with the page break value and it changed slightly, but still a problem. As of this screenshot, it was set to 40.
mwilliams
This is definitely an issue with the filter, I would guess. To get the group to stay on the same side of the page, you'll probably have to do something like bring your data in sorted by the field you're grouping on, create a computed column that keeps a running count that increments as the group changes. Then you'd filter your tables to put half of the groups on one side and half on the other. You may need to do a little more than just this to make the two columns run equal amounts of pages though.
javaguy
That sounds WAY too complicated for this noobie!! Any chance you could dumb that down for me?
I also have tried emailing the author of the newspaper column technique, but he is not answering me. I don't know what else to do.
mwilliams
javaguy,
I'll modify the example I made earlier with your filter to work this way.
mwilliams
javaguy,
As a simple modification to keep the same amount of rows on each side, I simply split the total number of rows in two and put the first half in the first column and the second half in the second column. I used two simple computed columns in the dataSet and a filter on each table. You'll see that the last group in the left column is continued in the right column at the very top. To do this the way I described earlier so that no group is split up like this, you'd just change the "RunningCount" computed column to a simple script that increments when the "CustomerNumber" changes, since the data is brought in pre-ordered and delete the "Count" column and just use the variable you're incrementing for the computed column as the total number of groups.
Hope this helps. Let me know if you have questions.
javaguy
It's fine to have the last group in the left column split and continue at the top of the right column, but what is happening is that on subsequent pages, if the group still has items left, it will display that group again with the remaining items under it. This has something to do with the page break value that is set in the table properties.
I am still at a loss as to how to fix it.
mwilliams
javaguy,
I guess I'm confused to what you're asking. Do you want a page break after each group, so that each group is only on one page? Or are you talking about the repeating header? If so, you can turn off the repeating header in the group editor.
javaguy
No, I want as many groups on the page as I can get, and they can be split from one column to the next, and even from the left column to the right column of the next page, but what cannot happen is some items in a group being listed in one place, and then 1 or 2 pages later, there are some more items from that group listed.
Does that mean my SQL is faulty?
mwilliams
javaguy,
Oh, ok, gotcha. I don't know if it would be the SQL or maybe somewhere in the database those values are slightly different, like an extra space or something along those lines. Is it usually still in the same column? Or does it sometimes end up in the other column? You might try checking the lengths of those same values that end up in a different order. Or even check the values against each other to see if BIRT sees them the same.
javaguy
I don't think that's the problem. Another process in our system populates the category field (the one I'm grouping on) from a single field of a single row in another table. So that would mean that the values for that field in each record would have to be identical.
mwilliams
Are the "second groups" happening in the same column? Or in the other column? Or does it vary?
javaguy
it varies.
mwilliams
I just don't see how it could be an SQL problem, but I could be wrong. From the sounds of what you're saying, it just sounds like the values aren't the same. If they were, sorting your dataSet in your SQL would recognize they're the same and put them together in the dataSet and then BIRT would recognize them as the same in the grouping. Did you try any comparisons between the ones that are getting split up? Is it the same groups getting split up each time? You might try creating a new dataSet that only calls in one of the groups that's getting split up and see if that returns all the rows or just some of them as well. This would show whether the database values are somehow different.
You could also attach your report as it currently stands and I'll take a look at it to see if I notice anything that could possibly cause a problem.
javaguy
Here are some screenshots of your example. You had the pagebreak set at 10 for both tables. You can see how the groups are broken up. I am sure your example works in your viewer, but it doesn't in mine.
I just had a thought. I looked at both my design and yours in the preview tab of the report designer and they both work perfectly. It is only when I publish the reports in eclipse and open them in the viewer that they are messed up.
Also attached is my rptdesign.
mwilliams
javaguy,
I've seen this in the web viewer this way with my example. I thought this was what you were wanting? The group continues on to the next page in the same column when the page break is encountered. You could set the page break value to a higher amount. I guess maybe I'm confused now to exactly what you're wanting it to do. Please let me know. Thanks!
javaguy
If a group starts in the first column and is large enough to go to the second column, it should continue from the bottom of the first column to the top of the second on the same page. If it is large enough for a second page, it should continue in the first column of the second page.
If a group starts in the second column and reaches the page break, it should continue in the first column of the next page.