Show or hide tablix based on parameter - ssrs-2008

The scenario is that there should be a dropdown parameter to select table name and when the user clicks on View report, he should see the data from that particular table.
Both the tables have different columns.
I tried creating different datasets for both tables and created two tablix and bound them to their respective datasets and put a condition for show/hide tablix based on expression.
But still I get error that the column(from other table) does not exist when a select a table.
I am new to SSRS, any help would be highly appreciated.

Add a parameter to your report (TablixChosePara). With your different options:
=1 'Tablix1
=2 'Tablix2
Then add two tablixes to your report with two different columns or datasets. Then go to tablix properties and write the following expresson under 'Show or hide tablix based on expression'
=IIF(Parameters!TablixChosePara.Value = 1, True, False)
And fot the second tablix l:
=IIF(Parameters!TablixChosePara.Value = 2, True, False)

Related

SSRS report need to show n-time based on dataset rows

I have designed two pages and each page have different table.Currently my dataset return only one user details.So i have bind all details in table.
Requirement
In case data set return two user details ,need to print two user details.First two pages for first user and second two page for second user.
Is this possible in SSRS report? If yes please guide me.
As you already have a report working for a single user then I would normally do this with subreports.
Asumming your current report accepts a userid or similar as a parameter....
Create a new new report.
Add a dataset that returns a list of users that you want to produce the report for
Add a table and set its dataset property to the name of the dataset you just created.
You can remove the header row and all columns except one from the table
In the remaining cell, right-click and choose "insert Subreport"
Right-click the subreport placeholder and choose properties
Choose your original report as the subreport
Click the parameters tab and choose the subreport property name on the left side, choose the field from your dataset that contains the userid (or whatever value you pass as a parameter) on the right side.
That's pretty much it, when you run the new report, it will produce 1 row per user, in each row it will run your subreport.
You will need to use a matrix, specifically row groups, grouping by using user details, and possible inserting a page break between each instance. This should get you going in the right direction.

Details rows inside tablix SSRS Reporting service, Records with Details rows under it

