hi
i have a crystal report in my application application
all things are working fine
only problem is that the print is not working in crystal report toolbar
my design is:
<asp:Button ID ="btnprint" runat ="server" Text ="Print" onclick="btnprint_Click" />
<br />
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server"
AutoDataBind="true" />
code is:
{
if (!IsPostBack)
{
}
else
{
printindividual();
}
}
protected void btnprint_Click(object sender, EventArgs e)
{
printindividual();
}
void printindividual()
{
DBConn = new SqlConnection(strcon);
DBConn.Open();
command = new SqlCommand("Select * from demoforreport", DBConn);
// command.CommandType = CommandType.StoredProcedure;
//command.Parameters.AddWithValue("@Code", TextBox4.Text);
SqlDataAdapter adapter = new SqlDataAdapter(command);
DataSet dataset = new DataSet();
adapter.Fill(dataset, "demoforreport");
ReportDocument CustomerReport = new ReportDocument();
CustomerReport.Load(Server.MapPath("CrystalReport.rpt"));
CustomerReport.SetDataSource(dataset.Tables["demoforreport"]);
CrystalReportViewer1.ReportSource = CustomerReport;
CrystalReportViewer1.DataBind();
DBConn.Close();
}
please help me
thanks