467,182 Members | 1,011 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,182 developers. It's quick & easy.

C# forms app - Crystal Reports question

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:

Expand|Select|Wrap|Line Numbers
  1. TestReport rptTest = new TestReport();
  2.             CrystalDecisions.Shared.ConnectionInfo crDbConnection = new
  3.               CrystalDecisions.Shared.ConnectionInfo();
  4.             crDbConnection.IntegratedSecurity = true;
  5.             crDbConnection.DatabaseName = "accessgwc";
  6.             crDbConnection.ServerName = "Access-server2";
  7.             CrystalDecisions.CrystalReports.Engine.Database crDatabase =
  8.               rptTest.Database;
  9.             CrystalDecisions.Shared.TableLogOnInfo oCrTableLoginInfo;
  10.             foreach (CrystalDecisions.CrystalReports.Engine.Table oCrTable in
  11.               crDatabase.Tables)
  12.             {
  13.                 oCrTableLoginInfo = oCrTable.LogOnInfo;
  14.                 oCrTableLoginInfo.ConnectionInfo = crDbConnection;
  15.                 oCrTable.ApplyLogOnInfo(oCrTableLoginInfo);
  16.             }
  17.  
  18.  
  19.             crystalReportViewer1.ReportSource = rptTest;
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
Apr 3 '08 #1
  • viewed: 1229
Share:
1 Reply
Sorry to bump this message, but I'm really hoping someone can lead me in the right direction.

Thanks in advance!
Apr 3 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by rAGHU | last post: by
1 post views Thread by Stephan | last post: by
2 posts views Thread by Ashish Shridharan | last post: by
2 posts views Thread by Phil | last post: by
4 posts views Thread by sklett | last post: by
1 post views Thread by =?Utf-8?B?VGVycnk=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.