Groups | Blog | Home
all groups > sql server reporting services > june 2005 >

sql server reporting services : Securing Report Parameters


CCF
6/27/2005 8:43:06 PM
I have a custom web app that will allow clients to launch a SQL RS report.
I'm trying to work out the details of how we will pass parameters into the
report from the ASP.Net web app.

Essentially, I don't want users to be able to alter the parameters to the
report as they will be generated from the ASP.Net app. I am thinking that
encrypting the parms would probably be best, and I have custom code to
encrypt/decrpt already.

Does anyone know what the best method to use to decrypt parameters in SQL RS
would be?

Thanks in advance.
--
Eric
6/28/2005 10:01:10 AM
I don't think it is really necessary to encrypt/decrypt your parameters. They
are passed so fast in the url nobody can change them (only catch them maybe
if they have the tools (and the will)).

I added the following function to the asp.net reportviewer control :

Public Sub SetQueryParameter(ByVal ParamName As String, ByVal ParamValue As
String)

SetParameter(ParamName, ParamValue)

End Sub

Then recompile and use the dll in your application. Use the function in your
code like so (where rptViewer is the name of your ReportViewer control:

rptViewer.SetQueryParameter("DBName", strDBName)

If you wish to encrypt the value, then do so.

In the Report editor, add a parameter named "DBName" with the prompt textbox
cleared (make sure you use sp1 on the server). Put your decryption function
in the Code tab in the report properties. And use your decrypt function
whenever you use the parameter.

Hope it helped (though i wasnt very precise hehe)

[quoted text, click to view]
AddThis Social Bookmark Button