Click here to Skip to main content
15,900,477 members

Comments by Member 10042721 (Top 3 by date)

Member 10042721 5-Oct-13 6:38am View    
i solved above question
thank u for all
Member 10042721 3-Oct-13 23:56pm View    
LocalReport Report = new LocalReport();
DataSet dsReport = new SFIS_NEWDataSet(); // dataSet Feom database
try
{
objquotationdc.Quotationid = Convert.ToInt16(quotationid.Text);
dsReport = objquotationbl.get_quot_dets_pdf(objquotationdc);
if (dsReport.Tables[0].Rows.Count == 0)
{
return;
}
ReportDataSource reportrds = new ReportDataSource();
reportrds.Name = "DataSet1";
reportrds.Value = dsReport.Tables[0];
Report.DataSources.Add(reportrds);
Report.ReportPath = Server.MapPath("~") + "\\Samp_Quotation.rdlc";
Report.ReportEmbeddedResource = Server.MapPath("~") + "\\Samp_Quotation.rdlc";
Warning[] warnings;
string[] streamids;
string mimeType;
string encoding;
string filenameExtension;

byte[] bytes = Report.Render(
"PDF", null, out mimeType, out encoding, out filenameExtension,
out streamids, out warnings);

using (FileStream fs = new FileStream(Server.MapPath("~") + "\\Customer_Pdf\\MWFTS_Quotation_" + quotationid.Text + ".pdf", FileMode.Create))
{
fs.Write(bytes, 0, bytes.Length);
}


}
catch (Exception ex)
{
WebFormMaster.WriteToErrorLog("", ex);
}




protected void btnview_Click(object sender, EventArgs e)
{
try
{

sample_rep();
string FilePath = Server.MapPath("~") + "\\Customer_Pdf\\MWFTS_Quotation_" + quotationid.Text + ".pdf";
System.IO.FileInfo TargetFile = new System.IO.FileInfo(FilePath);
if (TargetFile.Exists)
{
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + TargetFile.Name);
Response.AddHeader("Content-Length", TargetFile.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(TargetFile.FullName);
}

}
catch (Exception exp)
{
WebFormMaster.WriteToErrorLog("", exp);
}
}
Member 10042721 3-Oct-13 8:36am View    
at web.config
sessionState timeout="60" mode="InProc"/>