TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Chiranjeevi Aripaka
NA
133
303.7k
crystal reports is not displaying data
Apr 2 2018 3:36 AM
Dear Friends ,
Please help me in displaying data from database into the crystal report .
I have attached the complete code as a zip file
index.aspx
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Web.Configuration;
using
System.Data;
using
System.Data.SqlClient;
using
System.IO;
using
CrystalDecisions.CrystalReports.Engine;
using
CrystalDecisions.ReportSource;
using
CrystalDecisions.Reporting;
using
CrystalDecisions.Shared;
public
partial
class
index : System.Web.UI.Page
{
SqlConnection con =
new
SqlConnection(Class1.dbConnectionString);
SqlDataAdapter adap;
DataSet ds;
protected
void
Page_Load(
object
sender, EventArgs e)
{
}
protected
void
DropDownList1_SelectedIndexChanged(
object
sender, EventArgs e)
{
}
protected
void
Button1_Click(
object
sender, EventArgs e)
{
con.Open();
SqlCommand cmd =
new
SqlCommand(
"BANKPROCEDURE"
, con);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da =
new
SqlDataAdapter(cmd);
//cmd.Parameters.AddWithValue("@BCODE", SqlDbType.Int).Value = DropDownList1.SelectedItem.Value.ToString();
DataTable ds =
new
DataTable();
ds.TableName =
"BankDataSet1"
;
da.Fill(ds);
//GridView1.DataSource = ds;
//GridView1.DataBind();
ReportDocument rdoc =
new
ReportDocument();
rdoc.Load(Server.MapPath(
"BankCrystalReport.rpt"
));
rdoc.SetDataSource(ds);
rdoc.SetParameterValue(
"CODE"
, Convert.ToInt32 ( DropDownList1.Text));
CrystalReportViewer1.ReportSource = rdoc;
CrystalReportViewer1.RefreshReport();
CrystalReportViewer1.DataBind();
con.Close();
}
}
dbo.BANKPROCEDURE
ALTER
PROCEDURE
dbo.BANKPROCEDURE
AS
SELECT
*
FROM
BANK
RETURN
Attachment:
BANK_WEBSITE.zip
Reply
Answers (
1
)
window.history.forward(1) + Master Page+Panel + Update Panel
Utc Validaton using regular expression