I have been asked to replicate a legacy Crystal Report using SSRS.
I have all the component data in SQL [SSMS].
The problem I have is that the Subtotals Rows have columns that do not match the columns in the Detail that the totals are derived from.
The Page Header is directly associated with the Subtotals ... but the columns in the Header/SubTotals do not match the columns in the Detail for each Group.
For example:
Patient's Preferred Language
Spanish EngLish Unspec Total
Clinic Name - Department Name.
ID1. Name1 Spanish
ID2. Name2. English
....
10 15 5 30
33.3. 50.0 16.6
In the above, very abbreviated example, the top two rows represent the Page Header. The next three rows are the Patient Detail rows - with a Header for each Clinic-Department Group.
The numbers in the final two rows correlate to the Spanish, English, Unspec & Total in the Page Header and are the Counts - and the % below the Counts.
In reality, there are 4 sets of Headers - each with 4 sub-categories ... and the Detail section has a couple more fields for each Patient [Eg. Address, Phone, Primary Care Physician ...].
I have the Detail Data as one SQL Output and the Totals/% as a separate SQL Output.
The two different Outputs are tied together by a concatenated key [Clinic Name, Department Name, Provider Name] which exists in both the SQL Outputs.
My question:
Can I display the Data in SSRS so that it looks like the data shown in my example? I want the Detail Rows to appear between the Header and the Sub Totals.
Is this possible?
I am thinking of the Headers & the associated Totals being the Main Report - and the Detail being a Sub Report - but I don't know if it is possible to put a sub report between the Header and Totals of the main report.
I'd appreciate any pointers/suggestions.
Related
Need one help. Suppose:
I have one query which gives 3 rows as output once user submits form.
On the same table 3 rows are generated as owner_details, shipment_details and contact_details. Here I have one foreign key which is same for 3 rows and one unique primary key.
Now I want to print all these 3 rows on Jasper with different owner_details, shipment_details and contact_details.
If you want to use three different section, one for every kind of details, you can design as follow your report.
Create a main report to get your main object (with three rows), so you can define 3 details bands with three different subreports, one for kind of detail.
In every subreport you can pass your collection and in the body of subreport you can discard the rows you don't want to print. So you'll have a report with three different sections and in every section one row. Right?
EDIT
To conditionate your row in detail you can do as follow (sorry but I've italian version, so the name can be different).
Select detail band as follow:
In the property tab you have a field with your print condition, as follow:
Click on 3 points and write your truly condition.
For example, if you have a field category with value ship_detail and you want to show only ship details, you can write as follow:
$F{category} != null && $F{category} == "ship_detail"
Hi for my ssrs Report I require to have three different sections on my report.
And I would like to split the data in the report based on some conditions.
For example
Report will contain three sections:
Section A- to display attendee
Section b - to display staff
Section c - to display guest speakers
In my data I have a list of event attendees with the names and definition if they are speaker or attendee or staff under one column.
How could I in ssrs use conditions to display where the names will be displayed. So that they get displayed in the right section. So that attendees get displayed in section a , staff get displayed under section b and so on and so on.
Thanks
Create 3 tablixes, one for each section you want to display. Use the same dataset for all three tablixes. In the tablix properties, add a filter to only show the matches for that tablix.
One positive of this approach is that SSRS will only retrieve the dataset once, and will re-use the same data cache for all the tablixes.
I want to create a rdlc report using Microsoft Report Designer. Due to complexity of my data (the given below is just an example) I do not use View on Database side. So, I have to use seperate tables (data sources) for my report design. Now, as it can be seen the example below I have one report page and I want to show PERSONAL, FAMILY and JOB INFO for each person.
There are Textboxes on PERSONAL INFO section. The data is come from table_Personal,
There are a Table on FAMILY INFO section. The data is come from Table_Famiy,
There are a Table on JOB INFO section. The data is come from Table_Job
and all the three tables contain Person_Id column.
PERSONAL INFO
Name : Christof
Surname : Robin
Age : 45
FAMILY INFO
No----- Name----- Age----- Birt Place
1------ Sarah----- 12------ London
2------ Albert----- 16------ Manchester
3------ David----- 23------ NY
JOB INFO
No------ Company----- Start Year
1------- Xyz----------- 2005
2------- T Mobile------- 1999
3------- Day Inn------- 1993
My question is;
1) I do not want to use Subreport and do not combine these tables in db side by using view (I have searchhed, but for 3 or more tables it is impossible I think).
So, is it possible to create a master-detail report like above by grouping items (table, list, etc.) and without using subreport on rdlc? If so, could you explain a little bit please?
2) I have tried to create such a kind of report like that; I use a List and inserted all the textboxes and three tables above
to this list. I assign all the three tables as Report Data Sources. I make List.DataSetName = Table_Personal and List.Grouping settings
select Group on : Person_Id and some other combination. But, unfortunately I have not managed to create such a kind of report group like above.
Could you help me please by giving some advice and if you have some sample rdlc page source please? ...Shohel
Yes it is possible but I'd done it like 6 months ago, so I don't have any sample code right now.
I have done a lot of similar cases. One such case is there are a list of students and each student has a list of marks, a list of achievements, etc.
If I remember correctly I used one storedprocedure to get all the details of all the students. One dataset. And put 'em all in one tablix and grouped 'em.
The sub-lists (like the list of marks) are separate tablixes themselves and are inserted in textboxes of the main tablix.
Hope it helps! :)
I have a SQL Server Reporting Services report that shows customer order data, but it's grouped as follows:
Store
Customer
Customer Order Items
So, each report is a grouping of stores, with a subgroup of customers per store, and then the items per customer. I'm trying to show aggregate sale and other information at each header record of the appropriate group in the report. Most of this is working well, but for each store header record, I want to show a count of the customers. I'm trying to use some variation and\or combination of RowCount, CountDistinct and other aggregate functions, but to no avail.
Can anyone help me determine how I essentially can get a "count" of customer groups to show at the Store level header? TIA!
CountDistinct on Customer should work fine - no need to specify scope if it's in the Store group header row.
I put a simple test together.
Data:
Report in designer:
Most important thing to note is the CountDistinct on Customer in the Store header row; this is just the expression used:
=CountDistinct(Fields!customer.Value)
End result, showing correct values:
Please let me know if I'm missing something.
Edit after comment:
Apologies in advance for how long this is getting.
The previous report did have row groups for Store and Customer, but I've modified this to make it more clear, hopefully. Still based on the same DataSet:
You can see there are three row groups, and each row in the report is actually a group header row belonging to one of those groups.
In the Store group header row I've kept that same CountDistinct expression. I've also added a CountRows() expression to show how many actual rows are available in each of the different groups.
Here you can see for Store1, CountRows is returning 4, i.e. there are four rows that we are aggregating in this scope, which is what we expect looking at the DataSet.
Similarly, when we apply =CountDistinct(Fields!customer.Value) in the Store scope we are considering these same 4 rows, and we see two distinct customers for Store1, which seems correct to me.
For Store2 we are considering 6 rows in total, which have three distinct customers. Again, just by applying =CountDistinct(Fields!customer.Value) we get correct value.
Hopefully this rejigged report helps clear things up. If I'm still not getting your requirements, can you please explain what numbers are wrong in my sample report based on my sample DataSet? That way I can adjust things easily on my side.
Maybe the question title is a little confusing, so I'll try to clarify things
In a report I receive a dataset with a datatable which contain records to be shown. I cannot change that (it's not under my control).
The records have a field, RetirementDate, which can be filled or null. Based on this, the records must be shown on two distinct tables on the same report.
Both reports have the same grouping (two groups, on Department an Category, and Category is included inside department).
So reports should looks like this
Table 1 - Non retired (RetirementDate is null)
Department 1
Categ 1
Details ....
....
Categ n
Details ....
Department 2
Categ 1
Details ....
....
Categ n
Details ....
Table 2 - Retired (RetirementDate is not null)
Department 1
Categ 1
Details ....
....
Categ n
Details ....
Department 2
Categ 1
Details ....
....
Categ n
Details ....
What I was tried was to set Filter for table 1 Trim(RetiredDate&"")="" and for table 2 Trim(RetiredDate&"")!=""
But that didn't worked. Table 1 wasn't even shown (even if 90% of records have RetiredDate=null), it just show grand total band, and most records were shown in table 2.
Obvious I missunderstand how Filter on table works
I managed to temporary sort of workaround by setting condition above on Hidden prop on details band of each table, and it kinda worked (except it shows me Department Header / categ header for all dept / categs combinations, no matter they have or no details records - which, obvious, is not good).
Can anyone tell how can I accomplish what I needed? I thought Filter on table should work, but obvious it didn't the way I thought of.
I'm using SSRS 2005, and actually the report is used in offline mode, where the dataset is "pushed" in report before opening by client app and report is loaded in web-based viewer. That's why I cannot change what data I get.
Thank you
You have the right approach. Try using the IsNothing function. In 2008, you can apply a filter to a table. I think there is similar functionality in 2005. If it is like 2008, where you can set multiple formulas (versus the one formula in visibility) then I usually set both formulas to return a string and compare those. So the first formula would be
=IIF(IsNothing(Fields!RetiredDate.value), "Show", "Hide")
Then the second would be ="Show" and I would require that they match.
To debug something like this, you can add the formulas (temporarily) as fields in your table. This will let you see if things are evaluating as you'd expect.
Actually I made it finally by creating a new group, outermost, on IsNothing(RetirementDate), and gathered all data on the same, single table