Click here to Skip to main content
13,048,406 members (148,098 online)
Rate this:
Please Sign up or sign in to vote.
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
Updated 21-May-13 22:48pm
Kavitha le 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 22 May 2013
Copyright © CodeProject, 1999-2017
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