Click here to Skip to main content
Sign Up to vote bad
good
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:34
Edited 17 Mar '10 - 22:03


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:
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.
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 315
1 Aarti Meswania 250
2 Slacker007 240
3 Sergey Alexandrovich Kryukov 219
4 Ron Beyer 190
0 Sergey Alexandrovich Kryukov 8,743
1 OriginalGriff 7,124
2 CPallini 3,678
3 Rohan Leuva 3,011
4 Maciej Los 2,403


Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 19 Mar 2010
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid