Click here to Skip to main content
11,813,557 members (46,398 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: .NET1.0 .NET2.0 .NET3.0 VB8.0 VB , +
is it possible to display values from data reader to crystal report in
my code is

Imports System.Data
Imports Oracle.DataAccess.Client ' ODP.NET Oracle managed provider
Imports Oracle.DataAccess.Types

Dim oradb As String = "Data Source=orcl;User Id=hr;Password=hr;"
Dim conn As New OracleConnection(oradb)
Dim cmd As New OracleCommand
cmd.Connection = conn
cmd.CommandText = "select department_name from departments where department_id = 10"
cmd.CommandType = CommandType.Text
Dim dr As OracleDataReader = cmd.ExecuteReader()
Label1.Text = dr.Item("department_name")

here instaed of label i want to show the result set in crystal report?
I have created one crystal report and crystal report viewer.
how can i do this?
Posted 21-May-13 21:28pm
Edited 21-May-13 22:48pm
Kavitha le at 22-May-13 4:48am
Anybody please help

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can use the following code
You can first convert the datareader to datatable

DataTable dt = new DataTable();

// Then you use the use that directly to the repory
ReportDocument report = new ReportDocument();
report.Load(Server.MapPath("~/Reports/bydos.rpt"));//Your report Page
CrystalReportViewer1.ReportSource = report;

You can also refer to the following Links[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Abhinav S 275
1 Palash Mondal_ 190
2 KrunalRohit 150
4 Manas_Kumar 115
0 OriginalGriff 3,877
1 KrunalRohit 2,526
2 Maciej Los 2,245
3 CPallini 2,240
4 ppolymorphe 1,750

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 22 May 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100