问题
I need to generate a report of below format. The header repeats only per page.
ItemNr | ItemGenDesc | FulfilmentBin | onHand
-----------------------------------------------
CAP100 Capacitor FulFil1 5
binPriority | binBackup | binBackupQty | binMin | binMax
-----------------------------------------------------------------
1 bkBUSLOT2 100 1 5
2 bkBUSLOT3 150 2 6
CAP400 Transistor FulFil12 20
CAP500 Transistor FulFil14 30
binPriority | binBackup | binBackupQty | binMin | binMax
-----------------------------------------------------------------
1 bkBUSLOT5 250 5 9
My SQL output is as below
I tried to work with 2 tablix and somehow I got the output coming up in preview mode but when I export to PDF, I get blank lines between each item. I am guessing that's because the binPriority grid (detail grid) is hidden when the itemnr count <=1. Also the tablix1 row header appears for every grouping but I want row header to appear once per page.
Can anyone suggest what are the ways to generate this type of report?
Thanks.
Update 1 : Sorry CAP500 in the report should be Radiator. My typo mistake. The report should be grouped by ItemNumber and it is sorted by binPriority. So it will print binpriority=0 in the master grid and then in the detail grid it will print in the order of binPriority. The OnHand that is shown in the master grid is relevant to binPriority= 0.
回答1:
You can achieve your specified layout with a single Tablix. This is fairly simple if you don't mind Columns 2-4 in your Group heading lining up with Columns 1-3 in your Detail. Since horizontal page real estate isn't really an issue (only 6 columns counting the blank column to the left of your Detail columns), I would take this route.
I'm not sure how much you know about SSRS, so forgive me if this explanation is too rudimentary. Others with less experience than you might find it helpful as well.
- Right Click the Detail Row on your Tablix.
- Select Add Group => Row Group => Parent Group.
- Set the Group By value to ItemNumber and check the "Add Group Header" box.
- This creates a Group By Column, which I would delete for your specified layout. Make sure to only delete the Column, not the Row Group.
- In the Grouping Window (down at the bottom by default), right click the ItemNumber Row Group and select Group Properties.
- On the Sorting tab/menu, set the Sort By value to binPriority.
- Right Click your new Row Group Row on the Tablix and select Insert Row => Inside Group Above. You'll need to do this twice so you have 3 Row headings in the Row Group.
- Insert 3 more columns for a total of 6 columns in your Tablix.
- Put your ItemNr, ItemGenDesc, FulfilmentBin, onHand Labels and Values in the first two Rows, first 4 Columns of your Row Group.
- Put your binPriority, binBackup, binBackupQty, binMin, binMax Labels in the Last Row, Last 5 columns of your Row Group.
- Put your binPriority, binBackup, binBackupQty, binMin, binMax Values in the Last 5 columns of your Detail Row.
来源:https://stackoverflow.com/questions/21945288/ssrs-report-facing-issues-with-master-detail-kind-of-report