How do I show data in the header of a SQL 2005 Reporting Services report? - sql

Out of the box SSRS reports cannot have data exposed in the page header. Is there a way to get this data to show?

One of the things I want in my reports is to have nice headers for my reports. I like to have a logo and the user's report parameters along with other data to show to give more information for the business needs the report needs to clarify. One of the things that Microsoft SQL Server 2005 Reporting Services cannot do natively is show data from a Dataset in the header. This post will explain how to work around this and how easy it is.
Create the Report Server Project in the Business Intelligence Projects section and call it AdventureWorksLTReports. I use the AdventureWorksLT sample database from CodePlex.
alt text http://www.cloudsocket.com/images/image-thumb.png
Next show the Page Header by right clicking in the Report area with the designer.
alt text http://www.cloudsocket.com/images/image-thumb1.png
The Page Header will appear. If you want to show the Page Footer this can be accessed from the same menu as the Page Header.
alt text http://www.cloudsocket.com/images/image-thumb2.png
I created a stored procedure that returns data for the Sales Order to be presented in the Page Header. I will show the following information about the Sales Order in the Page Header:
Order Date
Sales Order Number
Company
Sales Person
Total Due
I create a TextBox for each of my data fields in the Page Header along with a TextBox for the corresponding label. Do not change the Expression in the TextBoxes that you want the Sales Order data in.
alt text http://www.cloudsocket.com/images/image-thumb3.png
In the Report Body, place a TextBox for each data field needed in the Page Header. In the Visibility for each TextBox, select True for Hidden. This will be the placeholder for the data needed in the Page Header.
alt text http://www.cloudsocket.com/images/image-thumb4.png
Your report should look similar to the screenshot shown below.
alt text http://www.cloudsocket.com/images/image-thumb5.png
The last step and most important is to reference the Hidden TextBox in the TextBoxes located in the Page Header. We use the the following Expression to reference the needed TextBoxes:
=ReportItems!.Value
Your report should now look similar to the following:
alt text http://www.cloudsocket.com/images/image-thumb6.png
Your Report preview should now have the Sales Order Header data in the Report Header.
alt text http://www.cloudsocket.com/images/image-thumb7.png

You have to do it through Parameters. Add a parameter for each piece of data you would like to display, then set the parameter to Hidden. Then set the default value to "From Query" and set the Dataset and Value field to the appropriate values.

I think the best option is creating a internal parameter, with the default value the field of the dataset you want to show.

Here are two possible workarounds:
You can place the databound field within the body of the report as a hidden textbox, and then in the header place another textbox with it's value pointed at the the one hidden within the body.
Try using report parameters to store the data, and use those parameters to access the data in the header.

This technique wouldn't work if your report spans over multiple pages, use queried parameters instead, and set the textbox value to =Parameters!Name.Value as per this article.

I'm with Orion Adrian here. Report parameters are the way to go.

