473,799 Members | 3,167 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create CrystalReport from DataSet

I've populated a DataSet in my C# program and verified that it contains the
data I passed it. I've then created a blank CrystalReport and set it's
DataSource to my DataSet. Then I created a CrystalReportVi ewer and set it's
ReportSource to my CrystalReport. When I run the program though nothing get's
shown in my viewer. The following is how I did it...

OdbcConnection dbConn = new OdbcConnection( );
OdbcCommand dbCommand = new OdbcCommand();
OdbcDataAdapter dbAdap = new OdbcDataAdapter ();
DataSet dbData = new DataSet();
CrystalReport1 report = new CrystalReport1( );

dbConn.Connecti onString = @"DSN=Crystal;" ;
dbConn.Open();
dbCommand.Comma ndText = "SELECT * FROM Student ORDER BY studentid";
dbCommand.Conne ction = dbConn;
dbAdap.SelectCo mmand = dbCommand;
dbAdap.Fill(dbD ata, "Students") ;
report.SetDataS ource(dbData);
reportViewer.Re portSource = report;

I don't want to use the wizard that comes with VS .NET because I want to
completely understand Crystal Reports and be able to manipulate the report
just by editing the DataSet by using SQL commands.

Any ideas?

Darrell

Nov 16 '05 #1
3 15524
Hi,

First you have to design your report, how you want it to looks like, the
grouping, etc

after that you can set the datasource of it to your dataset. At design time
you only need the structure of the dataset.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"redneon" <re*****@discus sions.microsoft .com> wrote in message
news:11******** *************** ***********@mic rosoft.com...
I've populated a DataSet in my C# program and verified that it contains
the
data I passed it. I've then created a blank CrystalReport and set it's
DataSource to my DataSet. Then I created a CrystalReportVi ewer and set
it's
ReportSource to my CrystalReport. When I run the program though nothing
get's
shown in my viewer. The following is how I did it...

OdbcConnection dbConn = new OdbcConnection( );
OdbcCommand dbCommand = new OdbcCommand();
OdbcDataAdapter dbAdap = new OdbcDataAdapter ();
DataSet dbData = new DataSet();
CrystalReport1 report = new CrystalReport1( );

dbConn.Connecti onString = @"DSN=Crystal;" ;
dbConn.Open();
dbCommand.Comma ndText = "SELECT * FROM Student ORDER BY studentid";
dbCommand.Conne ction = dbConn;
dbAdap.SelectCo mmand = dbCommand;
dbAdap.Fill(dbD ata, "Students") ;
report.SetDataS ource(dbData);
reportViewer.Re portSource = report;

I don't want to use the wizard that comes with VS .NET because I want to
completely understand Crystal Reports and be able to manipulate the report
just by editing the DataSet by using SQL commands.

Any ideas?

Darrell

Nov 16 '05 #2
> At design time you only need the structure of the dataset.

Is there no way to make a CrystalReport completely dynamic? I don't know the
structure of the DataSet at design time becaue I don't populate it with data
until run time. And depending on what SELECT statement I run at run time
changes the structure of the DataSet.

Darrell

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

First you have to design your report, how you want it to looks like, the
grouping, etc

after that you can set the datasource of it to your dataset. At design time
you only need the structure of the dataset.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"redneon" <re*****@discus sions.microsoft .com> wrote in message
news:11******** *************** ***********@mic rosoft.com...
I've populated a DataSet in my C# program and verified that it contains
the
data I passed it. I've then created a blank CrystalReport and set it's
DataSource to my DataSet. Then I created a CrystalReportVi ewer and set
it's
ReportSource to my CrystalReport. When I run the program though nothing
get's
shown in my viewer. The following is how I did it...

OdbcConnection dbConn = new OdbcConnection( );
OdbcCommand dbCommand = new OdbcCommand();
OdbcDataAdapter dbAdap = new OdbcDataAdapter ();
DataSet dbData = new DataSet();
CrystalReport1 report = new CrystalReport1( );

dbConn.Connecti onString = @"DSN=Crystal;" ;
dbConn.Open();
dbCommand.Comma ndText = "SELECT * FROM Student ORDER BY studentid";
dbCommand.Conne ction = dbConn;
dbAdap.SelectCo mmand = dbCommand;
dbAdap.Fill(dbD ata, "Students") ;
report.SetDataS ource(dbData);
reportViewer.Re portSource = report;

I don't want to use the wizard that comes with VS .NET because I want to
completely understand Crystal Reports and be able to manipulate the report
just by editing the DataSet by using SQL commands.

Any ideas?

Darrell


Nov 16 '05 #3
Hi,

No it's not, at least with the version shipped with Vs.NET

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"redneon" <re*****@discus sions.microsoft .com> wrote in message
news:E9******** *************** ***********@mic rosoft.com...
At design time you only need the structure of the dataset.


