I have a report MRpt which has a subreport SRpt. MRpt has 2 datasets ds1, ds2. SRpt has 1 dataset dsA. All datasets are generated by different stored procedures. I've been trying to pass the data from the master report datasets to the subreport using various suggestions here but it doesn't seem to help so far. Here is a short description of what I try to accomplish.
The MRpt has a tablix that displays some data as below
(For each PartNumber in MRpt, the SRpt will display the history of credit return approval)
PartNumber| AskedPrice| AskedQuantity| ApprovedPrice| ApprovedQty
PN_1 | 2.00| 50| 1.50| 50
InvoiceNumber| InvoicePrice| InvoiceQty| ApprovedPrice| ApproveQty
240204 | 24.25| 70| 0.50| 50
220203 | 25.50| 1570| 2.50| 1500
PN_3 | 50.00| 20| 27.50| 20
InvoiceNumber| InvoicePrice| InvoiceQty| ApprovedPrice| ApproveQty
240204 | 60.25| 100| 30.50| 70
220201 | 50.50| 2000| 26.50| 1500
220109 | 40.50| 1000| 20.50| 1000
I need to pass to the SRpt these values from the MRpt datasets: ds1.CustomerID, ds1.StartDate, ds1.EndDate, ds2.PartNumber.
Is it possible? If so, how do I go about to do this? Where should I place the SRpt so it will be shown as above illustration. I'm currently getting error: SubReport could not be shown. If I run the SRpt alone, it displays data correctly.
Please help.
I added some screen shots so you guys can help if I did something wrong.
This is the subreport design view
This is the subreport properties from master report
This is how I hook up the parameters
If you have properly set up the values you specified as parameters in your subreports then it should be no problem to send them from the master report. There should be a listing of all subreport parameters when you include a subreport and there you would hook up your params.
Related
I inherited a report where the Grouping and Aggregation is done in the Report. The Dataset is a SQL Server 2008 Query.
This raw Data:
ID Budget Amount Spent Amount
A 1,500 20
A 1,500 20
A 1,500 60
B 2,000 50
B 2,000 75
B 2,000 75
Shows like this on the report:
ID Budget Amount Spent Amount
A 1,500 100
B 2,000 200
I added a calculated field to the Report to get this:
ID Budget Amount Spent Amount Balance
A 1,500 100 1,400
B 2,000 200 1,800
Can I do something in the report to exclude rows that have a balance less than 1,500?
If not, what are my other options?
****************************
. . . the next day . . .
Having tried suggestions to add a Filter Exp. to the Tablix and a Row Visibility Exp. to the row - unsuccessfully - here is what I found:
My actual report has two Row Groups on the row for which I want to limit the rows that show.
I tried the same suggestions made in this thread on another report [with no Row Groups] ... and the Tablix Filter and the Row Visibility both worked fine.
I have to assume that the fact that my 'problem' report has two levels of Grouping is the cause of the Expressions not working.
BUT . . . is there a way to overcome this?
****************************
I just realized [while researching this same issue elsewhere] that the report I am working with does not have a 'Details' row.
What I was thinking of as a Details row is not. There is no Details Row in this report. I have been trying all your suggestions on a row that is not a Details row.
You can reference a textbox field in your report, per the comments in the thread:
=IIF(ReportItems!textbox1.Value <= 1500, True, False)
Throw this expression in the row details visibility section. Or you can even use the filters section to filter this data out. Tons of ways to do this.
Thanks for all your suggestions. They helped me arrive at a solution.
As I said in my [edited] post, my report has no Details Row.
I was adding the expression to the Visibility Property of the Row on the report Tablix which was not a Detail row.
After reading the topic here:
https://dba.stackexchange.com/questions/53727/how-to-hide-rows-in-ssrs-report
I did this:
-> Right-clicked the last/lowest of the Row Groups in the Groups pane,
-> Group Properties,
-> Visibility,
-> Show or hide based on an expression &
-> Entered this expression [does not relate exactly to my example in the post]:
=IIF((Avg(Fields!AMOUNT_1.Value) - Sum(Fields!AMOUNT_2.Value)) >= 0, True, False)
It is now working exactly as needed.
Thanks for all your input!
I am trying to develop a report from cube,and it has one drill through report.when i click on sales amount field on main report,then it open the drill through report with details.Here i passed the (category,subcat,product)parameters(Cascaded) to drill through report in action part of main report.In my main report i have two columns .
columns are Level and Salesamount. Values are like
[-]category 100
[-]subcat 50
product 30
when i click on 100, parameters are passed & it open the detail report correctly, but when i click on 50,the values for subcat parameter is not getting values in detail report and same as the product also.
Here i used the expressions in parameter values
pCategory----iif(inscope(category),!fields.category.value,split(join(Parameters!category.value,","),","))
psubcat----iif(inscope(subcat),!fields.subcat.value,split(join(Parameters!subcat.value,","),","))
pproduct----iif(inscope(product),!fields.product.value,split(join(Parameters!product.value,","),","))
can any one plz reply me.Thanks in Advance
After Struggled 2 days , finally i made this. I just changed the expressions for the parameters, it worked fine.
pCategory= iif(inscope(category),!fields.category.value,split(join(Parameters!category.value,","),","))
psubcat= iif(inscope(subcat),!fields.subcat.value, lookupset(Fields!Category_ID.Value,Fields!Subcat_ID.Value,Fields!Subcat.Value,"dsMain")
pproduct= iif(inscope(product),!fields.product.value, lookupset(Fields!Subcat_ID.Value,Fields!Product_ID.Value,Fields!Product.Value,"dsMain")
I'm trying to make a neat 'front end' report tab (Summary) that just contains the summary information from another report tab (Report1) but I can't seem to get my summary working correctly.
I have some data (Report1) like so, where I have created a variable to flag if 'Value' is above 500:
ID Value Above
1234 400 0
2345 600 1
3567 200 0
5687 1000 1
So I want to sum up over 'Above' in a separate report tab (Summary). I can't find anything that works yet so any function ideas etc would be much appreciated.
Add a new query in the data provider which Counts the No of IDs with a value of 500 and more and use that Value to display in the main sheet.
Regards,
vijay
I found a solution to this:
=sum([Above]ForEach([ID]))
Is it possible to show data from database in SSRS footer?
I tried but the only option present is to show first record from dataset. But I want to show all records (I just need to show one column) one by one on each page.
Is it possible?
Based on your comment I believe this link Display on Page Footer is what you are looking for.
I tried this and it works on Page Footer.
One way to do this is by making your report a list of subreports.
Make a new report with a List item and a dataset that gets a set of all the departments you are going to get. Consider this to be your "List" report.
Populate the list with the dataset. Put a page break between List item members.
Make another report (or modify your existing one so) that is designed to be a single-page report about a single department, so #department will be one of the parameters. It contains all the data you want on each page of your report, including the footer with the Department name, which it gets from the department parameter, so it doesn't need to get it from a dataset. Consider this your "Base" report.
Going back to your List report, put a sub-report in your List item, point the sub-report to your Base report, and populate the department parameter with the value from the dataset that is populating the List.
Yes, it is possible using the "Lookup" aggregate function.
Assume, your report has a dataset named "Department_DataSet" which contains all the department's data plus one additional column e.g. PageNum, that contains an integer sequence starting from 1, giving you, basically, a sequence of the report page numbers:
PageNum | DepartmentName | Address | etc.
--------+------------------+------------+-----
1 | Department 1 | ... | ...
2 | Department 2 | ... | ...
...
N | Department N | ... | ...
Now, add a Textbox into the footer and assign the following expression to it:
=Lookup(Globals!PageNumber, Fields!PageNum.Value, Fields!DepartmentName.Value, "Department_DataSet")
and it will show the department name as required, but please ensure that the page numbers go in the same order as the departments in your detail report.
I have a simple table
Contract# Customer#
aaa111 123
bbb222 453
ccc333 232
ddd444 23X
When I bring it up as a report I want to have some calculated firleds in the header that will count the number of Customers and the number of contracts. But when I create a report and type =Count([Customer#])
and =Count(Contract#]) into the Control Source of a text box I get an error in the Report View. This same syntax works on a Form but not a report. Why won't it work in a report?
Thanks.