Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
I am using SQL 2005 as the database server which required authentication.
When i tried to open a crystal report in a client browser it prompts and asks for user name and password of the sql database. I have already filled these information in the CrystalReport "database expert" windows. I don't want this authentication prompt in the client.
How should I prevent this?
Posted
Updated 17-Mar-10 22:03pm
v3

1 solution

I had this same trouble in a program that I worked on a while back, but I use an Access database. I had designed a database to use for printing but never actually planned to use it to put data into it. It was just so I could design a report, and then in the program I would create an in-memory dataset that matched the database design and pass it to the crystal report. The problem seemed to come down to the fact that the program is expecting the machine it's running on to have that database in the same location as my computer when I designed it. So what I had to do was include that design database as part of my deployment and then in code point the ReportDocument object to where it would be located on the users machine. Something like this:
VB
Dim strSchemaPath As String = My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData & System.IO.Path.DirectorySeparatorChar & "MySchemaDatabase.mdb"
Dim cdReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument
cdReportDocument.DataSourceConnections.Item(0).SetConnection(strSchemaPath, "", False)
cdReportDocument.SetDataSource(dsMyDataSet)


I have a feeling there must be a better way to get around this issue, but after searching for quite a while and finding nothing I just went with this. Hopefully this will at least help you continue your search if it doesn't work for SQL 2005 or for your specific program requirements.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900