Is there no way to make a CrystalReport completely dynamic? I don't know
the
structure of the DataSet at design time becaue I don't populate it with
data
until run time. And depending on what SELECT statement I run at run time
changes the structure of the DataSet.

Darrell

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

First you have to design your report, how you want it to looks like, the
grouping, etc

after that you can set the datasource of it to your dataset. At design
time
you only need the structure of the dataset.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"redneon" <re*****@discus sions.microsoft .com> wrote in message
news:11******** *************** ***********@mic rosoft.com...
> I've populated a DataSet in my C# program and verified that it contains
> the
> data I passed it. I've then created a blank CrystalReport and set it's
> DataSource to my DataSet. Then I created a CrystalReportVi ewer and set
> it's
> ReportSource to my CrystalReport. When I run the program though nothing
> get's
> shown in my viewer. The following is how I did it...
>
> OdbcConnection dbConn = new OdbcConnection( );
> OdbcCommand dbCommand = new OdbcCommand();
> OdbcDataAdapter dbAdap = new OdbcDataAdapter ();
> DataSet dbData = new DataSet();
> CrystalReport1 report = new CrystalReport1( );
>
> dbConn.Connecti onString = @"DSN=Crystal;" ;
> dbConn.Open();
> dbCommand.Comma ndText = "SELECT * FROM Student ORDER BY studentid";
> dbCommand.Conne ction = dbConn;
> dbAdap.SelectCo mmand = dbCommand;
> dbAdap.Fill(dbD ata, "Students") ;
> report.SetDataS ource(dbData);
> reportViewer.Re portSource = report;
>
> I don't want to use the wizard that comes with VS .NET because I want
> to
> completely understand Crystal Reports and be able to manipulate the
> report
> just by editing the DataSet by using SQL commands.
>
> Any ideas?
>
> Darrell
>


Nov 16 '05 #4

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

Similar topics

1
1356
by: s-galit | last post by:
i want that the crystalReport will show the data which is in the dataSet how can i do that? thanks
0
1611
by: s-galit | last post by:
hi, i have a formula parameter in my crystalReport how can i initalize the parameter so that in every line in the crystalReport the parameter will have a different string? how to get to line in crystalReport? thanks thats what i have wrote till now but im getting in my field only "-" (in every line) For i = 0 To 9
1
3032
by: Jason Huang | last post by:
Hi, Would someone tell me how to open a CrystalReport in my ASP.Net C#? We can use the Show method to open a windows form, but what method should we use for opening a CrystalReport? Thanks for help. Jason
2
2714
by: Jason Huang | last post by:
Hi, Now that I've built up a DataSet and a CrystalReportViewer in Form1. Also the CrystalReportViewer is pointing to CrystalReport1. The Form1 can open the CrystalReport1. However, I don't know how to have the CrystalReport1 or CrystalReportViewer use the DataSet. How does a textbox in a CrystalReport can grab data from a DataSet? Any help will be appreciated.
0
1300
by: touf | last post by:
Hi, Is it possible to create the report (crystal reports) from vb code in order to display all rows/columns of the dataset.(tabular report) What I found is that we need these steps to buit a report 1- create a struture dataset and put t in an xml file 2- open a new crystal report document 3- select the XML file as datasource 4- drag-drop the fields into the report 5- open a new form, add a crystalReport viewr,......
2
1458
by: Wilfried Mestdagh | last post by:
Hi, I need to do reporting. As far as I can see to get crystalreport to work you need to go to some wizards and then it is connected to a database. that is not what I want. Seems a double storage to make a report, put it into a database then read it again to print. And even then some additional calculations will have to be done that has eventually nothing to do with the database and still has to be printed. So how do I control the...
0
1580
by: agcabutotan | last post by:
Hi to everyone. I am new in this thread, please help me. I'm having difficulty with CrystalReport.Net. I have a completed project written and compiled in VB.Net (and I used CrystalReport.Net in all of my reports). I used to connect in our SQL server using ADO datasets and It worked. Long after I created a new SQL server (not a member from the original server, a new server so-to-speak), with the same project, I am creating a new report but...
1
1818
by: mhsasono | last post by:
Hi all, Has anybody experienced with CrystalReport? My question is: Does CrystalReport have capability to print the Microsoft Word document? Reason: I want to know CrystalReport capability since now I am in the middle of developing a system that generate a report or document from various resources, e.g. some parts are Oracle fields and some parts are text of microsoft word object. Thanks in advance.
0
1222
by: Anavaradha Sankar | last post by:
Hi., I had first created a dataset and using the wizard i had specified the connection (i used windows authentication to create a connection),tables,queries n finished creating the dataset. And now created a crystalreport specifeid that datatable thru the wizard that comes. Placed the Crystal Report Viewer and specified irs source as the crystal report which i created. And using smart tag i had disabled the Enable Database Logon Prompting...
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10473
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10249
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10025
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9068
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7563
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6804
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4138
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.