I am new here and was wondering if anyone can help me. I am fairly new with SSRS and want to know if the following can be implemented in SSRS.
I have a Main Report that results a table from a stored procedure. The table results the following columns:
consumed item id
consumed item location
consumption date
produced item id
produced item location
quantity consumed
Is there a way after running the initial report, a user can pick and use one of the "produced item id" and "produced item location" result and run it through another report/sub-report?
Related
My quality engineers have asked me to create a report based on a document that they fill out manually. At first glance, it appeared to be an easy enough request. It has been anything but easy. This report shows the results of two inspections and I have a parameter where the user selects one inspection or the other. As it stands now, this report runs just fine when selecting one inspection, but I am anticipating a request to be able to run the reports for both inspections at the same time. And, that's where I run into trouble.
The problem is that I have a text box in the header that is referencing a value from a table in the report that identifies the inspection. When I set the parameter to a multi-value parameter and select all, the report only displays one of the inspections across the entire report. Is it possible to have the user select both inspections but have the report run them separately? I have one dataset for the table and a column in that table that identifies the inspection. I have tried the multi-value parameter and I have tried using the filter option in the dataset properties, but I get the same result.
The easiest way to do this might be to create a new master report and use your current report as a sub-report. It's fairly simple.
Here's the basic steps...
Make a copy of your current report and rename it (say sub_InspectionReport)
Change this report so the the inspection parameter is NOT multi-valued
Create a new report and add your parameter(s) the same as you setup for your original report, This time make sure your Inspection parameter (e.g. pInspection) IS multi-valued.
Create a dataset (dsInspectionIDs) that returns a list of the selected inspection values from the pInspection parameter. The query could be something simple like
SELECT InspectionID FROM myInspectionTable WHERE InpectionID IN (#pInspection)
Note: #pInspection is the name of your report parameter, it is case sensitive.
Now add a table to the report and, as a simple, test, se the dataset of the table to your daatset dsInspectionIDs. Set the first column to show the only available field (in this example InspectionID).
Run the report and test the output using different inspection parameter selections. The table should match what you have selected...
We're almost there...
Now in one of the table cells (but not in the header) , right-click and select "Insert / Subreport". Now right-click the sub-report placeholder and set the sub report to be the copy of the original report we made at the start (sub_InspectionReport in this example). Now, still in the sub-report properties, go to the parameters tab and set the Inspection parameter to the the InspectionID field.
Now when you run the report, you will get your sub-report run once for each selected parameter value with that parameter passed to the sub-report.
Hope that makes sense, I'm not near my PC so I can't provide a sample with images at the moment.
Friends,
I have created two datasets using two different stored procedures for a SSRS report, one fetches "summary" records when the stored procedure executes and other dataset fetches "detail" records.
The report has 4 parameters #beginDate, #endDate, #renewalDate, #level. When the user populates all the parameter #level, they get to select "summary" or "detail" from a drop down.
In the report body I have created two different tables one for summary records and one for details records (cannot do drill through or sub reports) to hold the dataset values
Based on the parameter #level = "summary" or "detail", how can I execute the correct stored procedure for the dataset ?
I think I found the answer after searching more...I this could be done by clicking the
Select the table or matrix report item, right-click, and then select Tablix Properties.
In the Tablix Properties dialog box, click the "Visibility" pane.
Change the display options by first changing the When The Report Is Initially Run option to Show Or Hide Based On An Expression.
=IIF(Parameters!pLevel.Value = "Summary",false,true)
=IIF(Parameters!pLevel.Value = "Detail",false,true)
More answers are welcome. Thanks!!
I have the following format in my dataset (see Dataset Layout screenshot).
I need this report to show like the following (see Report Layout screenshot) with a bit of a difference, but first let me explain.
This report is a "monthly" report that shows the data for each day of a given month. What I have shown in the Report Layout screen shot is how the report displays if the user only selects one available value for column "Level!2!Sample". So in other words, instead of seeing multiple values in that column as shown in the screen print, it would only contain one distinct value. This report works when only one item is available, but I need to allow for multiple options.
What I need to do is be able to display data like this for multiple values of "Level!2!Sample", and each time a new "Level!2!Sample" is encountered, it would create a new matrix as shown in the screen print. So if there are four distinct items for this column, I would have four different tables shown on the report, each displaying the data for the given distinct value of the "Level!2!Sample" column.
I assume I would need to use an "Order By" clause to get my data looking correctly:
Order By
Level!2!Sample,
name!3!Title,
month!4!ReportMonth
But I am not sure how to get SSRS to create a new matrix when the new level!2!sample record is encountered.
I hope my explanation makes sense as to what I am trying to do. Any help is greatly appreciated.
You can't create a new matrix like that but there are other options.
Simple option: Create one big matrix grouped by Level!2!Sample and have page break between groups. This would obviously mean you would end up with 4 pages in your sample scenario which may not be ideal.
Slightly less simple option:
Create a new report
Include your parameter as you did for the current report.
Add a dataset (let's call it dsLoop) that returns a single column and 1 record per selected parameter entry. This might look something like SELECT DISTINCT Level!2!Sample FROM myTable WHERE Level!2!Sample IN(#myParameter).
Add a table with a single column and a single row and set it's width to the width of your report/page.
Set the dataset for the table to be dsLoop
In the table's cell insert a subreport and set the subreport properties to point to your original report
Set the subreport parameter to Level!2!Sample from your dataset.
Notes:
a. You can get rid of the available values and related datasets from your original report as these are no longer needed (optional)
b. You can add rows before or after the cell with the subreport if you want to add gaps between each tablix.
Basically your new report acts as a loop and creates one row per selected item in the parameter list, each row contains an entire subreport with the parameter for the current row passed to it.
The net result is that you will get a 'new' table for each selected entry.
Hope that makes sense.
Scenario:
I have a report that pulls up stats for agents for a certain date range (usually the same day, yesterday) which I've set as parameters. I've built the report in Visual Studio Report builder and the report works great.
Challenge:
Some agents are taken off calls and work on emails instead that day. So, though they are logged in, they can't be added to the call queue stats.
Need:
I need to add parameters which can select agents from the drop down (Ctrl+select) and have the report run where employeeID NOT IN the ones that were selected. Then I need to add those parameters in the report builder to show as a drop-down so the user can ctrl+select the agents to exclude.
Question:
I know how to create 1 parameter to exclude 1 agent. How do I create parameter(s) to exclude more than 1 agent? Sometimes, it can be 0 agents, sometimes they are 10.
I'm using MS SQL Server 2014.
You need to add a parameter to your dataset query e.g.
Assuming some very simple tables for illustration with AgentID being a unique key of Agents.
SELECT {your list of columns} FROM AgentCalls
WHERE
(AgentID NOT IN (#myParamName) OR ISNULL(AgentID,'')='')
This will show all Agents if nothing is selected or it will exclude agents if any are selected.
You then need to populate the list of available items for your parameter, in this case it will be a list of Agents.
So create another dataset called, say dsAgents
With a query something like
SELECT AgentID, AgentName FROM Agents ORDER BY AgentName
In the parameter settings, make the parameter multi-value and also allow blank & null, in available values, choose dsAgents as the query, use the AgentID field as the Value and the AgentName field as the Label.
SSRS will automatically convert the list of selected parameter values into a comma separated list and use in the IN clause, there is nothing more you need to do.
P.S. this is from memory at 1am so it might not be spot on but it should be good enough to follow.
Note: there is no need to hold control the parameter list will show checkboxes.
Try the below code:
SELECT {your list of columns} FROM AgentCalls
WHERE
(AgentID NOT IN (#myParamName) OR #myParamName is ISNULL)
I have a master report that has no parameters. But I have to include a sub-report with the same grouping as the master report. (i.e, the same report has to show data for the same project listed in the master report) I'm using different Datasets for both reports but the tables come from the same database. I've tried including a parameter into the subreport and pass the current projectID into the parameter of the subreport. It doesn't seem to be possible.
Is it possible to pass field values in master report as parameters in subreports?
I'm a bit curious on your "it doesn't seem to be possible" because I'm currently working on master report and subreport as well. The answer for your short question is "YES". it is absolutely possible to pass value from master report to subreport.
So Can you please check them again whether their properties are correct or not?
For example.
Your subreport's parameters are created properly?
You can try put your subreport inside detail row of your master report.
When you set properties of subreport, you can set which field of master report you want to be a parameter for subreport. it's quite straightforward.
Hope this help.
PS. sorry for my poor english.
Absolutely yes.
Put a dataset in your main report that will go through your projects as you want it. Then put a LIST, that's the key point. The list should refer to this dataset.
Now put your dataset inside the list's container area and set it's parameter to the project ID of your main report's dataset.
Easy.
This is just clarification of what the previous people said:
NOTE: In this example T9_PK is the primary key for Table 9 (i.e. the employee table)
The purpose here is to create a subreport that is the 'Time Card' for each employee, and then create a Main report that has all the employee Time Cards, each on a new page.
Create a report that uses a parameter (e.g. Parm: T9_PK) {This will be the Sub-report e.g. TimeCard.rdl}
Drag drop 'List' control onto design surface of a new report {This will be the Main Report}
Add a dataset to the Main Report that has a field that will end up being the Parameter of the 'Sub-report.
Drag the field (e.g. T9_PK) from a dataset {previously added to report}into the List 'Control.
Drag drop a Subreport control into the Cell of the List Control, on the Main Report (e.g. AllTimeCards.rdl).
Set the subreport to the previously created report (e.g. TimeCard.rdl, with a single Parm: T9_FK)
Set the Subreport properties => Parameters:
Name: T9_PK
Value: [T9_PK]
NOTE: the Parameter for this sub-report is the one that is coming from the dataset for the Main report
Right click on '(Details)' in the 'Row Groups' Pane (below Design Surface) => New Group => T9_PK
As an additional option set the page breaks:
Right click on '(T9_PK)' in the 'Row Groups' Pane (below Design Surface) => Group Properties {window}
=> Page Breaks {left pane} =>
Page Break Options:
[x] Between each instance of a group