473,503 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to use dataset as Crystal report's source

7 New Member
Hello to all brains,
i am relativly new to this programming world and i need tons of favor from u guys.My problem i want to use a dataset's table as my report source.Report also takes some other parameters.Now my first question is how do i set datatable as my report source and my 2nd question is how to pass parameters.Although i have attempted to do this by the below mentioned code.

// Making report instance
Expand|Select|Wrap|Line Numbers
  1. Reports.RptNewModifiedInsurances objRptNewModifiedInsurances = new Reports.RptNewModifiedInsurances();
  2.  
  3. //Making and passing parameter to report
  4.  
  5.            objParameterField = new ParameterField();
  6.             objParameterField.Name = "@FromDate";
  7.             objParameterDiscreteValue = new ParameterDiscreteValue();
  8.             objParameterDiscreteValue.Value = dtpFrom.Value;
  9.             objParameterField.CurrentValues.Add(objParameterDiscreteValue);
  10.             objParameterFields.Add(objParameterField);
  11.  
  12.             objParameterField = new ParameterField();
  13.             objParameterField.Name = "@ToDate";
  14.             objParameterDiscreteValue = new ParameterDiscreteValue();
  15.             objParameterDiscreteValue.Value = dtpTo.Value;
  16.             objParameterField.CurrentValues.Add(objParameterDiscreteValue);
  17.             objParameterFields.Add(objParameterField);
  18.  
  19.  
  20.             ReportViewer objReportViewer = new ReportViewer();
  21.             objReportViewer.MdiParent = this.MdiParent;
  22.  
  23.             objReportViewer.crViewer.ParameterFieldInfo = objParameterFields;
  24.  
  25. // Assigning datatable as report source,here it throws exception
  26.  
  27. objRptNewModifiedInsurances.SetDataSource(BusinessLayer.BusGeneral.ds.Tables["usp_rp_new_mod_insurance"]);
  28.  
The error message is "The report has no tables."

Please help me this time :-( I am waiting for your kind response.
Dec 11 '07 #1
0 1711

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

Similar topics

1
3067
by: Ed | last post by:
I've search around endlessly for a solution to this problem but have not found anything yet. I'm using Crystal 9 with .NET. I am not using a DSR to create the report. Instead I am creating a...
1
4392
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...
1
603
by: david risby | last post by:
I'm getting an unwanted database login form appearing when I set the Data Source of a Crystal report to a .Net dataset e.g. myReport.SetDataSource(myDataSet This only occurs on some PCs, works...
3
5986
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
2765
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: ...
2
2819
by: Ceri | last post by:
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...
1
2479
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
7877
by: jason | last post by:
I'll try to explain in detail what it is I'm struggling with. I created a SQL database with one table called CallSheet which contains the following columns: Caller ID: <--Primary Key, auto...
3
3559
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...
1
2168
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
7083
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
7278
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
7456
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
5578
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,...
1
5011
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...
0
4672
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...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
379
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.