Showing posts with label expressions. Show all posts
Showing posts with label expressions. Show all posts

Friday, March 23, 2012

How to reference datasets in custom code

Can datasets associated with a report be referenced in custom code? If so,
how? I've tried referencing them like one does in expressions in the report,
e.g., Fields!Personal_Amt_Paid.Value, but this does not work. I get the
error
"There is an error on line 6 of custom code: [BC30469] Reference to a
non-shared member requires an object reference."I doubt you can do it... The way you reference a parameter in code is
Report.Parameters!whatever...
So try Report.Dataset.something... How would it know which row?... probably
will not work...
you'll just have to pass the values in as parameters.
--
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
"Bob Kilmer" <Bob.Kilmer@.S.com> wrote in message
news:uODIYYrnFHA.1048@.tk2msftngp13.phx.gbl...
> Can datasets associated with a report be referenced in custom code? If so,
> how? I've tried referencing them like one does in expressions in the
> report,
> e.g., Fields!Personal_Amt_Paid.Value, but this does not work. I get the
> error
> "There is an error on line 6 of custom code: [BC30469] Reference to a
> non-shared member requires an object reference."
>