R
Rey
Howdy all.
Using VSNet 2003 on an XP Pro SP2 boox. Trying to use Crystal Reports
to access an mdb file with access security/workspace.
Simple report of customers but after spending mucho time researching -
but still not knowing why/what caused it -a load report failed err,
read some articles and this problem was resolved.
Now I have a logon failed err. Code below was modified for C# from
article in dotnetjunkies "Creating Reports using Crystal Reports for
Visual Studio .NET."
Appreciate any suggestions/comments on how to resolve this err and
finally display the simple report.
Below is the code used to display report. The rem'ed VB code is from
the article.
Thank you,
Rey
*******************
protected CrystalDecisions.Web.CrystalReportViewer
CrystalReportViewer1;
//CrystalDecisions.CrystalReports.Engine.Table myTable;
//CrystalDecisions.Shared.TableLogOnInfo myLogin;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
// in order to not receive a logon failed err msg
// need to use following code to incl the 2 lines above
rptTest rpt = new rptTest(); // var of rpt
// CrystalDecisions.CrystalReports.Engine.Table myTable;
CrystalDecisions.Shared.TableLogOnInfo myLogin;
foreach (CrystalDecisions.CrystalReports.Engine.Table myTable in
rpt.Database.Tables)
{
myLogin = myTable.LogOnInfo;
myLogin.ConnectionInfo.Password = "12345";
myLogin.ConnectionInfo.UserID = "aUser";
myTable.ApplyLogOnInfo (myLogin);
}
CrystalReportViewer1.ReportSource = rpt;
this.DataBind();
}
}
/*
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
crpt = New CrystalReport1()
For Each myTable In crpt.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.Password = "test"
myLogin.ConnectionInfo.UserID = "sa"
myTable.ApplyLogOnInfo(myLogin)
Next
CrystalReportViewer1.ReportSource = crpt
*/
Using VSNet 2003 on an XP Pro SP2 boox. Trying to use Crystal Reports
to access an mdb file with access security/workspace.
Simple report of customers but after spending mucho time researching -
but still not knowing why/what caused it -a load report failed err,
read some articles and this problem was resolved.
Now I have a logon failed err. Code below was modified for C# from
article in dotnetjunkies "Creating Reports using Crystal Reports for
Visual Studio .NET."
Appreciate any suggestions/comments on how to resolve this err and
finally display the simple report.
Below is the code used to display report. The rem'ed VB code is from
the article.
Thank you,
Rey
*******************
protected CrystalDecisions.Web.CrystalReportViewer
CrystalReportViewer1;
//CrystalDecisions.CrystalReports.Engine.Table myTable;
//CrystalDecisions.Shared.TableLogOnInfo myLogin;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
// in order to not receive a logon failed err msg
// need to use following code to incl the 2 lines above
rptTest rpt = new rptTest(); // var of rpt
// CrystalDecisions.CrystalReports.Engine.Table myTable;
CrystalDecisions.Shared.TableLogOnInfo myLogin;
foreach (CrystalDecisions.CrystalReports.Engine.Table myTable in
rpt.Database.Tables)
{
myLogin = myTable.LogOnInfo;
myLogin.ConnectionInfo.Password = "12345";
myLogin.ConnectionInfo.UserID = "aUser";
myTable.ApplyLogOnInfo (myLogin);
}
CrystalReportViewer1.ReportSource = rpt;
this.DataBind();
}
}
/*
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
crpt = New CrystalReport1()
For Each myTable In crpt.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.Password = "test"
myLogin.ConnectionInfo.UserID = "sa"
myTable.ApplyLogOnInfo(myLogin)
Next
CrystalReportViewer1.ReportSource = crpt
*/