Show column from database in report footer of SSRS - reporting-services

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.

Related

SSRS report pass multiple VALUES to drill through report parameter

I created a report with 5 fields in a hierarchical order:
Order Date
Time of Day (AM/PM)
Parent Name (aka customer)
Product Line
BIC Part Number (aka Item)
Each field expands down to the next level, so order date expands to time of day, etc.
I want to create a drill through report so that the user can click on each level of the hierarchy and see the detail.
This works fine at the lowest level - Item - because only 1 values from each field has to be passed to the drill through report parameter. However, when I try, for example, to drill through based on Product Line, there will usually be 3 or 4 Items within this product line. In the Go To action, I have the drill through parameter "bic_part" set to the main report FIELD value "BIC Part Number".
I have the tablix on the drill through report set where "BIC Part Number" IN [#bic_part].
I just want to be clear, I am passing a set of report field values to the drill through report parameter, not parameter to parameter.
I have tried using expressions with =Split(Join(field value),","),",") and all variations on that. I can't seem to get the child report filters to accept multiple values from the BIC Part Number field from the parent report.
I also tried omitting the BIC Part Number value in the go to report section, but it would not let me.
All of the parameters in the child report are set to accept multiple values. My data source for both reports is the same stored proc, so I can add a query filter. I would appreciate any help.
I think each sub report link needs to be slightly different.
In the subreport, each parameter needs to accept null and your query needs to look for
(FieldName = #FieldNameParameter or #FieldNameParameter is null)
This will allow you to pass the lowest possible solid value, then null for all child values.
If we're looking at the Parent_Number level, on that subreport link you would pass Fields!Parent_Number.Value and then Nothing for each of the lower parameters (Product_Line, BIC_Part_Number).
This will allow you to filter on the lower common denominator in your sub report - Part_Number for this link, Product_Line for the next one down, etc.
I've used this logic in reports before, so it does work. Let me know if my explanation needs clarification - it's Friday afternoon..

SSRS rows in tablix outside group goes to next page

I have a SSRS report that looks like the following:
Report Header:
Page X of Total Page Y (based on change of Customer ID)
Customer ID (Referring to ReportItem!CustomerID)
Report Body:
A tablix page break by change of group Customer ID
Tablix Header: Date | Price | Quantities | Description | Hidden Column Customer ID
Tablix Details: YYYY-MM-DD | 1.00 | 500 | Blah Blah | Customer ID (used for page header referring)
Row outside group: Empty
Row outside Group: Sum of Price
Row outside Group: Sum of Quantities
Row outside group: Empty
Row outside group: *** END OF RECORDS ***
Report Footer:
Company address
Occasionally, the Row outside group will go to next page if the report body for the tablix details are full, which causing in the next page, only some of the rows outside group will be displayed (e.g. * END OF RECORDS *).
Then, in the report header, the Customer ID field cannot get the value of ReportItem!CustomerID which leave it blank.
Is there anyway to solve the blank issue? Or make the row outside group must attach to the tablix details in the same page? For some reason, I cannot limit the number of rows display per page. Thanks.
Maybe you can try throwing in another hidden copy of the final "Customer ID" somewhere on the "END OF RECORDS" group row and then use an IIF to call that one if the original hidden "Customer ID" you have isn't present on the final page.
You can control when the page breaks occur and keep the elements together, but it's not very intuitive. First, don't use actual Headers and Footers. Just use textboxes that will appear at the beginning and end of each Customer's data. Second, you need to wrap everything in a grouped rectangle. This will be grouped by customer with page breaks set to happen between instances.
See my answer here for more details on how to do this.
If I was going to display "Body" object values in the report header, I would create a hidden expression text object somewhere in the "Body" that uses a Code call ( Report Properties, Code ) to put the value into a shared variable. Then, that gives you a set variable, get variable, type of situation. The variable is updated as the "Body" object appears throughout the report, and the variable 'sticks' across pages where the object does not necessarily occur.

SSRS Total by Type

I am new to SSRS. I have a report that goes like this
Type Amount
A 500
B 200
A 100
C 400
C 200
I want to convert this to a report like this
Type Total Amount
A 600
B 200
C 600
Basically get distinct Types on the left column and th totals for those types in the right column. Is there a way i can do that easily?
Thanks
Starting with you simple report which just lists the records in your DataSet:
Design:
Results:
Right click on (Details)in the Row Groups section and choose Add Group -> Parent Group:
Choose the field you want to group by (Type in our example) from the Group by: dropdown, choose to add either a group header or footer and click OK:
Your table will now look something like this:
You can delete the second column and the third row - or second row if you chose to add a group footer earlier - entirely (clicking OK when deleting the row and being prompted to delete the associated group), leaving a layout like this:
Now just click the field selector for the empty cell in the table and choose your Amount field:
or right click on the empty cell, choose Expression from the context menu and enter the following expression:
=Sum(Fields!Amount.Value)
either of which should result in the formula being placed into the cell:
Now run your report and you should get the expected result:
There's loads of places online with similar guides and resources which you can also consult:
MSDN Reporting Services Tutorial (Adding Grouping and Totals)
MS TechNet (Calculating Totals and Other Aggregates)
MSDN (Add a Total to a Group or Tablix Data Region)
There are also several other similar questions here on SO which you'll find if you just search for them.

Creating multiple-page reports in Access (new page for each group)

I'm looking to create a report which is specifically designed to be over multiple pages, based on one condition. The condition is that when the grouped item (call it invoice) changes, it starts a new page, instead of putting all the data on as little pages as possible.
At the moment it runs like this,
Invoice, Date, ID
------------------
2 , Now , 1
------------------
3 , Now , 1
------------------
I want to insert a page break between the invoice numbers, but can't figure how to do it, is it possible?
In the Group Header for "Invoice" on your report you can set the Force New Page property to Before Section to start each invoice on a new page. For details, see
Print each group of your Access report on a separate page

In SSRS is there a way to make a Row Group expand based on parameter value?

I've got a table with 5 columns, the first 3 of which allow the user to drill down through the levels of detail. Each of these columns (Region, Country & Office) has an associated Parameter so the user can select the geographic region for their report. Each parameter allows the selection of multiple values.
If the user selects 1 Region, 1 Country and 1 Office it's not exactly ideal for them to then have to expand each selection. Is there an expression I can enter somewhere to state that if only 1 value is entered in a parameter then that data set will automatically show as expanded?
This is in SSRS 2008 R2 if that makes any difference.
In the Group Properties for the detail group you can enter an expression for the initial visibility. Right now you probably have that set to "Hide." The expression needs to return a Boolean and could be something like:
=Parameters!Country.Count <> 1
This will have SSRS hide those rows if more (or less) than one value are selected in the parameter Country
But I have seen some unexpected results with this: test thoroughly. In my experience, BIDS handles these better than SSRS itself, so just when you think you've got it all working, it fails miserably once deployed. (Reason number 14 to have a test folder on production SSRS.)