Hello all...
I have a C# forms application that I am developing using MS Visual Studio 2005. I am trying to add some Crystal Reports to this application using the built in Crystal Reports tools with Visual Studio.
It seems like it should be pretty straight forward, but no matter what I do I can't get my reports to actually show data. Here's the info:
I created a crystal report viewer on a form. I created a crystal report that has a data source of a table in my database. Nothing fancy... just showing some of the fields from the table on the report. Whenever I use the preview button in the design of the report it fills it in with generic data (not pulling from my database).
I have the following code to load the report into the viewer:
At runtime it loads the report when I push the button, and I can see the data labels, but no data. All of my other database functions (and there are a lot of them) work fine in this application, so I know it's not a database connectivity problem. I think I'm just such a newbie to Crystal Reports, that I'm missing something.
Does anyone know what I'm missing? Is there a way I can preview this report and see real data in it (prior to runtime)? I would really appreciate any help.
If you need more details just let me know.
Thanks,
Rod
I have a C# forms application that I am developing using MS Visual Studio 2005. I am trying to add some Crystal Reports to this application using the built in Crystal Reports tools with Visual Studio.
It seems like it should be pretty straight forward, but no matter what I do I can't get my reports to actually show data. Here's the info:
I created a crystal report viewer on a form. I created a crystal report that has a data source of a table in my database. Nothing fancy... just showing some of the fields from the table on the report. Whenever I use the preview button in the design of the report it fills it in with generic data (not pulling from my database).
I have the following code to load the report into the viewer:
Code:
TestReport rptTest = new TestReport();
CrystalDecisions.Shared.ConnectionInfo crDbConnection = new
CrystalDecisions.Shared.ConnectionInfo();
crDbConnection.IntegratedSecurity = true;
crDbConnection.DatabaseName = "accessgwc";
crDbConnection.ServerName = "Access-server2";
CrystalDecisions.CrystalReports.Engine.Database crDatabase =
rptTest.Database;
CrystalDecisions.Shared.TableLogOnInfo oCrTableLoginInfo;
foreach (CrystalDecisions.CrystalReports.Engine.Table oCrTable in
crDatabase.Tables)
{
oCrTableLoginInfo = oCrTable.LogOnInfo;
oCrTableLoginInfo.ConnectionInfo = crDbConnection;
oCrTable.ApplyLogOnInfo(oCrTableLoginInfo);
}
crystalReportViewer1.ReportSource = rptTest;
Does anyone know what I'm missing? Is there a way I can preview this report and see real data in it (prior to runtime)? I would really appreciate any help.
If you need more details just let me know.
Thanks,
Rod
Comment