I wanted to show a field, common to all returned rows, in the header, and for this scenario I went for the linked table solution (placing a table containing the field in the body and link a textbox in the header to this table).
I did that because if you are using the parameter solution and no data is returned to the field in question, the text "Parameter is missing a value" is shown instead of just a blank table. I reckoned this text would confuse users (as the parameter isn't even visible).

Related

Holding parameter values when report is refreshed due to custom buttons used for expand/collapse groups

This may be as simple as it can't be done, but I have to ask. :) I am building a report using Report Builder 3.0. The report contains a table which also has Grouping established. I wanted to give the user an easy way to expand/collapse all rows of the table, so I used the method of creating a parameter with two values (0 for collapse, 1 for expand), tied the visibility of the group to the parameter using an expression in the Hidden Property for the group. Then I created two text boxes for Expand and Collapse and added the respective parameter/value in the Action in the text box properties.
At this point, everything works as intended. Here is where I run into the issue. I added another parameter, lets just call it "Location". The parameter is a text data type that allows multiple values and gets it available values from dataset/query in the same report. This is where I am guessing what I want may not be possible. When I select my Location(s), then run the report it all looks good. However, when I click on one of the Expand/Collapse text boxes, it clears out the values that I selected for the location(s). I am guessing this is due to the fact that the available values for the Location parameter is set via a query at run time. Is there any way to maintain the values for the Location parameter when triggering the expand/collapse buttons?
Thanks in advance!

Access 2007 - drop down box in a Report

I need to create a drop-down box so that an employee can select a pre-set reason in the "RE:" field of a Report. There are only two selections that need to be in the box: "personal events" and "lack of adequate notice".
The report itself is already made and there are a number of fields that link back to the database - name, address, specific dates, etc that are already in the report. I've figured out how to make the drop-down box using the combo box function in a form but is there any way I can merge the combo box into the report?
I'm a beginner, by the way so I'm still figuring things out.
Currently your report sits on a query (query get relevant data from the table)
Steps to follow:-
Change the table by adding a column with the two options you just
mentioned above
Add combobox to Form with items as the two options
Adjust your query to use these options as a criteria to change
results returned by the query
Show the results in the report as you are showing right now.
If you have a code already, please post that snippet. So we can help you accordingly.
Some reference for you to get ideas
BUT I HAVE A DOUBT, ARE YOU TRYING TO SAY YOU WANT TO SWTICH BETWEEN TWO REPORTS BASED ON THE USER CHOICE SELECTED IN COMBOBOX?

Show different report in Oracle based on parameter

I'm using Oracle report builder and I have to show summary and detail reports. This tool does not have drilldown capability. I need it to show the either the detail or the summary report based on a parameter that the user enters at the beginning. Can anyone tell me how to dynamically display either one or the other report based on the user parameter entered?
You will use a repeating frame to display the content and you can set the visibility of this frame according to the value of your report parameter.
So you will just have two of these - one for your first select and another one for the second.

How to filter a Sharepoint List Column with a Textbox Control Value using a "Contains" query?

I'm using a data view to display a list (Sharepoint 2010) that has several columns including one that has a Name column. I've provided the user with a text filter on the page to send values to filter the Name column in this list. The problem I'm facing is that the filter only works for exact matches and not partial matches.
I tried to overcome this problem by using Sharepoint Designer to:
create a parameter that uses the textbox control value.
Filtering the Name column with this parameter and setting the comparison to "Contains"
Unfortunately if the default value of the Parameter is blank, the list does not display any data. If the default value of the parameter is set to part of a name in the list, the list displays names that contain that string. However, when changing the value in the text box and searching, the list does not return results. Please let me know if you guys know how to fix this. Any help is much appreciated and let me know if you need any additional information. Thanks!
Managed to find a solution to my problem. I used a custom javascript solution designed by jvossers (http://instantlistfilter.codeplex.com) that involves the list being filtered instantly much like Google's search!
The only downside of this solution is that it only filters the items currently displayed on the screen. Therefore, if you have a data view web part which limits the amount of items displayed on the page, this solution won't help you. In order to facilitate this solution, display all the row items on the page (by increasing the item limit per page to a larger number than your total list rows) and then add this code into a content editor web part on the same page. Worked brilliantly for me. '
By the way if you are using jQuery 1.3.x or higher, you should modify the script a little as described in the disscussion here: http://instantlistfilter.codeplex.com/Thread/View.aspx?ThreadId=49123

access: displaying data on a report

i have a report that is attached to a query
i want to display the contents of a query. there are three columns. i made a list box but it looks weird:
alt text http://img130.imageshack.us/img130/2245/52036335.png
i dont want the scroll bars, i just need the three fields from a query to be displayed regularly just as they would be in a spread sheet or grid
In your report's Detail section, create a text box (not a list box) for each of those 3 fields in your query.
It might be easier to get oriented by creating an autoform based on the query.