Discussion:
ReportItems! collection only exists on the page that the field was output!!! how can I repeat a field per page
(too old to reply)
j***@gmail.com
2007-05-25 00:38:52 UTC
Permalink
I've been reading and re-reading the posts concerning placing dataset
fields into headers and footers. I use reporting services 2000. The
best answer I got was the hidden field being referenced in the header
and footer. But what happens if that field exists only on the first
page? I'll tell you what happens: page 2 through page N get
nothing!!!! <rant>The only answers I ever read from microsoft were
pure BS answers designed solely to protect the back of a development
team that clearly released a faulty product and doesn't want to answer
for it.</rant>

My report has a list.
In the list are three tables. each of them has a page-break after
them
my report has a footer
In the footer is demographic information about the person whose
data appears in each of the three tables.

I have tried BS suggestion #1: set a hidden field in the list and
reference it in the page footer using the First(ReportItems!
<fieldname>) notation. Result: nothing in the footer on page 2
through N

I tried BS suggestion #2: set a hidden field in the details section of
each table and reference it using the First(ReportItems!<fieldname>)
notation. Of course, I can't reuse field names, so I created them as
tbPatName, tbPatName2, and tbPatName3. In the footer, I created the
Patient field as "=First(ReportItems!tbPatName.Value) &
First(ReportItems!tbPatName2.Value) & First(ReportItems!
tbPatName3.Value)", knowing that the blank ones would just not return
anything. Result: "An expression in a page header or footer can refer
to only one report item." Huh?!? Why?!?

I tried BS suggestion #3. Copy the entire complex footer from the
page footer to the table footer for each table. Result: All three
pages had footers, but none of the footers were on the bottom of the
page, where a page footer should be.

I've spent 2 days on this report and all but about 2 hours of that
time was just wresting with the stinkin' footers.

Does anyone have an intelligent suggestion other than the above BS
answers?

Incidently, there is absolutely, positively no possibility of
upgrading to sql 2005 just to get a single report correct, so please
don't suggest it. I need a sql 2000 solution.

Thank you kindly. Please respond to ***@nospam_m2is.com with
any suggestions. (be sure to remove the no spam section from that
address, first)
Antoon
2007-05-25 11:05:00 UTC
Permalink
Before I try some things, let me get this clear.
The report is a list of persons, for each person you have three tables.
Tables start on a new page but can take several pages.
You want a footer on each page that specifies the id of the person for which
the page contains information.
Post by j***@gmail.com
I've been reading and re-reading the posts concerning placing dataset
fields into headers and footers. I use reporting services 2000. The
best answer I got was the hidden field being referenced in the header
and footer. But what happens if that field exists only on the first
page? I'll tell you what happens: page 2 through page N get
nothing!!!! <rant>The only answers I ever read from microsoft were
pure BS answers designed solely to protect the back of a development
team that clearly released a faulty product and doesn't want to answer
for it.</rant>
My report has a list.
In the list are three tables. each of them has a page-break after
them
my report has a footer
In the footer is demographic information about the person whose
data appears in each of the three tables.
I have tried BS suggestion #1: set a hidden field in the list and
reference it in the page footer using the First(ReportItems!
<fieldname>) notation. Result: nothing in the footer on page 2
through N
I tried BS suggestion #2: set a hidden field in the details section of
each table and reference it using the First(ReportItems!<fieldname>)
notation. Of course, I can't reuse field names, so I created them as
tbPatName, tbPatName2, and tbPatName3. In the footer, I created the
Patient field as "=First(ReportItems!tbPatName.Value) &
First(ReportItems!tbPatName2.Value) & First(ReportItems!
tbPatName3.Value)", knowing that the blank ones would just not return
anything. Result: "An expression in a page header or footer can refer
to only one report item." Huh?!? Why?!?
I tried BS suggestion #3. Copy the entire complex footer from the
page footer to the table footer for each table. Result: All three
pages had footers, but none of the footers were on the bottom of the
page, where a page footer should be.
I've spent 2 days on this report and all but about 2 hours of that
time was just wresting with the stinkin' footers.
Does anyone have an intelligent suggestion other than the above BS
answers?
Incidently, there is absolutely, positively no possibility of
upgrading to sql 2005 just to get a single report correct, so please
don't suggest it. I need a sql 2000 solution.
any suggestions. (be sure to remove the no spam section from that
address, first)
j***@gmail.com
2007-05-25 17:36:44 UTC
Permalink
This post might be inappropriate. Click to display it.
j***@gmail.com
2007-05-25 17:53:15 UTC
Permalink
This post might be inappropriate. Click to display it.
Antoon
2007-05-27 12:03:02 UTC
Permalink
Well, some custom code trick was what I was also thinking about, so I geuss
you already got that trick.
Another solution, that might work, depending on your situation, is to change
teh report concept. Create a parameter for the lists of persons and have the
report only show the 3 tables for that person. The footer will be no problem
then. As long as you want to make the report available electronically this
should work fine. Offcourse if you realy want to print the report for all
persons you still have a problem, but that could be solved with some fairly
easy custom code.
Post by j***@gmail.com
Post by Antoon
Before I try some things, let me get this clear.
The report is a list of persons, for each person you have three tables.
Tables start on a new page but can take several pages.
You want a footer on each page that specifies the id of the person for which
the page contains information.
Post by j***@gmail.com
I've been reading and re-reading the posts concerning placing dataset
fields into headers and footers. I usereporting services2000. The
best answer I got was the hidden field being referenced in the header
and footer. But what happens if that field exists only on the first
page? I'll tell you what happens: page 2 through page N get
nothing!!!! <rant>The only answers I ever read from microsoft were
pure BS answers designed solely to protect the back of a development
team that clearly released a faulty product and doesn't want to answer
for it.</rant>
My report has a list.
In the list are three tables. each of them has a page-break after
them
my report has a footer
In the footer is demographic information about the person whose
data appears in each of the three tables.
I have tried BS suggestion #1: set a hidden field in the list and
reference it in the page footer using the First(ReportItems!
<fieldname>) notation. Result: nothing in the footer on page 2
through N
I tried BS suggestion #2: set a hidden field in the details section of
eachtableand reference it using the First(ReportItems!<fieldname>)
notation. Of course, I can't reuse field names, so I created them as
tbPatName, tbPatName2, and tbPatName3. In the footer, I created the
Patient field as "=First(ReportItems!tbPatName.Value) &
First(ReportItems!tbPatName2.Value) & First(ReportItems!
tbPatName3.Value)", knowing that the blank ones would just not return
anything. Result: "An expression in a page header or footer can refer
to only one report item." Huh?!? Why?!?
I tried BS suggestion #3. Copy the entire complex footer from the
page footer to thetablefooter for eachtable. Result: All three
pages had footers, but none of the footers were on the bottom of the
page, where a page footer should be.
I've spent 2 days on this report and all but about 2 hours of that
time was just wresting with the stinkin' footers.
Does anyone have an intelligent suggestion other than the above BS
answers?
Incidently, there is absolutely, positively no possibility of
upgrading to sql 2005 just to get a single report correct, so please
don't suggest it. I need a sql 2000 solution.
any suggestions. (be sure to remove the no spam section from that
address, first)- Hide quoted text -
- Show quoted text -
That's exactly correct. I used a hack that I found on the newsgroups
to get closer, by having each patient field call some custom code that
sets the value on page 1 and then returns the value on the subsequent
pages. This has got me closer, but it's a kludge at best and nowhere
near to a solution.
LBJOHN
2007-06-24 05:40:00 UTC
Permalink
This solution is an adaptation of the reseting page number solution per group
posted elsewhere.

