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..
Thanku
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
Sanjay33
Member
6 Points
8 Posts
Crystal Report & SQL Server Windows Authentication
Dec 20, 2011 11:52 AM|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
necro_mancer
Star
8089 Points
1590 Posts
Re: Crystal Report & SQL Server Windows Authentication
Dec 21, 2011 05:13 AM|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
Professional SQL 2008 R2 Service
Sanjay33
Member
6 Points
8 Posts
Re: Crystal Report & SQL Server Windows Authentication
Apr 26, 2012 10:27 AM|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
narasappa
Participant
960 Points
458 Posts
Re: Crystal Report & SQL Server Windows Authentication
Apr 26, 2012 01:29 PM|LINK
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 helpravi.jadiyannavar@gmail.com
Pls Mark This Post As Answer If it Helps U..
Thanku
Sanjay33
Member
6 Points
8 Posts
Re: Crystal Report & SQL Server Windows Authentication
Apr 27, 2012 06:16 AM|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
geeknout
Member
123 Points
154 Posts
Re: Crystal Report & SQL Server Windows Authentication
Jun 13, 2012 04:03 PM|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?