Oracle Data reader with Crystal Report Viewer
-
I have configured oracle data reader by following code myReader = myCMD.Parameters("io_cursor").Value and checked the following code: Dim x, count As Integer count = 0 Do While myReader.Read() For x = 0 To myReader.FieldCount - 1 Console.Write(myReader(x) & " ") Next Console.WriteLine() count += 1 Loop working fine. Can i assign this myReader (Oracle Data Reader) as a dataset or report source to Crystal report viewer. Since there are million of rows in the oracle table, and i came to know that oracle data reader is much faster then any other ways. So now, how do i assign this data reader to crystal report viewer in web application. Thanks & Regards Girish Sharma
-
I have configured oracle data reader by following code myReader = myCMD.Parameters("io_cursor").Value and checked the following code: Dim x, count As Integer count = 0 Do While myReader.Read() For x = 0 To myReader.FieldCount - 1 Console.Write(myReader(x) & " ") Next Console.WriteLine() count += 1 Loop working fine. Can i assign this myReader (Oracle Data Reader) as a dataset or report source to Crystal report viewer. Since there are million of rows in the oracle table, and i came to know that oracle data reader is much faster then any other ways. So now, how do i assign this data reader to crystal report viewer in web application. Thanks & Regards Girish Sharma
- I've only used datasets with Crystal Viewer 2) I can't believe you would be generating a report that would be viewed by a web page that would contain millions of records. So I'm skeptical on that point. :suss: Here is my basic framework for generating a report: 1) create your SQL statement for the report 2) create a SQLDataAdapter with this sql command 3) fill a dataset from the data adapter 4) load the crystal report 5) assign the report.setdatasource to the dataset you generated 6) assign the crystalreportviewer.reportsource to your report Done ! I've left out lots of details, but you should get the idea ...
-
I have configured oracle data reader by following code myReader = myCMD.Parameters("io_cursor").Value and checked the following code: Dim x, count As Integer count = 0 Do While myReader.Read() For x = 0 To myReader.FieldCount - 1 Console.Write(myReader(x) & " ") Next Console.WriteLine() count += 1 Loop working fine. Can i assign this myReader (Oracle Data Reader) as a dataset or report source to Crystal report viewer. Since there are million of rows in the oracle table, and i came to know that oracle data reader is much faster then any other ways. So now, how do i assign this data reader to crystal report viewer in web application. Thanks & Regards Girish Sharma
If you have a databinder then you can automatically create a dataset with the reader. However, creating a data set with a data reader will never be faster than using the data reader alone. A data reader is a fast-forward, read only schema blind cursor (Ok, oracle supports cursor definitios) and is the absolute fastest possible way to retrieve non-bulk data from a database. BTW, Console.WriteLine is slow. One last thing, with Crystal you should be able to bind to a stored procedure to take advantage of the cursor and not require a dataset. Give it a shot.
Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane
-
If you have a databinder then you can automatically create a dataset with the reader. However, creating a data set with a data reader will never be faster than using the data reader alone. A data reader is a fast-forward, read only schema blind cursor (Ok, oracle supports cursor definitios) and is the absolute fastest possible way to retrieve non-bulk data from a database. BTW, Console.WriteLine is slow. One last thing, with Crystal you should be able to bind to a stored procedure to take advantage of the cursor and not require a dataset. Give it a shot.
Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane
First let me thanks to both of you for providing me the solution. Actually, i do'nt know how do i assign Oracle data reader as dataset / datasource to crystal report viewer; even is it possible or not, i am not aware of it. I have somewhere read that it is the best way to write the stored procedure to fetch the rows and then call that stored procedure by data reader. This is has been done by me; but now how i go further with this data reader to populate the crystal report viewer. Since dataset consumes a lot chunk of memory on serve i.e. adapter.fill(ds); so i am trying to implement data reader way. I Shall be highly thankful to you for your next valauable replies please. Regards Girish Sharma
-
First let me thanks to both of you for providing me the solution. Actually, i do'nt know how do i assign Oracle data reader as dataset / datasource to crystal report viewer; even is it possible or not, i am not aware of it. I have somewhere read that it is the best way to write the stored procedure to fetch the rows and then call that stored procedure by data reader. This is has been done by me; but now how i go further with this data reader to populate the crystal report viewer. Since dataset consumes a lot chunk of memory on serve i.e. adapter.fill(ds); so i am trying to implement data reader way. I Shall be highly thankful to you for your next valauable replies please. Regards Girish Sharma
In the Crystal Report Designer look in the Data Expert and you will be presented with 100's of ways to connect to data, choose stored procedure. AFAIK, the viewer control has nothing whatsoever to do with creating the report, just rendering it to the screen.
Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane
-
In the Crystal Report Designer look in the Data Expert and you will be presented with 100's of ways to connect to data, choose stored procedure. AFAIK, the viewer control has nothing whatsoever to do with creating the report, just rendering it to the screen.
Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane
But my crystal report viewer is on another page and i am storing my parameter value in querystring. So, if i would be able to provide the stored procedure by Data Expert (even this also i have to serach more) then how i will pass these query string parameters to the report please. Regards Girish Sharma
-
But my crystal report viewer is on another page and i am storing my parameter value in querystring. So, if i would be able to provide the stored procedure by Data Expert (even this also i have to serach more) then how i will pass these query string parameters to the report please. Regards Girish Sharma
When you bind to the stored procedure using the data expert, Crystal will create parameters for the report. You can then use C# code to map the query string parameters. Crystal Parameters with C#[^]
Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane
-
When you bind to the stored procedure using the data expert, Crystal will create parameters for the report. You can then use C# code to map the query string parameters. Crystal Parameters with C#[^]
Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane
My sincere thanks to you. Right now i am at my home and the work is going on office's pc, so i will try to implement your suggestions, and if need any further query, will post the same here or will mail to you by my mail id i.e. gksharma0481@yahoo.co.in. Best Regards Girish Sharma
-
When you bind to the stored procedure using the data expert, Crystal will create parameters for the report. You can then use C# code to map the query string parameters. Crystal Parameters with C#[^]
Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane
As you suggested, i have created new report by data expert using stored procedure, which is taking 2 varchar2 arguments. I have placed following code in secm.aspx.vb file: CrystalReportViewer1.ParameterFieldInfo.Clear() Dim parameter As ParameterFields = CrystalReportViewer1.ParameterFieldInfo Dim strtrol As ParameterField = New ParameterField() Dim endroll As ParameterField = New ParameterField() strtrol.Name = "par_strtrol" endroll.Name = "par_endroll" Dim xxx As ParameterDiscreteValue = New ParameterDiscreteValue() xxx.Value = Request.QueryString("startrol") strtrol.CurrentValues.Add(xxx) parameter.Add(strtrol) xxx.Value = Request.QueryString("endrol") endroll.CurrentValues.Add(xxx) parameter.Add(endroll) CrystalReportViewer1.ParameterFieldInfo = parameter CrystalReportViewer1.ReportSource = Server.MapPath("secm1998.rpt") But when it is showing error "The parameter is incorrect." and a blank crystal report viewer control comes on the screen. How to resolve it or any other way by which i can pass query string parameter to crystal report for crystal report viewer; please guide me. Thanks & Best Regards Girish Sharma