473,320 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

ReportViewer Control Permission

AG
I am using a ReportViewer control in an ASP.NET 2.0 WAP aspx page in remote
processing mode.

The report server is on a shared web host.

Can anyone tell me or point me to an example of how to pass user name and
password to the report server via the ReportViewer control?

--

AG
Email: discuss at adhdata dot com
Sep 18 '07 #1
7 10744
Hi AG,

Have you tried ReportViewer.ServerReport.SetDataSourceCredentials :

http://msdn2.microsoft.com/en-us/lib...ebforms.server
report.setdatasourcecredentials(VS.80).aspx
Further reference:

#How to bypass/disable the authentication for reportviewer in a web form? -
MSDN Forums
http://forums.microsoft.com/MSDN/Sho...30501&SiteID=1
<quote>
You can disable prompting for data source credentials by using
ReportViewer.ShowCredentialPrompts = false. But you will still need to
manually supply the credentials to run the report using
ReportViewer.ServerReport.SetDataSourceCredentials ().
</quote>
Please feel free to let me know if there's anything unclear. Thanks.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
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.

Sep 19 '07 #2
AG
Thanks Walter.

As usual, help is wofully lacking on SetDataSourceCredentials, but it seems
like that applies to the report's datasource, not the report (server)
itself.

What I need is ReportServerCredentials.
I found this http://forums.asp.net/t/986174.aspx

When running the WAP on my development machine (Win XP IIS5), I can set the
report server to be the one on the shared web host and pass the credentials.
The reports work.
However, when I run the WAP on the shared web host and pass the same
credentials, I get the 401 unauthorized error.

Any ideas as to how to correct this?
--

AG
Email: discuss at adhdata dot com
""Walter Wang [MSFT]"" <wa****@online.microsoft.comwrote in message
news:UD***************@TK2MSFTNGHUB02.phx.gbl...
Hi AG,

Have you tried ReportViewer.ServerReport.SetDataSourceCredentials :

http://msdn2.microsoft.com/en-us/lib...ebforms.server
report.setdatasourcecredentials(VS.80).aspx
Further reference:

#How to bypass/disable the authentication for reportviewer in a web
form? -
MSDN Forums
http://forums.microsoft.com/MSDN/Sho...30501&SiteID=1
<quote>
You can disable prompting for data source credentials by using
ReportViewer.ShowCredentialPrompts = false. But you will still need to
manually supply the credentials to run the report using
ReportViewer.ServerReport.SetDataSourceCredentials ().
</quote>
Please feel free to let me know if there's anything unclear. Thanks.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
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.

Sep 20 '07 #3
Hi AG,

Sorry for the misunderstanding.

The new issue you mentioned is actually about how to make two IIS
server/web application accessing each other.

By default, a web application on IIS 6.0 runs in the default Application
Pool, which by default is running under the NETWORK SERVICE account. This
account is very limited, although it have network access, but you need to
grant it in either your local or remote sql/report server:

http://msdn2.microsoft.com/en-us/library/ms998320.aspx
<quote>
If you are accessing a database on another server in the same domain (or in
a trusted domain), the Network Service account's network credentials are
used to authenticate to the database. The Network Service account's
credentials are of the form DomainName\AspNetServer$, where DomainName is
the domain of the ASP.NET server and AspNetServer is your Web server name.

For example, if your ASP.NET application runs on a server named SVR1 in the
domain CONTOSO, the SQL Server sees a database access request from
CONTOSO\SVR1$.

To access a remote SQL Server using Network Service

To grant access to a remote database server in the same domain or a trusted
domain, follow the steps described earlier for a local database, except in
step 4, use the DomainName\AspNetServer$ account to create the database
login.
</quote>
Also:

http://msdn2.microsoft.com/en-us/library/ms998320.aspx
<quote>
In some scenarios, using a custom domain service account is a better
approach than using the Network Service account. You should use a custom
domain service account if:
You want to isolate multiple applications on a single server from one
another.
You need different access controls for each application on local and remote
resources. For example, other applications cannot access your application's
databases if access is restricted to your application's account.
You want to use Windows auditing to track the activity of each application
separately.
You want to prevent any accidental or deliberate changes to the access
controls or permissions associated with the general purpose Network Service
account from affecting your application.
</quote>

In this case, you will need to create a separate Application Pool in IIS
6.0 and configure it to use a custom domain service account; then configure
your web application to run in this Application Pool.

Pleaset let me know if you have anything unclear. Thanks.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
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.

Sep 20 '07 #4
AG
Thanks Walter,

The problem is not authenticating to the SQL Server, but to the report
server.
I am checking with the webhost to find out if both machines are on the same
domain.

So, lets say the 'WebServer' is on 'Domain1' and the 'ReportServer' is on
'Domain2'.
There are three parameters to pass to the NetworkCredential - username,
password and domain.
Obviously username and password would be that for a user on the ReportServer
with the appropriate permissions to view the report in question.
What do I pass for the domain parameter? Domain1, Domain2, Domain1\Webserver
or what?

What if they are on the same domain?

Why would it work from my machine? My machine is definitely not in the
ReportServer's domain.

--

AG
Email: discussATadhdataDOTcom
""Walter Wang [MSFT]"" <wa****@online.microsoft.comwrote in message
news:4p****************@TK2MSFTNGHUB02.phx.gbl...
Hi AG,

Sorry for the misunderstanding.

The new issue you mentioned is actually about how to make two IIS
server/web application accessing each other.

By default, a web application on IIS 6.0 runs in the default Application
Pool, which by default is running under the NETWORK SERVICE account. This
account is very limited, although it have network access, but you need to
grant it in either your local or remote sql/report server:

