private void DivStanding() { string strExportFile = null; strExportFile = Session["Report"].ToString(); PrintDocument printDoc = new PrintDocument(); //string PrinterName = ""; string ReportPath = ""; ReportDocument crReportDocument = new ReportDocument(); ReportPath = "Reports/DivStanding.rpt"; crReportDocument.Load(Server.MapPath(ReportPath)); CSBC.Components.Season.clsGames oData = new CSBC.Components.Season.clsGames(); //Pass the populated dataset to the report crReportDocument.SetDataSource(oData.GetStanding(1, Convert.ToInt32(Session["ScheduleNo"]))); crReportDocument.SetParameterValue("SeasonDesc", Session["SeasonDesc"]); crReportDocument.SetParameterValue("CompanyName", Session["CompanyName"]); crReportDocument.SetParameterValue("Division", Session["ScheduleDesc"]); oData = null; System.IO.MemoryStream s = (MemoryStream) crReportDocument.ExportToStream(ExportFormatType.PortableDocFormat); var _with2 = HttpContext.Current.Response; _with2.ClearContent(); _with2.ClearHeaders(); _with2.ContentType = "application/pdf"; _with2.AddHeader("Content-Disposition", "inline; filename=" + strExportFile); _with2.BinaryWrite(s.ToArray()); _with2.End(); printDoc = null; crReportDocument = null; }
private void DeleteRow(int ScheduleNumber, int GameNumber) { var oGames = new CSBC.Components.Season.clsGames(); try { oGames.DELRow((short)ScheduleNumber, (short)GameNumber); } catch (Exception ex) { lblError.Text = ex.Message; } finally { oGames = null; } }
private void Stats() { if (PrinterSettings.InstalledPrinters.Count == 0) { } else { string strExportFile = null; strExportFile = "PlayersStats"; PrintDocument printDoc = new PrintDocument(); string ReportPath = ""; ReportDocument crReportDocument = new ReportDocument(); ReportPath = "Reports/PlayersStats.rpt"; crReportDocument.Load(Server.MapPath(ReportPath)); CSBC.Components.Season.clsGames oData = new CSBC.Components.Season.clsGames(); //Pass the populated dataset to the report crReportDocument.SetDataSource(oData.GetStats(Convert.ToInt32(Session["ScheduleNo"]), 1)); crReportDocument.SetParameterValue("SeasonDesc", Session["SeasonDesc"]); crReportDocument.SetParameterValue("Division", Session["ScheduleDesc"]); oData = null; System.IO.MemoryStream s = (MemoryStream)crReportDocument.ExportToStream(ExportFormatType.PortableDocFormat); var _with3 = HttpContext.Current.Response; _with3.ClearContent(); _with3.ClearHeaders(); _with3.ContentType = "application/pdf"; _with3.AddHeader("Content-Disposition", "inline; filename=" + strExportFile); _with3.BinaryWrite(s.ToArray()); _with3.End(); printDoc = null; crReportDocument = null; } }