In Cristal report there are option to direct binding with SQL Server, so you can bind your SP or table with Crystal report, you do not need to load your record into data table
let me know if any query
Thanks,
Gaurav Dhol
Skype ID : dhol.gaurav
If My Post contains helped you, Please Mark as Answer
You can create a SP and and SP you can pass the parameters, based on that params you can filter data and Report is binded of that SP, you you will get filted data.
let me know if any query
Thanks,
Gaurav Dhol
Skype ID : dhol.gaurav
If My Post contains helped you, Please Mark as Answer
Marked as answer by sohrabus on Nov 06, 2012 10:30 AM
sohrabus
Member
1 Points
5 Posts
DataTable Fill Problem
Nov 02, 2012 11:51 AM|LINK
Hi,
I use SQL Server, WinForm & Crystal 11 R2
I use SqlDataReader To Retrieve around 1 Million Rows from SQL Server. My Query Executed Successfully.
BUT when Fill DataTable From SqlDataReader it display outofmemory ERROR.
My Code is as Follows:
dt.Load(dr);
crystalReportDocument.SetDataSource(dt);
I use all this to display Report in Crystal Report.
Your Help is higly appericiated.
Thanks,
dhol.gaurav
Contributor
3998 Points
725 Posts
Re: DataTable Fill Problem
Nov 02, 2012 12:18 PM|LINK
Hey,
In Cristal report there are option to direct binding with SQL Server, so you can bind your SP or table with Crystal report, you do not need to load your record into data table
let me know if any query
Gaurav Dhol
Skype ID : dhol.gaurav
If My Post contains helped you, Please Mark as Answer
sumitjain231
Participant
1436 Points
284 Posts
Re: DataTable Fill Problem
Nov 02, 2012 12:38 PM|LINK
how much data is returned by your query. definietly it is huge. that is the reason you are getting this error.
Remember to click Mark as Answer on the post that helps to others.
sohrabus
Member
1 Points
5 Posts
Re: DataTable Fill Problem
Nov 03, 2012 04:41 AM|LINK
From Front End I Pass Several Where Condition thats why I Execute Query & Bind with crystalReportDocument.SetDataSource(dataTable).
Pls advise me if u know some alternative.
dhol.gaurav
Contributor
3998 Points
725 Posts
Re: DataTable Fill Problem
Nov 03, 2012 05:00 AM|LINK
Hello,
You can create a SP and and SP you can pass the parameters, based on that params you can filter data and Report is binded of that SP, you you will get filted data.
let me know if any query
Gaurav Dhol
Skype ID : dhol.gaurav
If My Post contains helped you, Please Mark as Answer
anil.india
Contributor
2613 Points
453 Posts
Re: DataTable Fill Problem
Nov 03, 2012 05:23 AM|LINK
How you are going to show your 1 million records on a window? Will some scroll to 1 million records? No.
a) So why not you are applying paging to your crystal report.
b) Also you can directly pass the result set of your query/stored proc.
For limiting the records - http://pankajlalwani.wordpress.com/2009/07/31/limiting-the-number-of-records-to-be-displayed-in-crystal-report/
codepattern.net/blog ||@AnilAwadh
sohrabus
Member
1 Points
5 Posts
Re: DataTable Fill Problem
Nov 03, 2012 07:20 AM|LINK
Let me try SP and I'll get back about the output.
sohrabus
Member
1 Points
5 Posts
Re: DataTable Fill Problem
Nov 06, 2012 10:30 AM|LINK
Boss,
I Created CR Report Using SP and Passed Parameters.
It worked and able to retrieve around 2 Million Records ON Test System.
Thanks Alot. For the First Time I used SP with Crystal and it is working fine and solved my Purpose.
Can I ask 1 More Question.
There is a Option in rptDocument.SetDataSource that I can Bind IDataReader
BUT When i BIND IDataReader, It does not work.
My Code is as follows:
IDataReader idr = clsDAL.ExecuteReader("Select * from Tablename");
rptDocument.Load(strReportPath);
rptDocument.Refresh();
rptDocument.SetDataSource(idr);
Could u pls guide.
Thanks.