473,387 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Showing dataset data on Crystal Report

I have been trying to display dataset data in a Crystal Report in a
Crystal Reports Viewer using VB.Net. Displaying the data from the
default xtreme.mdb Access database was no problem, but when trying to
display data from an SQL 2000 database, no data ever shows. Could
somebody please tell me what alterations need to be made to the
following code?

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
InitializeComponent()
Dim newRpt As New empsReport 'Name of Crystal Report
Dim newConn As New
OleDbConnection("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist
Security Info=False;Initial Catalog=pubs;Data Source=xxxxx;Use
Procedure for Prepare=1;Auto Translate=True;Packet
Size=4096;Workstation ID=xxxxx;Use Encryption for Data=False;Tag with
column collation when possible=False")
Dim newAdapter As New OleDbDataAdapter("SELECT fname, lname
FROM employee", newConn)
Dim dataSet As New dsEmps 'Name of .xsd dataset that has been
created with the Employee table
newAdapter.Fill(dataSet, "employees")
newRpt.SetDataSource(dataSet)
CrystalReportViewer1.ReportSource() = newRpt
CrystalReportViewer1.DataBind()
End Sub

I am trying it with an OleDbConnection as I thought that I may have
more joy with this after failing with an SQLConnection. The code runs
without a problem, but the report only shows the field headings, and
not the data entries. All I have done is convert the code for
connecting to the Access Database, and I have been unable to find any
VB.Net solution. A solution to my problem would be greatly
appreciated.
Nov 18 '05 #1
2 2816
This shouldn't be necessary:
CrystalReportViewer1.DataBind()

Was your report file (empsReport) created using the .xsd file as its
datasource?

http://support.businessobjects.com/l...s/c2010929.asp

Check out the ADONET sample in this download:
http://support.businessobjects.com/c...amples.exe.asp

HTH,
Greg

"Ceri" <ce*******@ev1.net> wrote in message
news:9e**************************@posting.google.c om...
I have been trying to display dataset data in a Crystal Report in a
Crystal Reports Viewer using VB.Net. Displaying the data from the
default xtreme.mdb Access database was no problem, but when trying to
display data from an SQL 2000 database, no data ever shows. Could
somebody please tell me what alterations need to be made to the
following code?

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
InitializeComponent()
Dim newRpt As New empsReport 'Name of Crystal Report
Dim newConn As New
OleDbConnection("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist
Security Info=False;Initial Catalog=pubs;Data Source=xxxxx;Use
Procedure for Prepare=1;Auto Translate=True;Packet
Size=4096;Workstation ID=xxxxx;Use Encryption for Data=False;Tag with
column collation when possible=False")
Dim newAdapter As New OleDbDataAdapter("SELECT fname, lname
FROM employee", newConn)
Dim dataSet As New dsEmps 'Name of .xsd dataset that has been
created with the Employee table
newAdapter.Fill(dataSet, "employees")
newRpt.SetDataSource(dataSet)
CrystalReportViewer1.ReportSource() = newRpt
CrystalReportViewer1.DataBind()
End Sub

I am trying it with an OleDbConnection as I thought that I may have
more joy with this after failing with an SQLConnection. The code runs
without a problem, but the report only shows the field headings, and
not the data entries. All I have done is convert the code for
connecting to the Access Database, and I have been unable to find any
VB.Net solution. A solution to my problem would be greatly
appreciated.

Nov 18 '05 #2
Doh! I thought this was a Winform not a web project. Hopefully the links
will still be helpful.

Greg

"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:uN**************@TK2MSFTNGP14.phx.gbl...
This shouldn't be necessary:
CrystalReportViewer1.DataBind()

Was your report file (empsReport) created using the .xsd file as its
datasource?

http://support.businessobjects.com/l...s/c2010929.asp

Check out the ADONET sample in this download:
http://support.businessobjects.com/c...amples.exe.asp

HTH,
Greg

"Ceri" <ce*******@ev1.net> wrote in message
news:9e**************************@posting.google.c om...
I have been trying to display dataset data in a Crystal Report in a
Crystal Reports Viewer using VB.Net. Displaying the data from the
default xtreme.mdb Access database was no problem, but when trying to
display data from an SQL 2000 database, no data ever shows. Could
somebody please tell me what alterations need to be made to the
following code?

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
InitializeComponent()
Dim newRpt As New empsReport 'Name of Crystal Report
Dim newConn As New
OleDbConnection("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist
Security Info=False;Initial Catalog=pubs;Data Source=xxxxx;Use
Procedure for Prepare=1;Auto Translate=True;Packet
Size=4096;Workstation ID=xxxxx;Use Encryption for Data=False;Tag with
column collation when possible=False")
Dim newAdapter As New OleDbDataAdapter("SELECT fname, lname
FROM employee", newConn)
Dim dataSet As New dsEmps 'Name of .xsd dataset that has been
created with the Employee table
newAdapter.Fill(dataSet, "employees")
newRpt.SetDataSource(dataSet)
CrystalReportViewer1.ReportSource() = newRpt
CrystalReportViewer1.DataBind()
End Sub

I am trying it with an OleDbConnection as I thought that I may have
more joy with this after failing with an SQLConnection. The code runs
without a problem, but the report only shows the field headings, and
not the data entries. All I have done is convert the code for
connecting to the Access Database, and I have been unable to find any
VB.Net solution. A solution to my problem would be greatly
appreciated.


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bob Skutnick | last post by:
Help.... I've created an ADO.NET dataset in Visual Studio (a web project). I build the project and then try to create a Crystal Report using the dataset. When I try to use the ADO.NET dataset...
3
by: Colin Graham | last post by:
I have recently created a report in crystal(10) linking to a dataset as the datasource. I notice however that the fields available in the report all have STRING format and therefore i cannot change...
1
by: JK | last post by:
In my win form, I'm trying to display a Crystal report with the data in my dataset only but, if I follow the steps in this msdn page: ...
1
by: Sachin | last post by:
Hi, I am working on ASP.Net 2.0 Beta 2 I am having problems creating crystal report using dataset I created a new dataset (DS_ExpCode) and a datatable (DT_ExpCode) under App_Code folder....
3
by: David P. Donahue | last post by:
Maybe this is an easy thing to do, but I'm just not seeing how it's done (or at least how it's done properly). I have a web service running on a remote machine which returns a DataSet. I can...
0
by: Sridhar | last post by:
Hi, I have a Crystal Report which has two sub reports in it. When I try to view this Crystal Report in my local computer, it is showing data for sub reports also. But when I deploy it to the web...
1
by: mike11d11 | last post by:
For some reason I'm getting no data populating in my crystal report. I built my crystal report off my dataset in my project, and I fill the dataset when opening the main form, and count the...
0
by: AboutJAV | last post by:
I created a crystal report with the report.rpt reportdata.xsd I created the a new dataset with the reportdata myreportdata = new reportdata(); That automatically created a new dataset...
6
by: Simone | last post by:
Hello Here is my issue, I created a crystal report using a data set from my xsd. Then I created a page with the crystal report viewer control and bound the report to it. When I try to view...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.