I created a report (via Report Builder 3.0), which I set to Group on specific Column.
When Exporting to Excel, I set up the report to have each Group on different Sheet, with the name of each Sheet matching the value of the Group.
My question is - how do I exclude the Grouped column from being added as a column on the Excel sheets.
I obviously need to still have the same functionality, but don't need the actual column to show up.
Any ideas?
You can do it with parameters.
Create a Dataset
SELECT "0" AS Value, "View" as Label
union all
SELECT "1" AS Value, "Print" as Label
then in "Column Visibility..."
Click "Show or Hide based on an Expression"
Then create an expression to utilise the parameter values.
In Code
Select the header of the column you want to hide, right-click and select "Column Visibility…". In the dialog that pops up, select “Show or hide based on an expression”.
Enter this as an expression:
=Iif(Globals!RenderFormat.Name = "EXCEL", True, False)
Related
I am building a summary report which looks at users that are marked in a database as having a common trait i.e return all users by name in the last 5 years whose contract contains an end date.
This generates a figure e.g. [250]
I drill through on that figure to give a list report of names, first name and surname.
I have ordered the list A-Z
I would like to add a row of 26 letters at the top of the report and have each letter return only the names with the corresponding starting letter.
Would this need to be a further drill through or is it possible to refresh the existing list based on a user-driven selection?
Just add a custom parameter to your report. Right click on Parameters and Add Parameter.
(and so on...). Default value should be All then.
Then simply add the following filter to your tablix:
'Expression:
=Switch(Parameters!YourParameterName.Value = "All", True, Parameters!YourParameterName = Left(Fields!YourNameField.Value, 1), True)
If you are just using SSRS as it comes, then you can't refresh report content without running the report again, so you would either
re-organise your current report.
need another drill through report.
Depending on your layout you could group the data by the first letter and then have an collapsible row group to show/hide that group of names. To do this simply add a parent row group, set the value, group value and sort value all to =LEFT(Fields!myNameField.Value). Next set the visibility of the details row group to hidden and set the toggle visibility property to point to the cell that contains the letter from the parent group you just created.
If you have too much data to make this efficient the you might have to go down the additional subreport route.
To make life a bit easier, and to save you having to create 26 links and parameter values, I would do the following...
Create a table that stores the list of letters
Add a matrix to your report, that has a column group grouped on the letter value from this table. This will act as your 'filter bar'
Set action on the matrix cell to "go to report", point to the final drill thru report and pass the [myLetterColumn] value as the parameter.
There's no need to set available parameters assuming this sub-report will be hidden and only called from the parent report.
I am trying to hide a tablix if a user entry text parameter (with no specified available values) does not match column values found in a column. I want to hide the tablix if it matches and show the tablix if it doesn't match any column values.
In the tablix properties I'm trying to 'Show or hide based on an expression' with the expression:
=iif(Parameters!IDNumberEntry.Value = Fields!IDNumber.Value,True,False)
and its not working. It just shows it no matter if the ID entered in the text box parameter matches values in the IDNumber column or not.
Any ideas?
I figured it out. In the'Show or hide based on an expression', I used lookup to see if an ID entered in a parameter matches the ID value in a the column.
=iif(lookup(Parameters!IDNumberEntry.Value,Fields!IDNumber.Value,Fields!IDNumber.Value,"DataSet1")="",False,true)
I have a expression inside a tablix for one of my report column Cases Shipped like this
=IIF(Fields!Current_Product.Value= "Match"," ",Sum(Fields!Cases_Shipped.Value))
This add the cases shipped value of same ditributor item code.
After this statement i want to apply a filter on this column on the report .there is a textbox parameter in which a user enter the number like 10 and the column on report get filtered through this value.
How can i do this??
Sounds like you are looking to change the Column Group visibility. (You are using column groups, right?) If so, right click on a column group and you can set the visibility by formula. The formula can incorporate a Parameter.
=IIF(sum(Fields!Cases_Shipped.Value ) >= Parameters!CasesShipped.Value and (Fields!Stocked.Value = "" OR Fields!Stocked.Value = "Yes" OR Fields!Stocked.Value = "No"), false, true)
I did the following in MS Access: I made a form which had a combo box and a button. You select an option from there and click on the button and it is supposed to open a report. Now, I wrote a query selecting a few fields from a table and in the where clause, gave the condition as where name=str(combo1.value) and the report source was specified as this query. Now, when I select the value and click on the button, it opens a blank report. How can I make it load only those particular values?
I am not saving the combo box value anywhere. It said that it would remember the value for later use. Am I doing the right thing by not saving it? What should I do to make this work? Please help me!
Edit: The combo box is using values from a column 1 in a table X. I've not bound the value to any field and am using the "Remember the value for later use" option provided. The combo box is essentially a list of hotels and the report is a list of people staying at the selected hotel. When I put the ID of the field (as defined in the X), it works. But the thing is, it should refer to the names of the hotels and not the ID, which I am supposed to enter in a popup that asks for it. What do I do?
Edit 2: The query is as follows:
SELECT Table_1.Hotel_Name, Table_2.Name_of_Delegate, Table_2.Address, Table_2.City, Table_2.Center, Table_2.Spouse_Present, Table_2.No_of_Children, Table_2.No_of_Guests, Table_2.No_of_Rooms
FROM Table_1 INNER JOIN Table_2 ON Table_1.ID=Table_2.Hotel_of_Residence
WHERE Table_1.Hotel_Name=FormName.Combo7.Text;
When I click on the button (which opens the report), it asks for the name of the hotel in a popup box. How can I avoid this? What I am doing wrong?
You can use a WhereCondition with the DoCmd.OpenReport Method as a "dynamic WHERE clause" for your report's record source. Use something like this in the click event of the command button which opens your report.
DoCmd.OpenReport "YourReport", , , "[name]=" & Me.combo1
Remove the WHERE clause you added, where name=str(combo1.value), from the report's query.
I surrounded name with square brackets because name is a reserved word. See Problem names and reserved words in Access
Edit: In a comment, you said this about the combo box:
"Row Source is SELECT [Table_Name].[ID], [Table_Name].[Name] FROM [Table_Name];. Bound Column is 1 (which I assume shows the names I wish to be displayed in the combobox.)"
When you refer to the value of a combo box, that value is the value of the "Bound Column". So in your case, the bound column is 1, which means the combo value will be [Table_Name].[ID]. However, you want to open your report based on the [Name] column of the combo. So change the bound column of the combo from 1 to 2.
To open a report using the value of your combobox, in your report query you need to do the following:
SELECT fields
FROM table
WHERE YourValue = [Form]![FormName]![ComboBox Value]
You have to specify the name of the Form, plus the value so the report query knows the value. Hope this helps.
I have a drill through link on the value cell of a matrix to show a detailed report. However when I run the report, users are able to drill through using the sub total of this value. How do I disable the click through navigation for the subtotal only.
Using the “Jump to report” expression (on the Navigation tab, in properties of the cell), return False when in the subtotal.
For example assume one row group and one column group called matrix1_Row1 and matrix1_Col1 respectively and “ReportName” is the name of the report we want to drill to.
Use the inscope function to check that you are not in a subtotal. i.e if both Row1 and Col1 are inscope then this cant be a subtotal.
=iif(inscope("matrix1_Row1") AND inscope("matrix1_Col1"),"ReportName",false)