CrystalDecisions.CrystalReports.Engine.LogOnException: Logon faile

G

Guest

i am having problems running a sub report in crystal reports using visual
studio 2003.

The first report fires one stored procedure in sql server 2005 and it has 2
levels of groupings then it runs a sub report using the group data.

I have tried the:
Report.SetDatabaseLogon(rptLogin, rptPassword, rptServer, rptDatabase);
It works on the main report, i have also put the code in the .cs file for
the sub report and it is producting the error.

I have tried new sub reports, imported subreports and all produce the error.

I also have tried looping thru the tables and it can only find the table on
the main report and not the sub report.
 
G

Guest

Thanks.
That got me pointed in the right direction.

Here is the code that I had to use to solve this:

Report.SetDatabaseLogon(rptLogin, rptPassword, rptServer, rptDatabase);
ReportDocument subreport;
subreport = Report.OpenSubreport("rptStudentAveragesSub.rpt");
subreport.SetDatabaseLogon(rptLogin, rptPassword, rptServer, rptDatabase);

It is running a little on the slow side but I think that maybe something
else.
 

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
474,434
Messages
2,571,689
Members
48,796
Latest member
Greg L.

Latest Threads

Top