473,396 Members | 2,061 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,396 software developers and data experts.

crystal reports + dataset

4
Hello, I'm trying to figure out how to create a Crystal Report in VB2005 using a CrystalReportViewer from a dataset that I created on a form Form1. The dataset (from an Access Database) appears on a DatagridView on Form1, assuring me that there is nothing wrong with thre creation of the dataset itself. However , I cannot make it appear in the Report Viewer. The error that constantly throws up is : "Report has no tables". This is my code :

Dim rpt as new CrystalReport
Dim mds As New DataSet
mds = ........ (creation of a dataset)

rpt.SetDataSource(mds)
CrystalReportViewer1.ReportSource = rpt

When running this code, the dataset is created and appears in a datagridvieuw, but the report remains empty.
Have I skipped a crucial step ? I would appreciate to receive help from anyone on short notice, as I have to finish a project including several reports by the end of April.

I read the answers on simmilar quetions on the forum, but I don't see the answer to my question.

Greetings !

Flupke
Mar 31 '08 #1
1 1970
Dököll
2,364 Expert 2GB
Hey there!

You probably have already seen this out there:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim CrystalReportViewer1 As CrystalDecisions.Windows.Forms.CrystalReportViewer = New CrystalDecisions.Windows.Forms.CrystalReportViewer
  3. Dim Report As CrystalDecisions.CrystalReports.Engine.ReportDocument = New CrystalDecisions.CrystalReports.Engine.ReportDocument
  4. CrystalReportViewer1.ActiveViewIndex = 0
  5. CrystalReportViewer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
  6. CrystalReportViewer1.DisplayGroupTree = False
  7. CrystalReportViewer1.Dock = System.Windows.Forms.DockStyle.Fill
  8. CrystalReportViewer1.Location = New System.Drawing.Point(0, 0)
  9. CrystalReportViewer1.Name = "CrystalReportViewer1"
  10.  
  11. Dim QueryString As String = "select * from TableName" 'Your Query here
  12. Dim Connection As New OleDbConnection(funcs.con) 'Your Database Connection Here
  13. Connection.Open()
  14.  
  15. Dim Adapter As OleDbDataAdapter = New OleDbDataAdapter(querystring, connection)'Passing the query in the connection
  16. Dim DataSet As DataSet = New DataSet() 'DataSet
  17. Adapter.Fill(DataSet)
  18. Dim DataTable As DataTable = New DataTable 'DataTable
  19. DataTable = DataSet.Tables(0) 'filling the datatable here
  20. Report.Load(Application.StartupPath & "/ReportName.rpt") 'Report Name Here
  21. Report.SetDataSource(DataTable)
  22. CrystalReportViewer1.ReportSource = Report
  23.  
  24.  
Not too skilled in Crystal, see what this does for ya...

Also get some step by step here:

http://www.neodynamic.com/ND/FaqsTip...rodid=7&sid=80

Please fetch results through this forum, just to see if anything already posted.

In a bit!

Dököll
Apr 1 '08 #2

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

Similar topics

4
by: Rick Thiel | last post by:
Hello, I am trying to build a Crystal report VisualStudio.NET for an ASP.NET application. I would like to build a report that doesn't connect to any particular database at design time because I...
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...
0
by: Maqsood Ahmed via .NET 247 | last post by:
Hello, I was trying to create Crystal Report using a DataSet (notfilled with DataBase entries). DataSet contains some Tables. Butwhen I want to generate a Crystal report it doesn't showanything. I...
1
by: andy lim | last post by:
Hello all, I'm developing a web application using ASP.NET/VB. I have problem in viewing my CR reports. It returns following exception when I tried to view any CR report. ...
7
by: TJoker .NET | last post by:
I'm developing an VB.NET Windows Forms application that uses CR for VS.NET (original version shipped with VS.NET 2002 - my VS.NET has the latest SP installed, no SPs for CR). My reports get their...
4
by: touf | last post by:
hi, I'm using Crystal reports to generate a simple report in a VB.net windows application, I've defined all my stuffs (accessMDB,query, 2 parameters) in the report design, and it's working fine,...
0
by: Monali | last post by:
Hi, I created a ASP.NET crystal reports web site in VS 2005. I wanted to display the data in a DataSet in the Crystal Reports viewer control. I am getting the DataSet from another dll. The...
3
by: VMI | last post by:
I know this may not be the best NG for this, but I feel you guys know more about this than any of the other NGs. I need to build several simple reports (over 50 of them and they get their data...
7
by: Jlo | last post by:
Hi, I have a c# winforms application. When I call the report file, it shows me all the records in the table. How can I make it to call only a particular range. i have the following code...
2
by: =?Utf-8?B?Um9zcyBNYXNvbg==?= | last post by:
Hi I am interested in using crystal reports for the first time but have a few questions that someone maybe able to help with before I get started. The background to my query is that a client is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.