Crystal Rpt in application

G

gsauns

I have an application developed with ASP.NET 2.0.
I am using Crystal Reports 10 on another server and I've created a
report to test out.
I don't have Crystal for Visual Studio or anything like that, like
I've been seeing in my search for knowledge.

I added references in my project to:
CrystalDecisions.CrystalReports.Engine.dll
CrystalDecisions.Shared.dll
CrystalDecisions.Web.dll

I am now trying to get the report to display on an aspx page. I've
added a CrystalReportViewer to the page. I try to set the viewer's
ReportSource when the page loads, but it gives me a login page and
won't take my credentials.

How can I get around this?
 
G

gsauns

Here is the code I'm using:

protected void Page_Load(object sender, EventArgs e)
{
ReportDocument oRpt = new ReportDocument();
TableLogOnInfo tli;

try
{
oRpt.Load("path to report");

foreach (CrystalDecisions.CrystalReports.Engine.Table tbl
in oRpt.Database.Tables)
{
tli = tbl.LogOnInfo;
tli.ConnectionInfo.ServerName = "correct server name";
tli.ConnectionInfo.DatabaseName = "correct db name";
tli.ConnectionInfo.UserID = "usr";
tli.ConnectionInfo.Password = "pw";
tbl.ApplyLogOnInfo(tli);
}
crvRpt.ReportSource = oRpt;
// crvRpt is my CrystalReportViewer
}
catch (Exception ex)
{
lblError.Text = "Cannot load report - " + ex.Message;
}
}

When I open the page, it says "The report you requested requires
further information". It populates Server Name, Database Name, and
UserID. I enter the correct password, but that page just keeps
refreshing. I am using the credentials that work when I preview the
report within Crystal.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,920
Messages
2,570,038
Members
46,449
Latest member
onedumbsquirrel

Latest Threads

Top