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
Surya b
NA
1k
4.3k
Crystal report
Feb 20 2014 2:29 AM
How I generating a below report which contains three blocks with different records
I need the below format in crystal report
Ex:
Elector Id: 123 ElectorID:254 EletorID:344
Name:Abc Name: xyz Name:trtr
Gender:M Gender:M Gender:F
Age:23 Age:54 a Age:34
Assembly:test Assembly:test Assembly:test
Parliament: aBC Parliament::ABC Parliament:test
I wrote the below code:
private void button1_Click(object sender, EventArgs e)
{
string constr = "Data Source=.;Initial Catalog=VoterData;User ID=sa;Password=mdc@123";
SqlConnection con = new SqlConnection(constr);
con.Open();
SqlCommand cmd = new SqlCommand("select Voter_ID,Name,[House No],Age,Gender,Assem_constituency,Parliment_constituency,[Polling Station] from Malkajgiri", con);
cmd.CommandType = CommandType.Text;
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
CrystalDecisions.CrystalReports.Engine.ReportDocument doc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\CrystalReport1.rpt";
path = path.Replace("file:\\", "");
path = path.Replace("bin\\Debug\\", "");
CrystalReport1 cr = new CrystalReport1();
doc.Load(path);
doc.SetDataSource(dt.DefaultView);
if (dt.Rows.Count == 0)
{
MessageBox.Show("No data Found", "CrystalReportWithOracle");
return;
}
else
{
crystalReportViewer1.ReportSource = doc;
crystalReportViewer1.Visible = true;
crystalReportViewer1.Refresh();
con.Close();
}
}
Can anybody help me in this regard?
Reply
Answers (
0
)
create list of structure and add to list
How to create word document