Adding independent parameter to ssrs report - sql

I am working on a SSRS report and i need to add a parameter for 'Invoice Number' search.
I already have start,end also type,program,frequency parameters. And those parameters are cascading so in order to select different 'type' first i need to specify frequency> program>type but my new filter should be independent from others.
SSRS report currently using sql store prod. and that store prod has two conditional store prod in it. I added my new filter into sub store prod. but it is still doesn't let me pick invoice number unless i specify other parameters. now if i select a value from type dropdown filter. for some values ssrs throwing me an error which says 'Prod or func ..... has too many arguments'
Any one has some ideas please?enter image description here

Related

Need to Display records Group By in SSRS

In SSRS 2008, I am developing the report that should display the records based on condition: It should give me the amt_total based on gift_type (Here, amt_total and gift_type are columns of the table).
This is the query I am using.
SELECT o110113.gift_batch_no,
o110113.gift_type,
(o110113.gift_date),
o110113.feed_doc_code,
SUM (o110113.amt_total)
FROM GIFT_CARD o110113
WHERE (o110113.gift_type IN
('RR', 'RB', 'CR', 'RM', 'RW', 'CW', 'RJ', 'RO', 'RK', 'CI')
)
GROUP BY o110113.gift_batch_no,
o110113.gift_type,
(o110113.gift_date),
o110113.feed_doc_code
ORDER BY o110113.gift_batch_no ASC, o110113.gift_type ASC
And the report I am trying to generate in SSRS 2008 should look like this.
Clikck this to see the Image of the Report that I am trying to develop
I am trying to use the SSRS expression
=Sum(Fields!SUM_O110113_AMT_TOTAL_.Value,"GIFT_TYPE")
It is throwing me the error saying:
Please click this to see an Error I am getting in SSRS
Kindly provide the Solution
This the report design I have developed
[click to see the Image of report]
Thanks
Arun
Here you need to do group by of your Tablix.
First you need to add Row group on gift_batch_no so that will dispaly based on gift batches.
Another row group your have to create on Gift type and in that second group type you need to set SUM of total amount it will work.
Let me know if you have any other query
That error has to do with the scope of your sum. without seeing the data sets and assuming it is not a nested aggregate operation based on the image. you are trying to reference the column name "GIFT_TYPE" when it should actually be the name of the record set, or the appropriate scope(data region/group).
here is how scope works from the provided link below
The value of scope must be a string constant andcannot be an
expression. For outer aggregates or aggregates that do not specify
other aggregates, scope must refer to the current scope or a
containing scope. For aggregates of aggregates, nested aggregates can
specify a child scope.
you will want to see this link for more information

How to add a figure to only a particular group in vb.net RDLC report

I have an RDLC report which sums totals for each group in VB.Net. It is working fine but what I want to do is to add a figure outside the group to only a particular group based on users selection.
Assuming there are three groups: Food Dept, Security Dept and Sales Dept. I want a figure 2000 to be added to only the Food Dept without affecting the Sales and Security Dept. Any help?
You can use an expression like this:
=Sum(Fields!ValueToSum.Value) + IIf(Fields!Departments.Value = "Food Dept", 2000, 0)
This is a simple example: use ReportParameters instead of constant ("Food Dept", 2000).
I would add a parameter and assign the value. An integer parameter for ex: #FoodDeptOffset can be added to the fields as
=Sum(Fields!FoodDept.Value) + (Parameters!FoodDeptOffset.Value)
Thanks A lot for the answers. I was able to sort it out by passing a parameter which did the trick. On the main form which loads the Reportviewer I attached A combo box giving the users an option to select which field the wanted to add to and the passed it as a parameter to the rdlc report.

Execute a Dataset based on parameter value -SSRS

I have an SSRS report which have two datasets. One Dataset for showing the Amount of purchase in detail level for All Region Managers & other dataset is for displaying amount of purchase for individual manager. If the user select all managers as input, the report displays data from both datasets. If the user select a single manager, Detail level information will be hidden and data for that manager alone will be displayed ( Handled this by creating visibility expression in dataset). But whenever the report exectuted stored prcoedures for both datasets called. Is it possible to configure the execution of report dataset based on parameter values?
for e.g : In dataset1 properites I gave below expression,
=iif(Parameters!ManagerID.Value= -1,exec procedure1 ,0)
But it gave me error. How to make a dataset execute based on a parameter value?
Use an 'if' condition in both data sets. For example:
if #parameter = 'A'
...query....
else
select 1
And for the tablix, use visibility expression to hide based on the parameter va.

How to make SSRS run and send PDF report using one parameter, then change the parameter and run and send another report?

I have created report in SSRS that subscribed at particular time and sends PDF email.
I need exactly the same report, but with different parameter. Is any way to make SSRS automatically change the parameter value, and then send out the PDF report?
Where can I change my parameter here?
I would use a Data-Driven subscription for this. One benefit of data-driven subscriptions is you can give a meaningful description the the subscription instead of it just being "Mail sent to ..."
When you set up the data-driven subscription, step 3 asks for a valid sql query. For every row returned in the sql query, the report will be executed. In your case, your query could be as simple as
select 'Value1' as ParamValue
union select 'Value2'
This will give you two rows, with a different parameter value in each row.
On step 4 you set up the options for recipients, subject line, etc. Note that all of this can also be part of your query.
Step 5 is where you would set up your parameter value, and you'd choose "Get the value from the database" and in the drop-down, select your parameter name.
With it set up this way, the report will be executed twice (once for each row returned in the query from step 3).
One of the main things I use datadriven subscriptions for is when I must send the same report to multiple recipients, but the parameters are different for each recipient. For example, we send a sales report to all of our sales reps. The Sales Rep Code is a parameter for the report but I can customize the other settings for the subscription as well. Using a table containing our sales rep data, I use something like this
SELECT
SalesRepCode
, SalesRepEmail
, 'Sales report for ' + SalesRepName + ' - ' + SalesRepCode + ', as of ' + GETDATE() AS SubjectLine
FROM SalesRepTable
This returns around 70 rows, one row for each sales rep. For each row, the report will get generated using the SalesRepCode as a report parameter, the SalesRepEmail as the recipient, and the SubjectLine as the, well, subject line. One subscription, 70 versions of the same report.

multiple Filters in Jasper Report

I have Created a Student Information Report using Jasper report (SQL database). I need to filter the report using different parameters. e.g
Branch Wise
Gender Wise
Class Wise
Section Wise and some more
I'm using Java Swing as a front end application.
My question is for each filter i have to write separate query?? or is there a way in jasper to manage different filter for example.
You can manage your query based on the parameter you got using a different expression which is $P!{}.
Follow below steps to achieve your needs,
Create a parameter, say $P{BranchWise}.
In the expression of that parameter, write something like
$P{Branch} != null ? "and branch = '"+$P{Branch}+"'" : ""
Likewise create parameter for different filters.
Now use these parameters in your query as below
select * from table1 where 1=1 $P!{BranchWise} $P!{GenderWise} $P!{ClassWise} ....
Hope this should solve your problem.