Helloo,
i want to know about the Export the crystal report in PDF formate as well as direct save that export file in our website local folder and send in email as attachment via SMTP.
i tried and make PDF only but not success into save in our local folder as well as send as attachment of that PDF file into SMTP code.
protected void Page_Init(object sender, EventArgs e)
{
string id;
id = Request.QueryString["id"];
c.setcon();
String data = "SELECT * from Leave_record where id=" + id + "";
SqlDataAdapter ad1 = new SqlDataAdapter(data, c.getcon());
DataSet ds1 = new DataSet();
ad1.Fill(ds1);
path = Server.MapPath("REPORTS/leave_report.rpt");
cr = new ReportDocument();
cr.Load(path);
cr.SetDataSource(ds1.Tables[0]);
string name=Server.MapPath("PDF/mitesh.pdf");
cr.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false,name);
CrystalReportViewer1.ReportSource = cr;
}
Please help me.
Thanks and Regards...
Mitesh