How can I have multiple tables on one SSRS page that represents one value in SQL? - sql

I have developed a one page report that has 4 tables on it. I am happy with this result:
This is shown for one district. (district = '002') The dataset only has the one district selected. I want to select multiple districts (a SQL field) in the dataset and have multiple pages representing one district per page. So, to state in a different way, there are about 10 districts so I want to have 10 pages just like this one with one district per page. It seems like there should be some sort of grouping option so I can show this page for each district. I'm new to SSRS so I'm probably missing something obvious. Thanks!

This set of tables can be repeated for each selected district with one set on each page. To achieve this, you can take advantage of nested tables.
Create a new table with one row and one column.
Set it to be grouped on district.
Set the group to page break after each instance. And optionally set the page name to be the district. This way, if you export to Excel, the sheets will be properly named.
Insert all the other tables into a Rectangle. This is a way of keeping the formatting of the other tables in tact and handle them all together.
Drag the rectangle into the new one-cell table.
Now the small table will repeat the entire contents of the rectangle for each district and you get copies of the entire report on separate pages.

Related

Can SQL Server Reporting Services print multiple tables and charts on one page?

I'm new to SSRS and I'm not sure if what I want to do is possible with SSRS. I have a list of 100+ schools in my data set. I'd like to print one page per school, and for it to look like the picture below. Each table and chart are using a unique data set, but it's all coming from one main table.
Can SSRS print two separate tables and 2 charts on the same page per school?
If so, where do I set the page breaks and how would I set this up please? If you need any more information, please let me know.
Thank you!
You can use a list in order to group by school and set the page break property of the list to End.
As long as your table and graph data fit to one page, you can position report components as your sample layout

How to apply a single section across multiple columns in Business Intelligence

I do a lot of reporting out of our Electronic Health Record using a Business Objects product, and one thing I run into frequently is records for which most of the columns are the same, but a few may have multiple different values.
For instance, a report I'm working on has 8 columns, mostly static information about the patient/encounter, some lab values, and a column for the consulting physician. All the columns will have only a single value per patient/encounter, except for consulting physician which may have multiple. I'd like to somehow set the table to show only a single row for the data that is unchanged, so they don't end up seeing the FIN, MRN, and lab values over and over.
However, as far as I've been able to tell with my fiddling around, I can only apply a section or break to a single column. Creating multiple sections or breaks nests them. Does anybody know of a way to treat multiple columns as sort of a composite section?
edit: I did try pulling the consulting physician column out into its own table and then setting the room number as a section, but it still caused repeated rows of the other data for any that had multiple consultings.
Additional edit: As requested here's a mockup of approximately what I'd like to see. This is mostly how it looks already when I tell BO to use the room number (the number in blue, top left of each row) as a section, however in the case of the third room, it would repeat the information in the first 5 columns for each consulting listed.
Couple of ways to do it, but putting breaks on each column is what I would do.
So, starting from "FIN" and working to "Attending", add a break on each column. It will add a summary row for each, so it will look like:
Then select the summary rows, right-click, and Delete:

Qlikview: how to create summary table to filter multiple associated tables