http://msdn2.microsoft.com/en-us/library/ms998320.aspx
<quote>
If you are accessing a database on another server in the same domain (or
in
a trusted domain), the Network Service account's network credentials are
used to authenticate to the database. The Network Service account's
credentials are of the form DomainName\AspNetServer$, where DomainName is
the domain of the ASP.NET server and AspNetServer is your Web server name.

For example, if your ASP.NET application runs on a server named SVR1 in
the
domain CONTOSO, the SQL Server sees a database access request from
CONTOSO\SVR1$.

To access a remote SQL Server using Network Service

To grant access to a remote database server in the same domain or a
trusted
domain, follow the steps described earlier for a local database, except in
step 4, use the DomainName\AspNetServer$ account to create the database
login.
</quote>
Also:

http://msdn2.microsoft.com/en-us/library/ms998320.aspx
<quote>
In some scenarios, using a custom domain service account is a better
approach than using the Network Service account. You should use a custom
domain service account if:
You want to isolate multiple applications on a single server from one
another.
You need different access controls for each application on local and
remote
resources. For example, other applications cannot access your
application's
databases if access is restricted to your application's account.
You want to use Windows auditing to track the activity of each application
separately.
You want to prevent any accidental or deliberate changes to the access
controls or permissions associated with the general purpose Network
Service
account from affecting your application.
</quote>

In this case, you will need to create a separate Application Pool in IIS
6.0 and configure it to use a custom domain service account; then
configure
your web application to run in this Application Pool.

Pleaset let me know if you have anything unclear. Thanks.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
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.

Sep 21 '07 #5
Hi AG,

Not sure if it's the same issue, but give it a try:

#The request failed with HTTP status 401: Unauthorized? in
dotnet.framework.aspnet.webservices
http://msdn.microsoft.com/newsgroups...icrosoft.publi
c.dotnet.framework.aspnet.webservices&tid=e1dcda98-a208-430c-96ed-a35e0a2460
25&m=1&p=1
<quote>
This solution solved my problem:
http://aspadvice.com/blogs/ssmith/ar...ting-Services-
401-Error.aspx
</quote>

Basically it's fixed by this KB:

#You receive error 401.1 when you browse a Web site that uses Integrated
Authentication and is hosted on IIS 5.1 or IIS 6
http://support.microsoft.com/default...b;en-us;896861
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
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.

Sep 21 '07 #6
AG
Walter,

I have found out that the report server and web server are the same machine,
so I don't understand why there should be a problem, especially since
running the web app on my machine (far removed from both), the reports work
fine.

Since it works from my development machine, could it be that something needs
to be different in the passed network credential when the web app and report
server are on the same machine?

I am passing the credential using the code from
http://forums.asp.net/t/986174.aspx.
--

AG
Email: discussATadhdataDOTcom
""Walter Wang [MSFT]"" <wa****@online.microsoft.comwrote in message
news:In*************@TK2MSFTNGHUB02.phx.gbl...
Hi AG,

Not sure if it's the same issue, but give it a try:

#The request failed with HTTP status 401: Unauthorized? in
dotnet.framework.aspnet.webservices
http://msdn.microsoft.com/newsgroups...icrosoft.publi
c.dotnet.framework.aspnet.webservices&tid=e1dcda98-a208-430c-96ed-a35e0a2460
25&m=1&p=1
<quote>
This solution solved my problem:
http://aspadvice.com/blogs/ssmith/ar...ting-Services-
401-Error.aspx
</quote>

Basically it's fixed by this KB:

#You receive error 401.1 when you browse a Web site that uses Integrated
Authentication and is hosted on IIS 5.1 or IIS 6
http://support.microsoft.com/default...b;en-us;896861
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
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.

Sep 24 '07 #7
Hi AG,

I'm glad to hear to that the issue is not solved. Thanks for sharing the
cause here.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
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.

Sep 27 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Raghu | last post by:
I have developed a web portal that uses ReportViewer web control to connect to a remote SQL 2005 Report server and displays the reports on the client side. The asp.net page has been coded to...
1
by: steve | last post by:
Hi All I need help on how to manipulate the data returned from the database for displaying in the new reportviewer at runtime So far I have an rdlc file with a dataset, binding source and...
4
by: Sevu | last post by:
I am working with ASP.NET.I am using ReportViwer Control to show my report.I like to add dropdownlist with in the reportviewer control. ( Not top to the control some thing like that).I need to...
1
by: Rich | last post by:
Hello, I am trying to use the Reportviewer control. I have been following an example from the web, and the instructions from the help files on set up a ..rdlc and binding it to the reportviewer...
0
by: Rich | last post by:
Hello, I started using the Reportviewer control (very nice) for generating Reporting Services type reports in my VB2005 app. I have been experimenting using a designer Reportviewer control from...
0
by: Fred G. Sanford | last post by:
Firstly, I am a fairly new .Net developer, so please excuse any dumb/ignorant questions or comments. Thanks. I created a VWD Express project, which uses the ReportViewer control, on my local...
10
by: AG | last post by:
I am trying to use a ReportViewer control in a VS 2005 web application project (not Website project). When I try to create a new report (local), I can't seem to find any method to create a...
1
by: ajaykhedekar | last post by:
I am Showing Mulitple MSRS Reports on Single ASP.Net WEB Page using Mulitple ReportViewer Controls. If User wants to Print the Reports, then user has to click Print button provided by ReportViewer...
5
by: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== | last post by:
I have a VS 2008 ASP.NET webform that has a reportview tag on it, accessing an .RLDC report in local report. The columns for the report are essentially: Month Item #1 Item#2 Item#3 ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.