Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: Data not showing up Post Reply Post New Topic
Page  of 2 Next >>
Author Message
Ralph55
Newbie
Newbie
Avatar

Joined: 21 Dec 2012
Online Status: Offline
Posts: 9
Quote Ralph55 Replybullet Topic: Data not showing up
    Posted: 21 Dec 2012 at 5:15pm
Hello,

I am using VS 2010 Professional Ultimate with the free CR for VS 2010 component. My data is in a SQLServerCE 3.5 dB. When I use the wizard, I have no problem with CR connecting to the dB, but when I view the report, no records show up.

I'm getting numerous warnings. Here are some:

Warning     1     A reference was created to embedded interop assembly 'CrystalDecisions.ReportAppServer.ClientDoc' because of an indirect reference to that assembly from assembly 'CrystalDecisions.CrystalReports.Engine'. Consider changing the 'Embed Interop Types' property on either assembly.     CrystalReportsApplication1
Warning     2     A reference was created to embedded interop assembly 'CrystalDecisions.ReportAppServer.ClientDoc' because of an indirect reference to that assembly from assembly 'CrystalDecisions.ReportAppServer.DataSetConversion'. Consider changing the 'Embed Interop Types' property on either assembly.     CrystalReportsApplication1
Warning     3     A reference was created to embedded interop assembly 'CrystalDecisions.ReportAppServer.ClientDoc' because of an indirect reference to that assembly from assembly 'CrystalDecisions.ReportSource'. Consider changing the 'Embed Interop Types' property on either assembly.     CrystalReportsApplication1

What am I doing wrong?


Thanks,

Ralph55

Edited by Ralph55 - 22 Dec 2012 at 2:44am
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 28 Dec 2012 at 3:37am
Go to the References section of your project.  Select each "CrystalDecisions.*" reference in your project, go to the Properties for the reference and change "Embed Interop Types" to False.
 
-Dell
IP IP Logged
Ralph55
Newbie
Newbie
Avatar

Joined: 21 Dec 2012
Online Status: Offline
Posts: 9
Quote Ralph55 Replybullet Posted: 28 Dec 2012 at 6:54am
Thanks for the suggestion. I set the "Embed Interop Types" to False for each "CrystalDecisions" reference, and I still get 16 warnings and no data showing up.

Is there a way I could send you the project?


Thanks,

Ralph
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 28 Dec 2012 at 7:12am
Actually, just post the code that you're using to connect the report to the data and view it.
 
-Dell
IP IP Logged
Ralph55
Newbie
Newbie
Avatar

Joined: 21 Dec 2012
Online Status: Offline
Posts: 9
Quote Ralph55 Replybullet Posted: 28 Dec 2012 at 1:07pm
Hi, Dell,

Actually, there is no code. I created a new Crystal Report solution, the report wizard opened, I connected to a dataset, selected the fields I wanted in the report, added all of the Crystal references, and hit run. I know there is a record in the dataset as I can see it in the Data Source window (I right click the table, then Preview Data and it shows up)

Thanks,

Ralph
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 03 Jan 2013 at 11:49am
You need to set the data source of the report in code prior to viewing it.  Are you using the CrystalView object model or the ReportDocument object model?
 
-Dell
IP IP Logged
Ralph55
Newbie
Newbie
Avatar

Joined: 21 Dec 2012
Online Status: Offline
Posts: 9
Quote Ralph55 Replybullet Posted: 04 Jan 2013 at 1:02pm
Hi, Dell,

In the references I select all of the Crystal Report references, so I don't know.

I found a video on youtube about how to get started with CR in VS 2010. I can add a new report, but can't get the CR Report viewer to show up in the toolbox. The video says to set the target framework to 4.0, and the report viewer will show up in the toolbox. When I start a new solution, I select framework 4.0, but there is no Crystal Reports viewer in the toolbox. Is that a problem?

Thanks,

Ralph
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 07 Jan 2013 at 3:20am
Yes, that is a problem.  Did you install the Crystal components for VS2010?  They no longer come bundled with VS - you have to download them separately from SAP.  If you've already installed them, I would try either a repair install on them or do an uninstall/reinstall.
 
-Dell
IP IP Logged
Ralph55
Newbie
Newbie
Avatar

Joined: 21 Dec 2012
Online Status: Offline
Posts: 9
Quote Ralph55 Replybullet Posted: 07 Jan 2013 at 3:31pm
Hi, Dell,

I found out why the controls weren't showing up. I had to set the target .NET framework to 4.0 complete in VS 2010.

I imagine you have to set some property to a SQL statement or dataset. Can you give me an idea of what to set?

Thanks,

Ralph
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 08 Jan 2013 at 3:29am
I usually use a separate "viewer" form (I generally work in WinForms, not in web apps...), although you can also embed the viewer in the same page where you put the data in the DataSet.  Here is a sample of the code that I use to connect everything prior to viewing the report:
public partial class BOEReportDocViewer : Form
{
  //This is the explicit report that will be shown 
   BOERptDoc_By_Universe unvRpt =
new BOERptDoc_By_Universe();
 
  //Use this overloaded version so we can set the DataSource for the
  //report prior to assigning the ReportSource of the viewer.
  public BOEReportDocViewer(MyDataSet rptDataDS)
  {
    InitializeComponent();
    unvRpt.SetDataSource(rptDataDS);
    rptViewer.ReportSource = unvRpt;
  }
}
 
To actually view the report, the code looks like this:

  BOEReportDocViewer viewer =new BOEReportDocViewer(rptDocDS);

  viewer.Show(this);

 
Hopefully this will provide the info you need to get the data into your report.
 
-Dell


Edited by hilfy - 08 Jan 2013 at 3:29am
IP IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.020 seconds.