Print Page | Close Window

Data not showing up

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=18314
Printed Date: 18 May 2024 at 11:46am


Topic: Data not showing up
Posted By: Ralph55
Subject: Data not showing up
Date 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



Replies:
Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: Ralph55
Date 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


Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: Ralph55
Date 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


Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: Ralph55
Date 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


Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: Ralph55
Date 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


Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: Ralph55
Date Posted: 22 Feb 2013 at 2:31pm
Hi, Dell,

I'm sorry, but I had to modify part of my program to make it more user friendly, and make / implement a help system. It is now in alpha testing, with no reports. I feel for it to be truly useful, it has to have reports.

Your code helped some, as I get the idea, but I'm still having trouble. Your code looks like it's either C# or C++, and these aren't my strong points. I'm working in VB.

I think you are creating a report, making an instance of it, so you can work with it programmatically. You set its data source to a dataset. Am I right?

When you do it like this, how do you design the layout of the report?


Thanks,

Ralph


Posted By: hilfy
Date Posted: 25 Feb 2013 at 3:31am
That's exactly what I'm doing and yes, the code is C# - I don't do VB.  I design the layout of the report in Visual Studio and connect it to the DataSet that's defined in the project.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: Ralph55
Date Posted: 01 Mar 2013 at 2:36pm
Hi, Dell,

I got a simple report working! I'm having trouble with a report based on two tables. In the databaase expert, I select the tables I want, and I get a window showing how the tables are related, and it is right, so I go to the design part. Both tables are there with all of their fields. I pick the ones to display.

In my code, my SQL for my dataset is SELECT tblNames.Last, tblNames.First, tblNumbers.Phone FROM tblNames INNER JOIN tblNumbers ON tblNames.ID = tblNumbers.NameID where tblNames.ID = 2"

When the report displays, I get both records. Only one record in tblNames has an ID = 2, and only one record in tblNumbers has a NameID = 2

I changed the where clause in my SQL statement to tblNames.ID = 10, and still got both records on the report.

I even took out the rpt.SetDataSource(ds) line, and still get both records on the report.

What is wrong?


Thanks,

Ralph


Posted By: hilfy
Date Posted: 04 Mar 2013 at 3:40am
If you run the same query in, for example, SQL Server Managment Studio, what do you get for results?
 
What type of connection are you using - ODBC or OleDB?
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: Ralph55
Date Posted: 04 Mar 2013 at 7:14am
Hi,

I don't have SQL Server. I'm using OleDB with the JET 4.0 engine to connect to an Access dB.

When I make a new query in VS and enter that SQL statement, it works as expected. It also works as expected inside Access.

Ralph


Posted By: Ralph55
Date Posted: 06 Mar 2013 at 7:08am
Hi, Dell,

Can I send you the dB, the SQL statement, and the report to see if you can get it to display only the record returned in the dataset?


Thanks,

Ralph


Posted By: hilfy
Date Posted: 06 Mar 2013 at 8:55am
I'll pm you my email address but I'm not sure when I'll have time to look at it - I'm getting married this weekend so in the next hour or so I'm going off-line until probably next Thursday.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window