Monday, March 19, 2012

explicit row access

I have a dataset with multiple tables. The datatable 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.
That is can I do an vbscript filter expression against the dataset so I only
get the desired row value?
Best regards
Alekif you realy want to put it in a textbox you should solve this in the query.
If you use a list, table or matrix you can add a filter: Fields!NAME.Value ="iUnits"
"Alek Lynge" wrote:
> I have a dataset with multiple tables. The datatable 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.
> That is can I do an vbscript filter expression against the dataset so I only
> get the desired row value?
> Best regards
> Alek
>
>

No comments:

Post a Comment