all groups > sql server reporting services > june 2006 >
You're in the

sql server reporting services

group:

OnInit use of Report.User!UserId



OnInit use of Report.User!UserId RobertHillEDS
6/6/2006 7:45:02 AM
sql server reporting services: This code is placed in the Report Properties / Code window.

Running this is vs2003 IDE.

Dim strUser as string

Protected Overrides Sub OnInit()
struser = str(report.user!userid)
'plan on passing the userid to a custom class : 'objRwh.MyInit(struser )
End Sub

The dialog box error received:
Failed to load expression host assembly. Details: Specified argument was out
of the range of valid values.

Environment:
Sql Server 2000, RS2000 with all service packs, vs2003 all running on the
same windows xp pro box.

--
Thank You.
RE: OnInit use of Report.User!UserId weilu NO[at]SPAM online.microsoft.com
6/7/2006 4:54:56 AM
Hi Robert,

Thank you for your posting.

Would you please try to Initialize your custom assembly object by using the
following code:

<Code>
Dim m_myClass As MyClass

Protected Overrides Sub OnInit()
m_myClass = new MyClass(User!UserID)
End Sub
</Code>

Please refer the following article:

Initializing Custom Assembly Objects
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/
rsp_prog_rdl_7gma.asp

Hope this will be helpful!

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
RE: OnInit use of Report.User!UserId RobertHillEDS
6/7/2006 1:31:02 PM
Thank You.

This works: m_myClass = new MyClass(Report.User!UserID)

This does NOT work: m_myClass = new MyClass(User!UserID)

Is there a reference that needs to be setup to 'Report'?

--
Robert Hill


[quoted text, click to view]
RE: OnInit use of Report.User!UserId weilu NO[at]SPAM online.microsoft.com
6/8/2006 5:40:26 AM
Hi Robert,

Thanks for the update.

I think you need to use reference "Report" since it's a globally defined
member.

If you have any questions or concerns, please feel free to let me know.

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


AddThis Social Bookmark Button