Step 1: On the left of the top ruler (next to the number 0), there is a
tiny square. Right click on it, and select the report properties

Click on the "Code" tab, and enter the following code:

Shared PatientName as String

Public Function GetPatientName(Patient As String) As String
if not Patient is Nothing
PatientName = Patient
End if
Return PatientName
End Function

Step 2: In the body of the report, there should be a list or a table, which
group by the patient name, give a specific name to the textbox that contains
the patient name (e.g. PatientName)

Step 3: In the Page header, add a textbox with the following expression:

=Code.GetPatientName(ReportItems("PatientName").Value)

What this does:
I used a list box to contain the information for a patient, with a rectangle
at the end of the list box to force a page break after each patient
information is displayed. This will result in each patient in a table, to be
displayed one at a time, with some patient's info lasted for 3 pages long,
while others may last for 2 pages, 1 page, etc.

This function will display the correct patient's name, on each of the page
header, on pages pertaining to the information for that particular patient.

HTH,

John W
Post by j***@gmail.com
I've been reading and re-reading the posts concerning placing dataset
fields into headers and footers. I use reporting services 2000. The
best answer I got was the hidden field being referenced in the header
and footer. But what happens if that field exists only on the first
page? I'll tell you what happens: page 2 through page N get
nothing!!!! <rant>The only answers I ever read from microsoft were
pure BS answers designed solely to protect the back of a development
team that clearly released a faulty product and doesn't want to answer
for it.</rant>
My report has a list.
In the list are three tables. each of them has a page-break after
them
my report has a footer
In the footer is demographic information about the person whose
data appears in each of the three tables.
I have tried BS suggestion #1: set a hidden field in the list and
reference it in the page footer using the First(ReportItems!
<fieldname>) notation. Result: nothing in the footer on page 2
through N
I tried BS suggestion #2: set a hidden field in the details section of
each table and reference it using the First(ReportItems!<fieldname>)
notation. Of course, I can't reuse field names, so I created them as
tbPatName, tbPatName2, and tbPatName3. In the footer, I created the
Patient field as "=First(ReportItems!tbPatName.Value) &
First(ReportItems!tbPatName2.Value) & First(ReportItems!
tbPatName3.Value)", knowing that the blank ones would just not return
anything. Result: "An expression in a page header or footer can refer
to only one report item." Huh?!? Why?!?
I tried BS suggestion #3. Copy the entire complex footer from the
page footer to the table footer for each table. Result: All three
pages had footers, but none of the footers were on the bottom of the
page, where a page footer should be.
I've spent 2 days on this report and all but about 2 hours of that
time was just wresting with the stinkin' footers.
Does anyone have an intelligent suggestion other than the above BS
answers?
Incidently, there is absolutely, positively no possibility of
upgrading to sql 2005 just to get a single report correct, so please
don't suggest it. I need a sql 2000 solution.
any suggestions. (be sure to remove the no spam section from that
address, first)
Bob Bob
2011-10-20 14:34:16 UTC
Permalink
You are my hero !!!

