Answered by:
Problem Regarding Report Items

Question
-
Hi,
I have a question regarding reportitems.
I place the fields in the body area of report and in the header area I am using reportitems method.
The actual scenario is like this. In the body area, I place a text box and write this expression:
=First(Fields!Name.Value, "Company")
and name it as txtcompany.
And in header area, I place a text field, and write this expression.
=reportitems!txtCompany.Value
Here Source is my database.
The problem is that the text is print only on the first page, not on the whole report.
How can I resolve this issue?
Thanx.....Monday, January 4, 2010 10:33 AM
Answers
-
Hi,
I've had the same proble a time ago...
I finally used custom code:
Private theValue as String
Public Function SetTheValue(Byval Val as string)
theValue=Val
End FunctionPublic Function GetTheValue() as String
Return theValue
End Function
In the body area, place a text box and write this expression:=SetTheValue(First(Fields!Name.Value, "Company"))
And in header area, place a text field, and write this expression.
=GetTheValue()
Hope it will help,
Amaury Loonis- Proposed as answer by Amaury Loonis Tuesday, January 12, 2010 3:23 PM
- Edited by Jinchun ChenMicrosoft employee Tuesday, February 2, 2010 2:50 PM typo
- Marked as answer by Jinchun ChenMicrosoft employee Tuesday, February 2, 2010 2:51 PM
Tuesday, January 12, 2010 3:23 PM
All replies
-
Hi Enigma85,
This is my take on the issue, when the first page is rendered, the renderer is able to find the item "txtcompany" in the report body and hence will show the value in the page header correctly. When the second page is rendered, there is no item called "txtcompany" (the renderer might be creating a copy of this item say "txtcompany1"), so in this case, your expression in the page header will not work and will show blank. In short, it will not be possible to use the reportitem in page header and repeat it with each page.
As a solution you can put this expression inside a group row (in this case, create a group for Company) which will get repeated in each page. Hope this helps
Regards
Manoj
~Mark as Answer if found correct~Tuesday, January 12, 2010 12:35 PM -
Hi,
I've had the same proble a time ago...
I finally used custom code:
Private theValue as String
Public Function SetTheValue(Byval Val as string)
theValue=Val
End FunctionPublic Function GetTheValue() as String
Return theValue
End Function
In the body area, place a text box and write this expression:=SetTheValue(First(Fields!Name.Value, "Company"))
And in header area, place a text field, and write this expression.
=GetTheValue()
Hope it will help,
Amaury Loonis- Proposed as answer by Amaury Loonis Tuesday, January 12, 2010 3:23 PM
- Edited by Jinchun ChenMicrosoft employee Tuesday, February 2, 2010 2:50 PM typo
- Marked as answer by Jinchun ChenMicrosoft employee Tuesday, February 2, 2010 2:51 PM
Tuesday, January 12, 2010 3:23 PM -
hi Amaury Loonis, i followed the same steps ehich u have describe here, but it generate this error:
[BC30205] End of statement expected error
i dunt know how to resolve this issue, please help me on this.Thursday, January 14, 2010 5:37 AM