Now it is a report with a tablix in which the records are like every row has some details rows under it. and the details row can have one or more records based on the main tablix rows
To elucidate the problem, plz have a look
Did some search here and there, but not able to figure out how to accomplish this.
Sub-reports inside the tablix cell, but how will it keep the track of the current row
One thing more : Do I need to create two separate datasets for this and bind accordingly or write query as a single dataset and do some grouping ?
any ideas !
P.S: SSRS r2 environment, native mode reports for web application
You can achieve this with one Dataset and one Tablix.
The Dataset will have all the columns in the report, with multiple rows for each BIL value.
The Tablix will have four rows and one group based on BIL.
The first row will be the Tablix header row, with the main column header details.
The next two rows will be group header rows. The first row will contain the group details, BIL, No Bayar, etc. The second row will contain the detail row header details.
The last row will be the detail row which will contain the COL1 and COL2 detail values.
You will see something like this (you'll need to fill in the TextBox details as appropriate):
create report with subreport will solve your problem
you can create one report with one dataset with (BIL NoB NoW Est TotalXYZ) columns.
Now link that subreport with the BIL
Now link subreport with main report the BIL (FK)
Hope this help

Hide a column in cross-tab depending on the value of parameter (Crystal Reports XI)

I'm using Crystal Reports XI (R2) and have a cross-tab which displays information about flights. There is the 'Total' column' as well as the Arrivals and Departures columns which are created automatically thanks to the grouping condition. What I'm trying to do is to have the 'flight directions' parameter, where the user can select 'All, departures only or arrivals only' values and according to this selection the cross-tab would have one or two columns. How can this be achieved? I tried using the following formula(and have the suppress empty columns option enabled) :
if {?Pm-#flight_direction_description} = "Departures Only"
then
if ({Command_1.IsArrival} = 1)
then 0
else {Command_1.IsArrival}
which indeed works (only one column is displayed) but then under the Departures column it lists all the flights (so the departures column is the same as the Total column) whereas it should only display information about departing flights.
I've had similar situations come up; while certainly not ideal, and if no one has any better suggestions, you could create Detail A, Detail B and Detail C sections, all of them suppressed. From there...
You could put your "All" crosstab in Detail A
Create a second crosstab for Destinations only, and put that in Detail B
Create a third crosstab for Arrivals only, and put that in Detail C
Then, in your Detail A, B and C sections, you can condtionally unsuppress the section you want based on the parameter passed in.

Is it possible to create a row that spans all columns of a Matrix in SSRS 2008?

Is it possible to have add a row to an SSRS 2008 Matrix that spans all of the matrix's columns?
This crude diagram shows roughly what I'm looking for:
The basic idea is that each line item is a person, and each column is a field in a form for that person. The fields themselves are dynamic (and implemented as column groups on the matrix). Additional column groups are included to append non-dynamic form fields, like the time the record was entered and who entered it. Under each person's record is a comments field, which should span all of the form fields above it.
At the moment I have the matrix embedded in another tablix, with the name and fields in the matrix and the comments in the parent tablix. This works for the data (each instance of the matrix ends up being one row), but the header repeats too often (once per person) because it's attached to the matrix. The only thought I have as to how to fix this is to create another matrix in the parent tablix with the same grouping and use it to display the headers... But this will require quite a lot of manual synchronization to keep the two matrices the same.
Edit: The key problem here is making the second row span multiple column groups.
Here's what you can do:
Select the column grouping you want to add above and right click and select
Add Group... Parent Group...
Group the column by something that will not aggregate the data. You'll have to select a field from your dataset to group by so that it creates an overlapping column grouping.
Check the Add group header box
You should now see something similar to this:
Now you just need to move the Value1 field and it's header over under the new column to the right beyond the matrix dividers. Once that's done, simply delete the ungrouped column where you just copied Value1 from and be sure to select Delete columns only checkbox.
Your finished product should look like this:
It is possible - And the above answers are partial answers leaving out one key step: Merging the cells of the child row.
First, right click on your grouped row, then select Insert Row -> Inside Group - Below and you will get two rows with the cells aligning on the columns
Second, ctrl click all the cells in your new row (ie row without the data) then right click on one of the highlighted cells, and then select Merge Cells.
Now you have the table you like. To add a value to the new row: first right click your new (multi column) cell,select Create Placeholder, and then add the dataset item you desire to the placeholder.
[Edit]
After several attempts, I'm going to say this isn't possible in SSRS. The best I could come up with is a group footer that spans columns 1,2, and 3, but not the User column.
[Original Response]
I recently did something similar to this.
First, what tool are you using to create SSRS reports? (I used SQL Server Business Intelligence Development Studio)
You'll want to create a row group (grouped on Person)
Append a row to your table in "Design" view (Right click, "Insert Row --> Inside Group - Below").
Add an expression to the row that pulls the value for your "Comment" column (=Fields!Comment.Value).
Let me know if that helps...
Try adding in you column group "header" with a grouping expression of (1=1). Then a detail field will need to be defined. If you define the other group with correct data then the "header" will stretch across all details columns. You may need to merger depending on other options.
The easiest way to do this is to create a Tablix with only one column, and your row grouping.
Then, you create two rows inside this group.
In the first row inside the group, you insert a Matrix, wich you can then subgroup as you prefer.
I just had a similar problem, and this was my solution.
I banged my head against the wall for a lot of time, until i realized the solution to my problem wasn't "making a cell span multiple column groups", but "making a cell split into multiple column groups".
You can accomplish the goal by using a subreport for each person. The subreport will receive the employee id and create the hierarchy for you. Make sure your subreport column widths match the widths of the parent report.

Hide row in Crystal Reports Crosstab

Is it possible to hide a row in a crystal reports crosstab?
I have two rows that are only used to calculate a third row and I would like to hide them so only the result is visible to the user.
I have similar problem. I want to display only rows that have specific values and ignore all others.
Here was my solution:
Open Cross-Tab Expert. In Cross-Tab under Rows select your row which should be conditional suppressed. Then select Group Options. This will open Cross-Tab Group Options dialog. Go to Specified Order and add filter. In this case, rows that match your criteria will be displayed in your cross-table all other rows will be placed in one row "Others". Then select tab Others and check Discard all others.
Not directly. I recommend grouping by a custom formula.
For example, let's say you have a crosstab that is grouped by StoreName. StoreName has values groups "A", "B", and "C". You want to combine "B" and "C".
Make a new formula field. Call it StoreName_Combined. In your new formula, enter:
If {StoreName}="B" or {StoreName}="C" then "B+C" else {StoreName}
In your crosstab, use StoreName_Combined instead of StoreName.
Edit
If you look around a little, you may also think about using Cross-Tab Expert->Group Options->Options->Use a Formula as a Group Name, but I couldn't get it to work. The rows stay separate, they just have the same name, which doesn't really help.