I've been searching the web for weeks to find a "clean" solution for that problem... Did not even know custom coding was allowed with rdlc reports...

Thanks again !
Post by j***@gmail.com
I've been reading and re-reading the posts concerning placing dataset
fields into headers and footers. I use reporting services 2000. The
best answer I got was the hidden field being referenced in the header
and footer. But what happens if that field exists only on the first
page? I'll tell you what happens: page 2 through page N get
nothing!!!! <rant>The only answers I ever read from microsoft were
pure BS answers designed solely to protect the back of a development
team that clearly released a faulty product and doesn't want to answer
for it.</rant>
My report has a list.
In the list are three tables. each of them has a page-break after
them
my report has a footer
In the footer is demographic information about the person whose
data appears in each of the three tables.
I have tried BS suggestion #1: set a hidden field in the list and
reference it in the page footer using the First(ReportItems!
<fieldname>) notation. Result: nothing in the footer on page 2
through N
I tried BS suggestion #2: set a hidden field in the details section of
each table and reference it using the First(ReportItems!<fieldname>)
notation. Of course, I can't reuse field names, so I created them as
tbPatName, tbPatName2, and tbPatName3. In the footer, I created the
Patient field as "=First(ReportItems!tbPatName.Value) &
First(ReportItems!tbPatName2.Value) & First(ReportItems!
tbPatName3.Value)", knowing that the blank ones would just not return
anything. Result: "An expression in a page header or footer can refer
to only one report item." Huh?!? Why?!?
I tried BS suggestion #3. Copy the entire complex footer from the
page footer to the table footer for each table. Result: All three
pages had footers, but none of the footers were on the bottom of the
page, where a page footer should be.
I've spent 2 days on this report and all but about 2 hours of that
time was just wresting with the stinkin' footers.
Does anyone have an intelligent suggestion other than the above BS
answers?
Incidently, there is absolutely, positively no possibility of
upgrading to sql 2005 just to get a single report correct, so please
don't suggest it. I need a sql 2000 solution.
any suggestions. (be sure to remove the no spam section from that
address, first)
Post by Antoon
Before I try some things, let me get this clear.
The report is a list of persons, for each person you have three tables.
Tables start on a new page but can take several pages.
You want a footer on each page that specifies the id of the person for which
the page contains information.
Post by j***@gmail.com
That's exactly correct. I used a hack that I found on the newsgroups
to get closer, by having each patient field call some custom code that
sets the value on page 1 and then returns the value on the subsequent
pages. This has got me closer, but it's a kludge at best and nowhere
near to a solution.
Post by j***@gmail.com
That's exactly correct. I used a hack that I found on the newsgroups
to get closer, by having each patient field call some custom code that
sets the value on page 1 and then returns the value on the subsequent
pages. This has got me closer, but it's a kludge at best and nowhere
near to a solution.
Post by Antoon
Well, some custom code trick was what I was also thinking about, so I geuss
you already got that trick.
Another solution, that might work, depending on your situation, is to change
teh report concept. Create a parameter for the lists of persons and have the
report only show the 3 tables for that person. The footer will be no problem
then. As long as you want to make the report available electronically this
should work fine. Offcourse if you realy want to print the report for all
persons you still have a problem, but that could be solved with some fairly
easy custom code.
Post by LBJOHN
This solution is an adaptation of the reseting page number solution per group
posted elsewhere.
Step 1: On the left of the top ruler (next to the number 0), there is a
tiny square. Right click on it, and select the report properties
Shared PatientName as String
Public Function GetPatientName(Patient As String) As String
if not Patient is Nothing
PatientName = Patient
End if
Return PatientName
End Function
Step 2: In the body of the report, there should be a list or a table, which
group by the patient name, give a specific name to the textbox that contains
the patient name (e.g. PatientName)
=Code.GetPatientName(ReportItems("PatientName").Value)
I used a list box to contain the information for a patient, with a rectangle
at the end of the list box to force a page break after each patient
information is displayed. This will result in each patient in a table, to be
displayed one at a time, with some patient's info lasted for 3 pages long,
while others may last for 2 pages, 1 page, etc.
This function will display the correct patient's name, on each of the page
header, on pages pertaining to the information for that particular patient.
HTH,
John W
Loading...