473,388 Members | 1,496 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,388 software developers and data experts.

How do I populate Crystal Reports, using a DataTable?

Hi,

Can anyone tell me how I can populate Crystal Reports, using a DataTable in C#?

Regards,
Pierre
Nov 15 '05 #1
2 18814
pi***********@psitek.com (Pierre) wrote in message news:<db*************************@posting.google.c om>...
Hi,

Can anyone tell me how I can populate Crystal Reports, using a DataTable in C#?

Regards,
Pierre


Pierre,

This is how you do it using OLEDB, and a table view in MSSQL. This assumes
you have setup your report viewer with the wizard.

-------------------------

dataSet21.Clear();
oleDbDataAdapter1.Fill(dataSet21,"your_table_view" );

CrystalReport2 custReport = new CrystalReport2();
custReport.SetDataSource(dataSet21);

TableLogOnInfo logOnInfo = new TableLogOnInfo();
logOnInfo = custReport.Database.Tables["your_table_view"].LogOnInfo;
ConnectionInfo connectionInfo = new ConnectionInfo ();
connectionInfo = logOnInfo.ConnectionInfo;
// Set the Connection parameters.
connectionInfo.DatabaseName = yourcatalog;
connectionInfo.ServerName = workstationID;
MessageBox.Show(connectionInfo.ServerName);
//connectionInfo.Password = "yourpassword";
//connectionInfo.UserID = "youruserid";
custReport.Database.Tables ["Vw_Address_Label"].ApplyLogOnInfo(logOnInfo);
crystalReportViewer1.ReportSource = custReport;
crystalReportViewer1.Refresh();
crystalReportViewer1.RefreshReport();
-----------------------
Nov 15 '05 #2
Hi Brent,

Thanks, but I am still have major difficulty getting Crystal Reports to
work properly.

I have three tiers i.e. ASP.Net, Business Logic Layer and the Data
Access Layer. I get the data back from an stored proc on a SQL 2000
database and then manipulate the DataTable in the Business Logic layer,
filtering out certain records, in order to obtain the data which needs
to be displayed on the report.

The problem I am having, is populating the unbound "fields" on the
actual report with data. The report is being displayed, but I cannot
find documentation on populating the actual fields.

Does anyone PLEASE know of a way in which I can do this?

Thanks,
Pierre

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #3

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

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: oscar | last post by:
is there a way of integrating mysql databases into the .net crystal reports? in the report wizard i have options for sql databases, but nothing for mysql. is there a plugin i'm missing for it? ...
3
by: Deasun | last post by:
I need some help please! Crystal is driving me nuts. Heres my code so far, see below. Problem: On the .export() line it comes back with error #5 Login failed! I know the login info is good so...
3
by: Shawn H. Mesiatowsky | last post by:
I have come across lots of information regarding this, but nothing seems to work. I have created a Crystal Report that access's a SQL server backend for the data, and I want to display the 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...
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....
2
by: touf | last post by:
Hi, I've a problem in a crystal reports report, the detail information is displayed 2 times. I'm sure that the dataset contains the true information because I see it in a datagrid so the problem...
5
by: Jay | last post by:
I am getting mixed messages from the asp.net website hosting providers - some say they do not support Crystal Reports due to a $25,000 per cpu licensing fee, others say all I need to do is install...
1
by: Brock | last post by:
Thanks for any help. I'm not new to Crystal Reports and use them routinely in vb.net for desktop applications, but I don't know where to start for using them in my asp.net apps. I currently have an...
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: 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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.