This report displays prescription information for a hospital patient. In a
web page, the doctor chooses the patient from a search, then indicates
whether he wants inpatient data, outpatient data, or both. Finally, he
indicates whether he wants active prescriptions, expired ones, or both.
These are the three parameters which are sent to the report: PatientID,
Active, and FacilityID (which just means whether the patient is in the
hospital, out of it, or both kinds of records should be returned).
There is only one patient per report, but several prescriptions. One of the
requirements for this report was that the patient name should be displayed in
bold at the top of each page. Quoting from Brian Larson's book here:
"You cannot place information from a dataset in the page header...directly!
You can, however, put the value of a parameter in the page header. You can
also use a dataset to specify the default value of a parameter. Therefore,
using this two-step approach, we can put [a value from the dataset] into the
page header."
This is what I have done with the patient name. Given a PatientID, I query
for patient data joined to prescription data; one of the returned fields is
patient name. I create a PatientName parameter, set its default value to
"From query", and from the report's only dataset make the parameter's value
field "PatientName". Then I put a textbox on the page header and set its
value to, ="Patient: " & Parameters!PatientName.Value. This displays the
name of the patient at the top of each page. It works properly in the IDE.
Only when I deploy and then reference the report by browser do I get the
error.
[quoted text, click to view] "Bruce L-C [MVP]" wrote:
> If I understand this is what you are trying to do.
>
> One dataset is in the report that is based on three visible parameters.
>
> You are putting a value(s) from the dataset into an invisible parameter
> because you want the value(s) to be in the header. Is this one or is it
> multiple values?
>
> I am not familiar with this technique. You can't just use the First
> aggregate in the header? (Which only works if you have a single record OR
> the same value in each record).
>
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
>
> "Fred Sawtelle" <FredSawtelle@discussions.microsoft.com> wrote in message
> news:45CE869C-BBC2-4C33-B0E5-3DD71991E228@microsoft.com...
> > Okay. The datasource uses sql server authentication with a username and
> > password that are valid for the referenced database. There is only one
> > dataset for this report, and when I take out the internal parameter, the
> > report accesses and displays data from it with no problem. Other
> > thoughts?
> >
> > "Bruce L-C [MVP]" wrote:
> >
> >> Check the credentials for the datasource used by the dataset that uses
> >> the
> >> hidden parameter.
> >
>
>
OK, so you have multiple records but each record of the dataset has the
patient name.
This seems overly tricky. You can put aggregates in the header and one of
the available aggregates is the First aggregate. The expression builder will
give you the option for this. You do not even need the parameter.
The other option is to create a second dataset that all it does is return
the patients name and use that for the source of your parameter. But, if you
do that, again, you do not need the parameter. You just use the First
aggregate.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
[quoted text, click to view] "Fred Sawtelle" <FredSawtelle@discussions.microsoft.com> wrote in message
news:CBE71BBC-D686-4A09-82C6-4053B0EED97C@microsoft.com...
> This report displays prescription information for a hospital patient. In
> a
> web page, the doctor chooses the patient from a search, then indicates
> whether he wants inpatient data, outpatient data, or both. Finally, he
> indicates whether he wants active prescriptions, expired ones, or both.
> These are the three parameters which are sent to the report: PatientID,
> Active, and FacilityID (which just means whether the patient is in the
> hospital, out of it, or both kinds of records should be returned).
>
> There is only one patient per report, but several prescriptions. One of
> the
> requirements for this report was that the patient name should be displayed
> in
> bold at the top of each page. Quoting from Brian Larson's book here:
>
> "You cannot place information from a dataset in the page
> header...directly!
> You can, however, put the value of a parameter in the page header. You
> can
> also use a dataset to specify the default value of a parameter.
> Therefore,
> using this two-step approach, we can put [a value from the dataset] into
> the
> page header."
>
> This is what I have done with the patient name. Given a PatientID, I
> query
> for patient data joined to prescription data; one of the returned fields
> is
> patient name. I create a PatientName parameter, set its default value to
> "From query", and from the report's only dataset make the parameter's
> value
> field "PatientName". Then I put a textbox on the page header and set its
> value to, ="Patient: " & Parameters!PatientName.Value. This displays the
> name of the patient at the top of each page. It works properly in the
> IDE.
> Only when I deploy and then reference the report by browser do I get the
> error.
>
>
> "Bruce L-C [MVP]" wrote:
>
>> If I understand this is what you are trying to do.
>>
>> One dataset is in the report that is based on three visible parameters.
>>
>> You are putting a value(s) from the dataset into an invisible parameter
>> because you want the value(s) to be in the header. Is this one or is it
>> multiple values?
>>
>> I am not familiar with this technique. You can't just use the First
>> aggregate in the header? (Which only works if you have a single record OR
>> the same value in each record).
>>
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>>
>> "Fred Sawtelle" <FredSawtelle@discussions.microsoft.com> wrote in message
>> news:45CE869C-BBC2-4C33-B0E5-3DD71991E228@microsoft.com...
>> > Okay. The datasource uses sql server authentication with a username
>> > and
>> > password that are valid for the referenced database. There is only one
>> > dataset for this report, and when I take out the internal parameter,
>> > the
>> > report accesses and displays data from it with no problem. Other
>> > thoughts?
>> >
>> > "Bruce L-C [MVP]" wrote:
>> >
>> >> Check the credentials for the datasource used by the dataset that uses
>> >> the
>> >> hidden parameter.
>> >
>>
>>
>>