By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,069 Members | 1,716 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,069 IT Pros & Developers. It's quick & easy.

Crystal Report Permissions

P: n/a
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.

-----Original Message-----
I have a crystal report file that I am loading and viewing through ASP .NETusing the crystalreportviewer control. Whenever I run the report I getprompted with the Win2K network logon dialog. What's strange is as I amprompted to login to the server the report continues to run and actuallydisplays the results of the report behind the prompt. Logging in makes theprompt 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 tothe folder in which the report lives and have tried about everythingpossible permissions wise with no luck. The website allows anonymousaccess.

Any help would be greatly appreciated.

Thanks
.

Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
"codepuller" <co********@hotmail.com> wrote in message
news:09****************************@phx.gbl...
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.

-----Original Message-----
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
.

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.