Groups | Blog | Home
all groups > sql server reporting services > october 2005 >

sql server reporting services : Fetch a certain row


Wayne Snyder
10/24/2005 6:50:28 AM
Where do you select the name for which you want the value

You could do this with a parameter which displays the name and returns the
value. Then in the Text box
=Parameters!myparam.value

You could maybe filter the where clause in the sql or in the data set..

You could write a funcion which accepts some value and returns the name of
the field in the data set... Then use

=Fields(Code.GetFieldname("mypassedinvalue")).Value in the textbox

Hope this helps... If I do not understand your question, please send more
details
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)

I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org

[quoted text, click to view]

Alek Lynge
10/24/2005 1:08:22 PM
Hi.
I have a dataset with a two column table:
name | value

What I'm trying to do is to make a textbox in the report designer to fetch a
certain field (value) from the table based on the name field.
How to fetch that certain cell from the dataset.
Any help appreciated.
Alek

Alek Lynge
10/24/2005 4:12:02 PM
Hi, Wayne.

Thanx for your quick answer. However I'm still a bit lost in the VBScript
world, as I'm usually coding in c#.

It is easiest to explain with a sample data example:

I have a dataset with multiple tables. The one I need is called
InvoiceTemplate and has its tableadapter implemented to fetch data from the
sql server backend with a stored proc, which accepts a single parameter: an
integer determining the country.

When the dataset is filled I get the following data in my InvoiceTemplate
table:

Columns: name, value

Sample data (ntext, ntext):

'iName', 'Lene Espersen'

'iNumber', 'Faktura nr.'

'iUnits', 'Antal'

'iPrice', 'Pris'

Etc.

So I've got a textbox in the report designer which I need to fill with the
value from the row containing 'iUnits' (get the data 'Antal')?

How to make an elegant expression solution to this? Essentially I'm trying
to escape from table pivoting, as sql server 2000 has poor support for that.

Best regards

Alek

[quoted text, click to view]

AddThis Social Bookmark Button