Click here to Skip to main content
13,042,166 members (93,006 online)
Rate this:
Please Sign up or sign in to 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 17-Mar-10 21:34pm
Updated 17-Mar-10 22:03pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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:
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)

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 19 Mar 2010
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100