Showing posts with label app. Show all posts
Showing posts with label app. Show all posts

Friday, March 30, 2012

passing parameter FROM REPORT TO WINDOWS APP

Hi all. Is it possible to pass parameter FROM Report to my windows application(C#) ? Report is made in Business Intelligence Project. I just want to retrieve the total row number to my windows appication. Is it possible? If yes, Can you provide codes for this? Thanks. Your help would be highly appreciated.

-Ron-

Yes you can pass parameter values from your report to your windows application.

Have a default value for your parameter which is the count of rows of the table and then use Values property of ReportParametersInfo class ro retrieve the value.

Shyam

|||Excluding creative approaches such as exporting the report to HTML and parsing the HTML payload, in general the user has to initiate an action explicitly in the report. Then, assuming you use the Windows Report Viewer, you can sink the event. See the hypelink example in this article.|||

Shyam - I have no idea of what you are saying. Can you provide me sample codes for this? thanks.

Teo Lachev - yes i am using windows report viewer. can't find the hyperlink example in link you gave.

Please Help me....

-Ron-

|||In the link I gave you, there is another link that will bring you to a DevX article. From there you can download a code sample that shows how to sink a hyperlink event.

Wednesday, March 21, 2012

passing credentials from asp.net app to RS

Hello All,

I am embedding reports in a Web Application using the ReportViewer control. The Web Application and the ReportServices reside on different machines on the same network. The settings on the ReportServices IIS are Windows Integrated Authentication and anonymous access is disabled.

When I access the reports from my Web Application, I get windows pop-up asking for credentials. I am using impersonation to pass the credentials to the reporting services. But somehow the credentials are not passed to the report server and the pop-up shows up always. I am trying to get rid of the pop-window. Can somebody help??

Does using any other forms of authentication help?

THanks
Imran

How are you displaying the report in your web app? Just a link, or something different? I'm thinking this might be the double hop problem, so you might want to impersonate a service account that's specific for that report.|||I am displaying the report using the reporviewer control.
I am using impersonation in my web app. The same account also exists in the Report server machine. You are right I think it is a double hop problem. But I dont know how to solve it. I think we should use the Soap method to display the reports instead of the URL Access method
Thanks
Imran|||

With the report viewer impersonation settings don't matter - the report viewer sends the client's browser directly to the report server. Is everyone on the domain? Is the client browser setup to login automatically for the zone the report server is in?

|||

What you need is called Pass Through Authentication. Try the links below for more info. Hope this helps.
http://www.iisanswers.com/articles/enablepassthrough.htm

http://www.codeproject.com/aspnet/PassThroughSecurity.asp

Friday, March 9, 2012

passing a binary value to sql server 2005

I have been pulling my hair out on this.

I am trying to pass a binary value from an ASP.NET app to a VERY simple stored proc, and I can NOT get it to work!

Here is some of my code:

Code Snippet

ALTERPROCEDURE [dbo].[sp_SelectAppointments] @.PID VarChar(50)

AS

BEGIN

--set @.PID = 0x00000000000000B1

--PLEASE NOTE HERE THAT THE ABOVE VALUE(WHEN UNCOMMENTED) RETURNS RECORDS

--WHEN THE VALUE IS IN QUOTES (AS IT WOULD BE) IT DOES NOT WORK

SETNOCOUNTON;

SELECT Appt_Date, Appt_Description, Rn_Appointments_Id

FROM Rn_Appointments

WHERE project = @.PID --Project is a binary field.

END

I created a Dataset in VS2005, and here is the code that passes the value to the Dataset:

Code Snippet

Dim PID As String = Request.QueryString("pid")

PID = "0x00000000000000B1"

Dim da2 AsNew sp_SelectAppointmentsTableAdapter

GridView1.DataSource = da2.GetData2(PID)

GridView1.DataBind()

What am I missing? Can anybody please help me out here?

Thank you.

Steve

You are capturing the incoming parameter as varchar() and they attempting to equate a varchar() to a binary in the WHERE clause filter.

Have you attempted with a binary input parameter datatype?

Or, convert the parameter to binary inside the procedure?

ALTERPROCEDURE [dbo].[sp_SelectAppointments] @.PID binary

or

WHERE project = cast( @.PID as binary )

Wednesday, March 7, 2012

Pass user credentials RS web service?

I'm using the RS web service to pull back customized reports via a C#
app, which is running under a service account.
I need to pass in the user's credentials to the Render method to make
sure the user has been given access to the report on the Security tab
of the front end.
If I pass the default credentials, the service account's credentials
are used.
Can anyone help? Many thanks.
BurtYou need to create an instance of System.Net.NetworkCredential.
Try:
rs.Credentials = new System.Net.NetworkCredential(UserName, Password);
instead of:
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
"Burt" wrote:
> I'm using the RS web service to pull back customized reports via a C#
> app, which is running under a service account.
> I need to pass in the user's credentials to the Render method to make
> sure the user has been given access to the report on the Security tab
> of the front end.
> If I pass the default credentials, the service account's credentials
> are used.
> Can anyone help? Many thanks.
> Burt
>|||David,
Thanks, but how do I get the current user's password? I'm using windows
authentication on this intranet app.
Burt|||FYI, the solution was:
WindowsImpersonationContext windowsImpersonationContext = null;
WindowsIdentity currentIdentity =(WindowsIdentity)Thread.CurrentPrincipal.Identity;
windowsImpersonationContext = currentIdentity.Impersonate();
MyService.Credentials =System.Net.CredentialCache.DefaultCredentials;
windowsImpersonationContext.Undo();
windowsImpersonationContext = null;

Saturday, February 25, 2012

Pass concatenated string to SPROC

Hello,

We are creating an app to search through products. On the presentation layer, we allow a user to 'select' categories (up to 10 check boxes). When we get the selected check boxes, we create a concatenated string with the values.

My question is: when I pass the concatenated string to the SPROC, how would I write a select statement that would search through the category field, and find the values in the concatenated string?

Will I have to create Dynamic SQL to do this?...or... can I do something like this...

@.ConcatenatedString --eg. 1,2,3,4,5,6,7

SELECT col1, col2, col3 FROM TABLE WHERE CategoryId LIKE @.ConcatenatedString

Thanks for your help.you need to use IN.

hth|||You can to dynamically build an SQL string using the IN keyword and then execute it. Or, you can build a function to parse the list and return a table of category ids. Then use you IN clause with a select statement from the table or you could join to the table that's returned. I'd just do the dynamic SQL, but you could try both to see what's faster in your situation.

Pass a parameter to SSIS from .NET App

I'd like to pass a parameter value from a ASP.NET application to an SSIS package. My SSIS package pulls data from SQL and loads it a flat file based on the parameter value.

Is this possible?

Very much possible.

Check out the example @. http://www.codeproject.com/useritems/CallSSISFromCSharp.asp

More details on "Loading and Running a Package Programmatically " @. http://msdn2.microsoft.com/en-us/library/ms136090.aspx

Thanks,
Loonysan

|||Sweet! Thanks :)