Crystal Report Permissions

R

Ryan Reilly

I have a crystal report file that I am loading and viewing through ASP .NET
using the crystalreportviewer control. Whenever I run the report I get
prompted with the Win2K network logon dialog. What's strange is as I am
prompted to login to the server the report continues to run and actually
displays the results of the report behind the prompt. Logging in makes the
prompt go away but doesn't seem to have any affect on the report being run.
I have given the ASPNET and IUSER_<machinename> user accounts permissions to
the folder in which the report lives and have tried about everything
possible permissions wise with no luck. The website allows anonymous
access.

Any help would be greatly appreciated.

Thanks
 
C

codepuller

Consider this approach:

Embed the report in your project (add it to the project)

Then put this code in the page that holds the viewer
control

'Set the connection information
crConnectionInfo.ServerName = "servername"
crConnectionInfo.DatabaseName = "dbname"
crConnectionInfo.UserID = "user"
crConnectionInfo.Password = "pass"

'Set the report up
Dim crReportDocument As New yournameofreport
'Set the database to the report
crDatabase = crReportDocument.Database
crTables = crDatabase.Tables

'loop through the tables of the report
For Each crTable In crTables
crtablelogoninfo = crTable.LogOnInfo
crtablelogoninfo.ConnectionInfo = crConnectionInfo
crTable.ApplyLogOnInfo(crtablelogoninfo)
Next

'Set the report in the viewer
crvMain.ReportSource = crReportDocument

crvMain.ReportSource = New yournameofreport
crvMain.SelectionFormula = "???"

crvMain.DisplayGroupTree = False
crvMain.BestFitPage = True
crvMain.RefreshReport()

This works great if your database is MSSQL, you might
have to tweak the connection info if your using a
different database. Search on Seagates (Crystal Reports)
site for dynamically connecting to a database and you
will find this same logic. Hope this helps.
 
R

RCR

Thanks for the suggestion.

I was actually able to solve my problem but created another one in the
process. When I created the web setup package to install all the crystal
stuff on my server it created the virtual directory
CrystalReportWebFormViewer2. As a result, when I loaded a report I would
get prompted for a network login but the report and crystal toolbar icons
would still display. If I rename the virtual directory to just
CrystalReportWebFormViewer I no longer get the network login dialog but the
toolbar icons don't show up because they are pointing to the
CrystalReportWebFormViewer2 virtual directory. Alas, I can't find anywhere
on the server where the toolbar would reference the
CrystalReportWebFormViewer2 path.

Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top