Link to home
Start Free TrialLog in
Avatar of PFrog
PFrogFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Shared data source details within a reporting services custom code function

I'm successfully querying my database from within a custom code function within an SSRS 2005 report.

My problem is that I'm hard coding the connection string within the function (System.Data.SqlClient.SqlConnection) - I need to be able to use the same connection as the shared data source that the report uses. I could grab the details from a registry setting or some other work around, but for tidyness and simplicity I really want to get the code to seemlessly talk to the same database.

I either need to pass in the connection details as a parameter to the function, or get the details from within the function - either would be fine.

Anyone got any ideas?...
Avatar of Ved Prakash Agrawal
Ved Prakash Agrawal
Flag of India image

http://www.code-magazine.com/article.aspx?quickid=0701061&page=2

please just check it out this site may be help full for you.
Avatar of PFrog

ASKER

Thanks ved17nov, but that shows how to get what I already have - a static, hard coded connection string.

I'm trying to make the code dynamically set its own connection string to be the same as the shared data source.
Avatar of PFrog

ASKER

I have to say, I don't think it is possible - however with the combined genius of all our experts I'm hoping someone will come up with something!
Avatar of Chris McGuigan
I can't help you outright. But if there is a way to hook into the reports security/connection try trawling through the Microsoft.ReportingServices namespace, I would expect an object or method in there to allow you to do it - after all it's what Reporting Services itself is going to be using.

Cheers
Chris
ASKER CERTIFIED SOLUTION
Avatar of PFrog
PFrog
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No probs.

Cheers
Chris