I have 4-5 tables of single and many rows per ID. I want to generate a summary table listing each ID along with various counts and max/mins, but I want to be able to filter on calculations. Example: "ID" is the identifier and there are two tables, TestA and TestB.
One desired selection criteria: Show only those IDs where at least one TestA score >5 and there is at least one TestB score.
In a straight table, this is simple to do with expressions, but the resulting table cannot be selected on the calculated true/false value.
I think I need to create a new table in the load script containing the ID, and then various conditions labeled as I wish. Then, these fields could be dimensions. This seems similar in concept to a master calendar. Am I on the right track?
If it helps to understand my example, this a medical application; the tables are lab results and other interventions that each require complex queries pulling data from various sources that are very "hard-coded" to produce a small data set from millions of rows of highly normalized source data. The desired dimensions would be combinations of the labs so as to allow identification of patients who meet certain criteria--then, once filtered, there would be many more graphs and charts to identify what tests and procedures were followed for that group of patients.
My current data model just loads many tables which then associate on ID. I had attempted to load all data into one big table using concatenates and calculations, but this did not seem to accomplish what I needed and was difficult to manage.
IIUC, I think what you want to do can be accomplished with a combination of sliders/input boxes, variables and calculated dimensions in your table. The process is definitely burdensome, but it should allow you filter the way you want.
Add a field to your table load statement in your script like rnum as RowNo().
Create a variable for your filter(s). Ex. vFilterTestAScore.
Add a slider or input box to your dashboard and point it to that variable.
a. For slider, the option is in the General tab -> Data header -> select the Variable radio button.
b. For input box, add the correct var from the list to the list of Displayed Variables.
Set sliders/input boxes to the criteria you want: vFilterTestAScore = 5 and vFilterTestBScore = 1
Create a straight table with ID as the dimension and expressions for TestAScore and TestBScore. The expression formulas would be sum(TestAScore) and sum(TestBScore) respectively (this won't make sense until the next step).
Now add a calculated dimension to you table. The idea here is that rather than just having the ID dimension, you will create a calculated dimension that only displays the ID of the records that meet the criteria you select in the slider or enter in the input box. The formula should be something like:
if(aggr(sum(TestA), rnum) >= vFilterTestAScore, ID, null()) or for multiple filters: if((aggr(sum(TestA), rnum) >= vFilterTestAScore) and (aggr(sum(TestB), rnum) >= vFilterTestBScore), ID, null()).
On your new calculated dimension, check the 'Suppress When Value is Null' box so only results that meet your criteria are displayed in your table.
To summarize, you are using the variables to store your selection criteria which you are entering via input box or slider. Then you are conditionally displaying only the ID's in your table that match those criteria via a calculated dimension and 'Suppress When Null' option.
I can send you a .qvw if you aren't using the free personal edition and are able to open other qvw's.

how to display parent record and children from multiple tables

I have three tables, 1 parent with 2 child table 1-to-many relationships.
table 1: People
table 2: Phone numbers (any number of records)
table 3: email adresses (any number of records)
I would like a report looking like this:
Person1:
First_Name-------Last_Name
phone1:------12345----Home
phone2:------54321----work
mail1:-------first#mail.com----work
mail2:-------first#mail.com----work
mail3:-------first#mail.com----work
Person2:
-------First_Name-------Last_Name
phone1:------12345----Home
phone2:------54321----work
mail1:-------first#mail.com----work
mail2:-------first#mail.com----work
mail3:-------first#mail.com----work
I would very much like to do this using reporting services.
Edit: I know how to link all tables with left joins, I don't have a concept as how to get this done.
OK, here's a sort of summary of how you need to approach it. I can't give you a step-by-step because it would be impossibly long, but this should get you started. (Also note that I'm doing this from memory):
You will need three datasets, one each for people, phone numbers, and email addresses. I am going to assume that the phone numbers and email addresses have some kind of ID field in common, some way to tie people to phones and to email addresses. You will need that field in your datasets.
You don't need to do any joins in your SQL: the linking between the three datasets will be done within the report.
Put a Matrix on your report. Have it draw from the People dataset. Put the first and last name in the detail row of the Matrix.
Add a new detail row to your Matrix, under your first and last name.
Merge the cells in your new detail row so that you have one very wide cell.
Embed (drag and drop) a new Matrix in the single wide cell in your new detail row.
Link your matrix to the Phones dataset. Set up a record filter in the matrix to limit the records to those that match the ID field in the parent matrix.
Set up the Phones as you want in the embedded child Matrix.
Repeat steps 3-7 with the Email Addresses dataset.
You don't actually need to do any grouping (unless you want to include subtotals of some kind), because you're not actually grouping anything: you're just displaying a list with embedded sub-lists.

ssrs multi column table data gets spanned accross columns and/or pages incorrectly

In SSRS I built a report where a providers name, address, phone are listed in 3 columns on a page Grouped by State. Example Data:
alt text http://img99.imageshack.us/img99/9062/providerlistingex.png
What I'm trying to do is prevent the data from spilling over into the next column or page. I want to just move the provider to the next column/page. Any suggestions?
It is not clear from the result how you structured your report. Each address should be in a single table cell. Then I don't think you would see addresses being broken apart.