/// <summary> /// Function for Printing Sales Order Report on the basis of Sales Order. /// Created By: Lalit /// Created Date: 19july 2013 /// </summary> public string PrintSOReport(Stream Parameterdetails) { string File = ""; string[] Ht = new string[2]; try { SalesOrder _ObjSalesOrd = new SalesOrder(); _ObjSalesOrd = JsonHelper.DeserializeObj <SalesOrder>(Parameterdetails); string _SalesOrdNo = _ObjSalesOrd.SalesOrderNo; DataSet _DSNew = new PolypelxPortal_DAL.PortalDataSet.SODS1(); _Obj_Conn.ConnectionString = con.ConnectionString; con.OpenConnection(); cmd = new SqlCommand(); cmd.Connection = _Obj_Conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select * From View_SalesOrder1 Where OrdNo = '" + _SalesOrdNo + "'"; _Obj_SDA = new SqlDataAdapter(cmd); _Obj_SDA.Fill(_DSNew, "View_SalesOrder1"); if (_DSNew.Tables[0].Rows.Count > 0) { rptDoc.Load(ReportpathSO); rptDoc.SetDataSource(_DSNew); ExportOptions exportOpts = new ExportOptions(); PdfRtfWordFormatOptions pdfOpts = ExportOptions.CreatePdfRtfWordFormatOptions(); exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat; exportOpts.ExportFormatOptions = pdfOpts; _FlName = Guid.NewGuid().ToString() + ".pdf"; rptDoc.ExportToDisk(ExportFormatType.PortableDocFormat, (FileToSavepath + _FlName)); Ht[0] = FileAccessPath; Ht[1] = _FlName; File = JsonHelper.JsonSerializer <string[]>(Ht); rptDoc.Dispose(); } con.CloseConnection(); con.DisposeConnection(); _Obj_SDA.Dispose(); cmd.Dispose(); } catch (Exception ex) {}; return(File); }
/// <summary> /// Function for Printing Sales Order Report on the basis of Sales Order. /// Created By: Lalit /// Created Date: 19july 2013 /// </summary> public string PrintSOReport(Stream Parameterdetails) { string File = ""; string[] Ht = new string[2]; try { SalesOrder _ObjSalesOrd = new SalesOrder(); _ObjSalesOrd = JsonHelper.DeserializeObj<SalesOrder>(Parameterdetails); string _SalesOrdNo = _ObjSalesOrd.SalesOrderNo; DataSet _DSNew = new PolypelxPortal_DAL.PortalDataSet.SODS1(); _Obj_Conn.ConnectionString = con.ConnectionString; con.OpenConnection(); cmd = new SqlCommand(); cmd.Connection = _Obj_Conn; cmd.CommandType = CommandType.Text; cmd.CommandText = "Select * From View_SalesOrder1 Where OrdNo = '" + _SalesOrdNo + "'"; _Obj_SDA = new SqlDataAdapter(cmd); _Obj_SDA.Fill(_DSNew, "View_SalesOrder1"); if (_DSNew.Tables[0].Rows.Count > 0) { rptDoc.Load(ReportpathSO); rptDoc.SetDataSource(_DSNew); ExportOptions exportOpts = new ExportOptions(); PdfRtfWordFormatOptions pdfOpts = ExportOptions.CreatePdfRtfWordFormatOptions(); exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat; exportOpts.ExportFormatOptions = pdfOpts; _FlName = Guid.NewGuid().ToString() + ".pdf"; rptDoc.ExportToDisk(ExportFormatType.PortableDocFormat, (FileToSavepath + _FlName)); Ht[0] = FileAccessPath; Ht[1] = _FlName; File = JsonHelper.JsonSerializer<string[]>(Ht); rptDoc.Dispose(); } con.CloseConnection(); con.DisposeConnection(); _Obj_SDA.Dispose(); cmd.Dispose(); } catch (Exception ex) {}; return File; }