• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 816
  • Last Modified:

ssrs data field in header

I have a SSRS2005 report and one of the datasets has two data elements in it. The first is a report parameter and the second is a comment. This comment repeats for all of the report parameters. What I want to do is have this comment appear in the header. When I try using the 'First' directive SSRS tells me that fields cannot be in the header or footer. Is there any way to get around this restriction?
0
rwheeler23
Asked:
rwheeler23
  • 5
  • 4
1 Solution
 
planoczCommented:
The data has to be in the main body of the report. So the next step is to hide (if you do not want to see it) the textbox that has the data that you want in the header and then in the header textbox use this type of code.
=ReportItems!MytextBoxName.Value
MytextBoxName is the name of the textbox that has the hide data in it.
The hidden textbox code will be something like:  =Fields!Comments.Value
0
 
rwheeler23Author Commented:
ReportItems!MytextBoxName.Value
It does not appear to know what the directive ReportItems is. Is this something that works in SSRS 2008?
0
 
planoczCommented:
It works in 2005 I think it would work in 2008
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
rwheeler23Author Commented:
Nevermind, I see that it is case sensitive. However, this is the text field I placed in the body. Even though I know that bchcomnt has a value, it always comes back blank.

=First(Fields!bchcomnt.Value, "BatchNumber")

0
 
rwheeler23Author Commented:
This is drinving me nuts. I just deployed the report and there is the comment. When I preview it under BIDS I do not see the comment.
0
 
planoczCommented:
with it being visible =true in your body that way you know that data is where.
if you have the the header right you should see the same data for testing
0
 
planoczCommented:
Oh yea I forgot in 2005 you do not need to use the word  ---- First       in your code. only in 2008.
0
 
planoczCommented:
If you use First in 2005 you will only get the first record and thats all. If the record is empty you will never see any data.
0
 
rwheeler23Author Commented:
Well I will live with in not appearing in BIDS because all the users will see is what appears in their browser. This comment, if it exists, is part of a batch in which all the transactions belong. So all I need is to see the first one. My report is set to give them a lookup by batch ID and that dataset contains the batch comment. Once they choose the batch, all the transactions in that batch are included on the report. I used the same technique for four other reports and the comment appears in all four of them in BIDS. It is just the first version where I do not see it in BIDS.

Thanks for all your help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now