do you run your own server or do you host your crystal report on a shared server? If you host it on a shared server, you need to ask your host to check on the folder permission
hope this helps u
protected void Page_Load(object sender, EventArgs e)
{
ReportDocument crystalReport = new ReportDocument();
crystalReport.Load(Server.MapPath("CrystalReport.rpt"));
crystalReport.SetDatabaseLogon("username", "password", @"server name", "DB name");
CrystalReportViewer1.ReportSource = crystalReport;
}
try this hope it will help
Narasappa C J
ravi.jadiyannavar@gmail.com
Pls Mark This Post As Answer If it Helps U..
Hate to resurect this thread, but I have been looking for something similar. I don't want to pass a set username and password, I want to pass the one they are logged in as.. This works fine if I hard set the information, but what about passing it through?
"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction. " - Einstein
None
0 Points
8 Posts
Crystal Report & SQL Server Windows Authentication
Dec 20, 2011 07:52 AM|Sanjay33|LINK
HI All!
I am having trouble using Windows Authentication with Crystal report.
I have web Application that will display the report on the browser at runtime
It works fine when I used Sql server authentication, but we need to support windows authentication as well.
And when i am trying to do Windows Authentication, it is prompting me again and again for DB creadintials.
If I give the windows Domain user credintials it works, I don't really understand why it is not working without userid and pass.
But the same is working if am using it on windows desktop application.
I would like to know is it possible to work with crystal reports using windows authentication on web application?
I am using VS 2010 & CR 13.0
Thanks
Sanjay Pant
.Net Developer
Contributor
5231 Points
1602 Posts
Re: Crystal Report & SQL Server Windows Authentication
Dec 21, 2011 01:13 AM|necro_mancer|LINK
hi sanjay,
do you run your own server or do you host your crystal report on a shared server? If you host it on a shared server, you need to ask your host to check on the folder permission
None
0 Points
8 Posts
Re: Crystal Report & SQL Server Windows Authentication
Apr 26, 2012 06:27 AM|Sanjay33|LINK
Issue is with the report file not in the way I am trying to connect.
For windows authentication we need diffrent report file, it seems the rpt file is itself containing the db metadata info.
I can't use Sql server auth report on windows auth connection.
Moreover I have to define windows user name and password while trying to connect, and after that everything work like a charm.
Thanks
Sanjay Pant
.Net Developer
Member
582 Points
494 Posts
Re: Crystal Report & SQL Server Windows Authentication
Apr 26, 2012 09:29 AM|narasappa|LINK
ravi.jadiyannavar@gmail.com
Pls Mark This Post As Answer If it Helps U..
None
0 Points
8 Posts
Re: Crystal Report & SQL Server Windows Authentication
Apr 27, 2012 02:16 AM|Sanjay33|LINK
Thx! narasappa
I was doing the same thing but the problem is with report file and that was resolved now.
Thanks
Sanjay Pant
.Net Developer
Member
21 Points
153 Posts
Re: Crystal Report & SQL Server Windows Authentication
Jun 13, 2012 12:03 PM|geeknout|LINK
Hate to resurect this thread, but I have been looking for something similar. I don't want to pass a set username and password, I want to pass the one they are logged in as.. This works fine if I hard set the information, but what about passing it through?