SSRS Drop Down List Problems - sql

This questions kind of carries on top of the previous question I asked. Anyhow, I am creating this report in Report Builder 3.0. I have about 5 tables, 1 - 5. I have a drop down list that displays the table names 1-5. However, I want to regroup some of the tables together. For instance, the upgraded drop down would look something like this:
Drop Down List:
One&Two
Three&Four
Five
So If i were to click on One&Two, tables 1 and 2 would display while the others would stay hidden.
((CASE WHEN 'All' = 'All' THEN 1
WHEN #Input = 'One&Two' THEN 1
When #Input = 'One&Two' THEN 2
ELSE 0 END) = 1)
Using the above case doesn't do anything.
In my tablix properties I have the following command:
=Parameters!Input.Value <> "One&Two" AND Parameters!Input.Value <> "All"
This doesn't give me the table nor the columns, however doing this for a textbox it works. Going back to my original problem, how can I display 2 tables using only one drop down value from the list and hide the rest. I tried doing the multi select, but that didn't work out so well, because of the visibility issue.

You are referring to the hidden property evidently. Can you check and make sure you should be using label to compare?
=Parameters!Input.Label<> "One&Two" AND Parameters!Input.Label<> "All"

Related

SQL Server Report Builder - How to grey out a parameter with multiple sub-reports?

I have a main report which has three sub-reports. I am trying to grey out one of the parameter option when a certain report is selected. The reason I want to do that is because one of the sub report does not use this parameter.
Here's the code I am using now. The parameter displaying the query result is #device.
--When user select report 2, the parameter displays the device list from table2.
IF #selectReport = 2
BEGIN
SELECT DISTINCT type
FROM table2
END
--When user select report 3, the parameter displays the device list from table3.
IF #selectReport = 3
BEGIN
SELECT DISTINCT type
FROM table3
END
--When user select report 1. I want to grey out the parameter, but I could not do it.
--So I created the table contains NULL value.
--So, when the user select the report 1, the parameter will show only null value.
IF #selectReport = 1
BEGIN
SELECT DISTINCT type
FROM nullValueTable1
END
I want it to be grey out when the report 1 is selected instead of show NULL on drop down list. Any idea???
You can't grey out the parameter. Unfortunately you can't hide the parameter either as the hidden property only takes True and False. What you are doing now might be the best you can do. However, you could try looking at cascading parameters, maybe you might be able to provide a slightly more user friendly value like "None" to the dropdown.

DataGrid Column id's

Quick one chaps,
If I have a datagridview control, lets call it 'tasklist'.
When I populate it, there are 3 columns, 'id', 'tasktitle' and 'owner'.
I dont want to show the 'id' on screen so I simply do:
tasklist.Columns(0).Visible = False
Thats all good and the id column is not visible.
Does this then mean in terms of referencing the column numbers that 1 becomes 0 and 2 becomes 1?
or does the non-visable 'id' column retain the 0 id and 1 and 2 also stay the same?
Thanks!
This is not answer to question - just "better practice" for not using indexes(hard-coding).
Create predefined columns through designer.
Give a name for every column(for example: task_id, task_title and task_owner)
Then through designer you can set Visible property task_id.Visible = false(or in code)
Then in code(Load event) add mydatagridview.AutoGenerateColumns = false - this will prevent datagridview generate columns
After this you can use your column without doubt about indexes
mydatagridview.Rows(0).Cells(task_owner.Name).Value = 'testowner'

How to assign one same label for multiple value in non-queried available values in ssrs 2005 report?

Parameters - Multiple Values For One Label - Possible?
Sorry my modified Question.....
I have question to ask,...
Is it possible to have multiple values for ONE label in non-queried available values in SSRS 2005? i want to join fields value in a single row like,
Works: (But this bring a long list in drop down menu - which i donot want)
Label Value
---------------------------
Site-1 150
Site-1 151
Site-2 152
Site-2 153
Required result (Which i want - in one line)
Label Value
---------------------------
Site-1 150,151
Site-2 152,153
(which will bring one label and related multi-value in drop down or combo box.
But the problem is that ColumnName IN (#Site) does not work with multi-value.)
More description of the problem:
Let say, I have a field/column
Name = Site
Value = C150,C151, C152, C153
I want drop down menu on report with
C150,C151(as Site-1) & C152,C153(as Site-2)
So I created parameter i.e. #getSite and set values as
multi-value in the report as
Label Value
---------------------------------------------
Site-1 (150,151)
Site-2 (152,153)
And set my parameter as #getSite:= Parameters!#getSite.Value
And Query i wrote as,
SELECT * FROM ..
WHERE Site IN (#getDisease)
But after all these, my report result is empty,literally no result.
It seems like if i select only one value as Site-1 = 150, then it works
but not two or more values in one line,
why it is not possible?? if yes then how?
Please help!!!
Yes just Right Click on your parameter in your Report Data window under Parameters folder and select the check box for allow multiple values as follows
this is what I said before you need to put your column name inside a set of paranthesis something like this
SELECT * FROM ..
WHERE (Site IN (#getDisease))
I have been working on this problem for a while and I think I have finally figured it out...
Basically you need to use a backwards case statement in your SELECT statement, put that in a derived query and then reference it in the outer WHERE clause..
SQL:
SELECT * FROM
(
SELECT
Label
, value
, CASE WHEN [value] IN (150,151) THEN 'site-1' WHEN [value] IN (152,153) THEN 'site-2' END AS [grouped_values]
)
WHERE grouped_values IN (#getSite);
*Note: This answer only works on values that are mutually exclusive, if both sets had the same value included then it would be problematic..
--
Hopefully this can put you in the right direction. I am finding a lot of the reporting services tricks require reverse engineering or at least some reverse thinking.
cheers,
Michael

vb.net microsoft reportviewer - I need help to make a table fit in one page

How can I fill the page with empty table rows? For example; I have 2 records in the dataset but I want to the page with empty rows (draw the table borders until the end of page)
I have;
I want;
Are you getting your report data from a database? If so you might look at returning empty rows from your database call.
If you can describe your data source and query that you are using for this report, we might be able to suggest changes to the query to return blank rows.
UPDATE:
OK, Based on how you describe the data you are getting, perhaps you can change your database call to do something like this:
select * from Subeler where Subeler.FirmaId = 10
UNION ALL
select TOP 5 ' ' from Subeler where 1 = 1
That will give you your original data, plus 5 "blank" rows to help pad your report. Of course you would have to make sure the second query has the same number and type of columns as your first, but hopefully this will point you in the right direction.

How to make a drop down list (list box)in an MS Acess Query with values from two different tables

I need the drop down box above to display the date as shown and the ClassTypeDesc as you can see above the dropdown list shows 1/12/2010 twice. They have different ClassTypes Assigned to them.
The drop down list should show:
1/12/2010 ACLS-I Day One AM
1/12/2010 ACLS-I Day One PM
I need to know the statement to put in the Row Source Box on the lookup tab in the Field Properties to make this work.
Related Question on Making a drop down list
There's no need to concatenate the two columns. Based on the diagram, the SQL for your lookup combo box should look like this:
SELECT tblClassSession.SessionID, tblClassSession.Date, tblSessionType.ClassTypeDesc
FROM tblClassSession INNER JOIN tblSessionType
ON tblClassSession.SessionTypeID = tblSessionType.SessionTypeID;
Then in the properties for your lookup combo box, change ColumnCount to 3, and Column Widths to 0 (if you want to size the other columns, change Column Width sto something like 0";.75";1.5", and the List Width property to 2.25").
I may have gotten some of the field names wrong, but that's the basic idea.
(also, you probably really ought to rename tblClassSession.Date to tblClassSession.SessionDate so you don't run into problems with the fact that Date is a reserved word)
As you already have the right number of rows, you just need to concatenate enough fields to make it more useful, so your query would be something like:
SELECT c.Date + ' ' + s.ClassTypeDesc AS YourFieldName
FROM...