Getting UserEmail in compiled dashboard

Creating a dashboard to send emails with attached spreadsheets.
using the object explorer, for the session object there is a UserEmail property
trying to view the data using the code presented in the object explorer gives an error
code: string from = MainController.Session.UserEmail;

error: ‘object’ does not contain a definition for ‘UserEmail’ and no extension method ‘UserEmail’ accepting a first argument of type ‘object’ could be found (are you missing a using directive or an assembly reference?)

am I barking up the wrong tree? - I would hate to have to put a textbox on the dashboard for the user to enter their own email address :frowning:

I would offer that this should be moved to an SSRS Report with Excel output. And, most admins would prefer that Spreadsheets not be emailed, but provided as a link.

That being said, the session object is best accessed via oTrans.CoreSession. This gives you the correct object cast. I can’t guarantee the UserEmail is there though.

1 Like