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
Mahesh Gore
NA
9
6.9k
crystal report is not loading
Jul 5 2015 5:14 AM
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using CrystalDecisions.CrystalReports.Engine;
namespace LIC
{
public partial class FormDisplayReport : Form
{
public OleDbConnection connection = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" + ((object)Application.StartupPath).ToString() + "\\Database\\LIC.accdb';Persist Security Info=False;");
public OleDbCommand command;
public OleDbDataAdapter dap;
public string name = "";
public FormDisplayReport()
{
InitializeComponent();
}
private void FormDisplayReport_Load(object sender, EventArgs e)
{
try
{
connection.Open();
DataTable dataTable = this.GetReportData();
CrystalReport2 cust = new CrystalReport2();
//cust.Load(@"CrystalReport1.rpt");
cust.SetDataSource(dataTable);
crystalReportViewer1.ReportSource = cust;
crystalReportViewer1.RefreshReport();
}
catch (Exception ex)
{
}
}
private DataTable GetReportData()
{
try
{
string str = "select * from FORM_IA where Namet ='" + name + "'";
command = new OleDbCommand(str, connection);
dap = new OleDbDataAdapter(command);
DataSet dsRecords = new DataSet();
dap.Fill(dsRecords, "DataTable1");
return dsRecords.Tables["DataTable1"];
}
catch (Exception ex)
{
MessageBox.Show("Erro: " + ex.Message, "Invalid Selection", MessageBoxButtons.OK, MessageBoxIcon.Error);
return null;
}
}
}
}
this is my code ,,,,but crystal report is not loading,,means it shows nothing ..only blank report viewer
Reply
Answers (
1
)
I have send email with html body but email body data is loss
Need to know whether I am going correct or not