protected void btnShow_Click(object sender, EventArgs e) { try { if (dpStartdate.Value != "" && dpEnddate.Value != "" && ddlCompanyName.SelectedValue != "") { ReportViewer1.Report = new ContraStatReport(); (ReportViewer1.Report as ContraStatReport).pvparam = UniqueCode.GetDateFormat_MM_dd_yyy(dpStartdate.Value); (ReportViewer1.Report as ContraStatReport).pvparam1 = UniqueCode.GetDateFormat_MM_dd_yyy(dpEnddate.Value); if (ddlAccountCode.Value == "" || ddlAccountCode.Value == String.Empty) { (ReportViewer1.Report as ContraStatReport).pvparam2 = null; } else { (ReportViewer1.Report as ContraStatReport).pvparam2 = ddlAccountCode.Value; } (ReportViewer1.Report as ContraStatReport).pvparam4 = ddlCompanyName.SelectedValue; ReportViewer1.RefreshReport(); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "myScript", "WarningMessage();", true); } } catch (Exception ex) { throw ex; } }
protected void btnShowReport_Click(object sender, EventArgs e) { try { ReportViewer1.Report = new rptWeavingWeftCMPXDaily(); DateTime dateFrom = Convert.ToDateTime(txtStartDate.Text); int company = Convert.ToInt16(Session["CompanyID"]); (ReportViewer1.Report as rptWeavingWeftCMPXDaily).paramDateFrom = dateFrom; //UniqueCode.GetDateFormat_MM_dd_yyy(txtStartDate.Text); (ReportViewer1.Report as rptWeavingWeftCMPXDaily).companyId = company; //Telerik.Reporting.Report report = (Telerik.Reporting.Report)this.ReportViewer1.Report; //Telerik.Reporting.TextBox txt = report.Items.Find("dtFrom", true)[0] as Telerik.Reporting.TextBox; //Telerik.Reporting.TextBox txt1 = report.Items.Find("dtTo", true)[0] as Telerik.Reporting.TextBox; //txt.Value = dateFrom.ToString("dd-MM-yyyy"); //string edate = dateTo != null ? dateTo.Value.ToString("dd-MM-yyyy") : ""; //if (txtEndDate.Text != "") //{ // txt1.Value = "To " + edate; //} //else //{ // txt1.Value = edate; //} ReportViewer1.RefreshReport(); } catch (Exception ex) { ex.ToString(); } }
private void ReportViewer1OnLoad(object sender, EventArgs eventArgs) { var ds = new DataSetLog(); var reportDataSource = new ReportDataSource(); ds.BeginInit(); reportDataSource.Name = "DataSetLog"; reportDataSource.Value = ds.LogExport; ReportViewer1.LocalReport.DataSources.Add(reportDataSource); ReportViewer1.LocalReport.ReportEmbeddedResource = "TemperatureRecorder.Report2.rdlc"; ReportViewer1.LocalReport.EnableExternalImages = true; ds.EndInit(); ds.LogExport.Clear(); ds.LogExport.AddLogExportRow(Export.ItemName, Export.StartDate, Export.EndDate, Export.Graph, Export.HashValue, Export.Min, Export.Max); var pageSettings = new PageSettings(); pageSettings.Margins.Top = 0; pageSettings.Margins.Bottom = 0; pageSettings.Margins.Left = 0; pageSettings.Margins.Right = 0; var pageSize = new PaperSize(); pageSize.RawKind = (int)PaperKind.A4; pageSettings.PaperSize = pageSize; pageSettings.Landscape = true; ReportViewer1.SetPageSettings(pageSettings); ReportViewer1.RefreshReport(); }
protected void btnShowReport_Click(object sender, EventArgs e) { //if (ddlHDONo.SelectedValue != "0") //{ // ReportViewer1.Report = new rpt_HDOMasterDetail(); // (ReportViewer1.Report as rpt_HDOMasterDetail).pramHDONo = ddlHDONo.SelectedValue.ToString();// "PI-00000155-Revise-2"; // ReportViewer1.RefreshReport(); //} //else //{ // Page.ClientScript.RegisterStartupScript(this.GetType(), "myScript", "WarningMessage();", true); // ReportViewer1.Report = new rpt_HDOMasterDetail(); // //(ReportViewer1.Report as rpt_HDOMasterDetail).pramHDONo = ddlHDONo.SelectedValue.ToString();// "PI-00000155-Revise-2"; // ReportViewer1.RefreshReport(); //} if (txtStartDate.Text != "" && txtEndDate.Text != "" && ddlCompany.SelectedValue != "") { ReportViewer1.Report = new rptHDOSummary(); (ReportViewer1.Report as rptHDOSummary).StartDate = UniqueCode.GetDateFormat_MM_dd_yyy(txtStartDate.Text); (ReportViewer1.Report as rptHDOSummary).EndDate = UniqueCode.GetDateFormat_MM_dd_yyy(txtEndDate.Text); (ReportViewer1.Report as rptHDOSummary).CreateBy = Convert.ToInt16(Session["UserID"]); (ReportViewer1.Report as rptHDOSummary).CompanyID = Convert.ToInt16(ddlCompany.SelectedValue); ReportViewer1.RefreshReport(); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "myScript", "WarningMessage();", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { RadTabStrip1.FindTabByText("Report").Enabled = false; } else { string ModeData = ModeDD.SelectedValue; var dt = GetData(ModeData); var objectDataSource = new ObjectDataSource { DataSource = dt }; var report = new RptCustomer { DataSource = objectDataSource }; report.DataSource = objectDataSource; var table = report.Items.Find("table1", true)[0] as Telerik.Reporting.Table; table.ColumnHeadersPrintOnEveryPage = true; table.DataSource = dt; var clientReportSource = new InstanceReportSource { ReportDocument = report }; ReportViewer1.ReportSource = clientReportSource; ReportViewer1.DataBind(); ReportViewer1.RefreshReport(); } }
protected void btnShowReport_Click(object sender, EventArgs e) { try { ReportViewer1.Report = new rptBallStopage(); DateTime dateFrom = Convert.ToDateTime(txtStartDate.Text); DateTime?dateTo = null; if (txtEndDate.Text != "") { dateTo = Convert.ToDateTime(txtEndDate.Text); } int shift = Convert.ToInt32(ddlShift.SelectedValue); int machine = Convert.ToInt32(ddlMachine.SelectedValue); int company = Convert.ToInt16(Session["CompanyID"]); (ReportViewer1.Report as rptBallStopage).paramDateFrom = dateFrom; //UniqueCode.GetDateFormat_MM_dd_yyy(txtStartDate.Text); (ReportViewer1.Report as rptBallStopage).paramDateTo = dateTo; (ReportViewer1.Report as rptBallStopage).paramShift = shift; (ReportViewer1.Report as rptBallStopage).paramMachine = machine; (ReportViewer1.Report as rptBallStopage).companyId = company; ReportViewer1.RefreshReport(); } catch (Exception ex) { ex.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (Page.RouteData.Values["Id"].ToSafeString() != "") { Report report = new Report1(); // Assigning the ObjectDataSource component to the DataSource property of the report. report.DataSource = new OrderRepository().GetOrderForPrint(Page.RouteData.Values["Id"].ToSafeInt()); // Use the InstanceReportSource to pass the report to the viewer for displaying InstanceReportSource reportSource = new InstanceReportSource(); reportSource.ReportDocument = report; //Assigning the report to the report viewer. ReportViewer1.ReportSource = reportSource; //Calling the RefreshReport method (only in WinForms applications). ReportViewer1.RefreshReport(); //Telerik.Reporting.UriReportSource uriReportSource = new Telerik.Reporting.UriReportSource(); //// Specifying an URL or a file path //uriReportSource.Uri = "~/Reports/ord.trdx"; //// Adding the initial parameter values //uriReportSource.Parameters.Add(new Telerik.Reporting.Parameter("Id", "1")); //ReportViewer1.ReportSource = uriReportSource; //ReportViewer1.RefreshReport(); } }
private async Task GetReportResult() { DateTime startDate = dateStart.SelectedDate.Value; DateTime endDate = dateEnd.SelectedDate.Value; int teacherId = (cmbTeacher.SelectedItem as TeacherModel).Id; IAsyncProxy <ITeacherService> _teacherAyncProxy = await Task.Run(() => ServiceHelper.GetTeacherService()); IList <TeacherClassRecordDetailModel> tcrdml = await _teacherAyncProxy.CallAsync(c => c.FindTeacherClassRecordDetailByDate(startDate, endDate, teacherId)); Telerik.Reporting.ObjectDataSource objectDataSource = new Telerik.Reporting.ObjectDataSource(); objectDataSource.DataSource = tcrdml; // GetData returns a DataTable //Creating a new report Telerik.Reporting.Report report1 = new TeacherClassRecordDetailReport(); report1.ReportParameters["StartDate"].Value = startDate.ToString("yyyy-MM-dd"); report1.ReportParameters["EndDate"].Value = endDate.ToString("yyyy-MM-dd"); report1.ReportParameters["Teacher"].Value = cmbTeacher.Text; // Assigning the ObjectDataSource component to the DataSource property of the report. report1.DataSource = objectDataSource; // Use the InstanceReportSource to pass the report to the viewer for displaying Telerik.Reporting.InstanceReportSource reportSource = new Telerik.Reporting.InstanceReportSource(); reportSource.ReportDocument = report1; // Assigning the report to the report viewer. ReportViewer1.ReportSource = reportSource; // Calling the RefreshReport method in case this is a WinForms application. ReportViewer1.RefreshReport(); }
private void Retrieve() { string convertedfrom = "2017-11-1"; string convertedto = "2017-11-30"; var dt = GetData(convertedfrom, convertedto); var objectDataSource = new ObjectDataSource { DataSource = dt }; var report = new LabelRpt { DataSource = objectDataSource }; report.DataSource = objectDataSource; var table = report.Items.Find("list1", true)[0] as Telerik.Reporting.List; table.ColumnHeadersPrintOnEveryPage = true; table.DataSource = dt; var clientReportSource = new InstanceReportSource { ReportDocument = report }; ReportViewer1.ReportSource = clientReportSource; ReportViewer1.DataBind(); ReportViewer1.RefreshReport(); }
private void DisplayReportReduceDebt_SPAndAgent() { List <RPT_AGENT_DEBT_41222> rt_RPT_AGENT_DEBT = new List <RPT_AGENT_DEBT_41222>(); rt_RPT_AGENT_DEBT = Reports.RPT_AGENT_DEBT_41222(Region, AgentName, SPName, DebtDate_From, DebtDate_To, Status, string.Empty, string.Empty, string.Empty, string.Empty); foreach (var d in rt_RPT_AGENT_DEBT) { d.pramDebt_StartDate = Request.QueryString["DebtDate_From"]; d.pramDebt_EndDate = Request.QueryString["DebtDate_To"]; d.pramStatus = Request.QueryString["Status"]; } cryRpt.Load(Server.MapPath("~/Report/RT_ReportReduceDebt_SPAndAgent.rpt")); cryRpt.SetDataSource(rt_RPT_AGENT_DEBT); ReportViewer1.ToolPanelView = ToolPanelViewType.None; ReportViewer1.HasCrystalLogo = false; ReportViewer1.ReportSource = cryRpt; ReportViewer1.RefreshReport(); //BinaryReader stream = new BinaryReader(cryRpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)); //Response.ClearContent(); //Response.ClearHeaders(); //Response.ContentType = "application/pdf"; //Response.BinaryWrite(stream.ReadBytes(Convert.ToInt32(stream.BaseStream.Length))); //Response.Flush(); //Response.Close(); }
protected void submit_Click(object sender, EventArgs e) { DateTime datez = Convert.ToDateTime(dates.SelectedDate); string convertedDate = datez.ToString("yyyy-MM-dd"); string selectedid = RadCmbTrans.SelectedValue; var dt = GetData(convertedDate, selectedid); var objectDataSource = new ObjectDataSource { DataSource = dt }; var report = new LabelRpt { DataSource = objectDataSource }; report.DataSource = objectDataSource; var table = report.Items.Find("table1", true)[0] as Telerik.Reporting.Table; table.ColumnHeadersPrintOnEveryPage = true; table.DataSource = dt; var clientReportSource = new InstanceReportSource { ReportDocument = report }; ReportViewer1.ReportSource = clientReportSource; ReportViewer1.DataBind(); ReportViewer1.RefreshReport(); RadTabStrip1.FindTabByText("Report").Enabled = true; RadTab tab1 = RadTabStrip1.Tabs.FindTabByText("Report"); tab1.Selected = true; tab1.PageView.Selected = true; }
protected void btnShow_Click(object sender, EventArgs e) { try { if (dpStartdate.Value != "" && dpEnddate.Value != "" && (hdnAcCode.Value != "" || chkAll.Checked) && ddlLevel.Value != "") { var ledgerValue = hdnAcCode.Value; if (chkAll.Checked) { ledgerValue = "All"; } ReportViewer1.Report = new TrialBalanceAllLevel(); (ReportViewer1.Report as TrialBalanceAllLevel).pvparam = Convert.ToInt32(Session["CompanyId"].ToString()); (ReportViewer1.Report as TrialBalanceAllLevel).pvparam1 = UniqueCode.GetDateFormat_MM_dd_yyy(dpStartdate.Value); (ReportViewer1.Report as TrialBalanceAllLevel).pvparam2 = UniqueCode.GetDateFormat_MM_dd_yyy(dpEnddate.Value); (ReportViewer1.Report as TrialBalanceAllLevel).pvparam3 = ledgerValue; (ReportViewer1.Report as TrialBalanceAllLevel).pvparam4 = ddlLevel.Value; ReportViewer1.RefreshReport(); Page.ClientScript.RegisterStartupScript(this.GetType(), "myScript", "BindAccountCode();", true); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "myScript", "WarningMessage();", true); } } catch (Exception ex) { throw ex; } }
protected void btnShow_Click(object sender, EventArgs e) { try { if (dpStartdate.Value != "" && dpEnddate.Value != "" && ddlAccountCode.Value != "") { ReportViewer1.Report = new LedgerBook(); (ReportViewer1.Report as LedgerBook).pvparam = UniqueCode.GetDateFormat_MM_dd_yyy(dpStartdate.Value); (ReportViewer1.Report as LedgerBook).pvparam1 = UniqueCode.GetDateFormat_MM_dd_yyy(dpEnddate.Value); (ReportViewer1.Report as LedgerBook).pvparam2 = ddlAccountCode.Value; (ReportViewer1.Report as LedgerBook).companyId = Convert.ToInt32(Session["CompanyID"].ToString()); ReportViewer1.RefreshReport(); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "myScript", "WarningMessage();", true); } } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { RadTabStrip1.FindTabByText("Report").Enabled = false; } else { DateTime datefroms = Convert.ToDateTime(datefrom.SelectedDate); DateTime datetos = Convert.ToDateTime(dateto.SelectedDate); string convertedfrom = datefroms.ToString("yyyy-MM-dd"); string convertedto = datetos.ToString("yyyy-MM-dd"); var dt = GetData(convertedfrom, convertedto); var objectDataSource = new ObjectDataSource { DataSource = dt }; var report = new RptTransIn { DataSource = objectDataSource }; report.DataSource = objectDataSource; var table = report.Items.Find("table1", true)[0] as Telerik.Reporting.Table; table.ColumnHeadersPrintOnEveryPage = true; table.DataSource = dt; var clientReportSource = new InstanceReportSource { ReportDocument = report }; ReportViewer1.ReportSource = clientReportSource; ReportViewer1.DataBind(); ReportViewer1.RefreshReport(); } }
protected void btnShow_Click(object sender, EventArgs e) { try { ReportViewer1.ReportSource = new RptStudentFeesReceived(); (ReportViewer1.Report as RptStudentFeesReceived).StartDate = DateTime.Parse(dpStartDate.SelectedDate.ToString()); (ReportViewer1.Report as RptStudentFeesReceived).EndDate = DateTime.Parse(dpEndDate.SelectedDate.ToString()); ReportViewer1.RefreshReport(); //Telerik.Reporting.Report report = (Telerik.Reporting.Report)this.ReportViewer1.Report; //Telerik.Reporting.TextBox txtdatefrom = report.Items.Find("txtDateFrom", true)[0] as Telerik.Reporting.TextBox; //Telerik.Reporting.TextBox txtdateto = report.Items.Find("txtdatet", true)[0] as Telerik.Reporting.TextBox; //txtdatefrom.Value = dpStartDate.SelectedDate.ToString(); //txtdateto.Value = dpEndDate.SelectedDate.ToString(); UpdatePanel2.Visible = true; } catch (Exception ex) { throw new Exception(ex.Message.ToString()); } }
protected void GenerateReport(string RPT, string PRM, string Region, string AgentName, string MonthGroup_From, string MonthGroup_To, string YearGroup_From, string YearGroup_To, string SPName) { try { ReportDocument cryRpt = new ReportDocument(); string User_ID = Request.Cookies["User_ID"].Value; //TableLogOnInfos crtableLogoninfos = new TableLogOnInfos(); //TableLogOnInfo crtableLogoninfo = new TableLogOnInfo(); //ConnectionInfo crConnectionInfo = new ConnectionInfo(); //Tables CrTables; switch (RPT) { case "ReportPoint_SP": ReportViewer1.ID = "รายงานแต้ม_" + datetime.Replace("/", string.Empty) + "_" + Time.Replace(":", string.Empty); List <RPT_SP_POINT_41225> rt_RPT_SP_POINT = new List <RPT_SP_POINT_41225>(); rt_RPT_SP_POINT = Reports.RPT_SP_POINT_41225(Region, AgentName, MonthGroup_From, MonthGroup_To, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty); // rt_RPT_Order = Reports.RPT_AnnualReport_4121(Region, AgentName,SPName,InvoiceDate,InvoiceDateTo,ProductGroup,Size); cryRpt.Load(Server.MapPath("~/Report/RT_ReportPoint.rpt")); cryRpt.SetDataSource(rt_RPT_SP_POINT); break; case "ReportPoint_Agent": ReportViewer1.ID = "รายงานแต้มสำหรับเอเยนต์_" + datetime.Replace("/", string.Empty) + "_" + Time.Replace(":", string.Empty); List <RPT_AGENT_POINT_41226> rt_RPT_AGENT_POINT = new List <RPT_AGENT_POINT_41226>(); rt_RPT_AGENT_POINT = Reports.RPT_AGENT_POINT_41226(string.Empty, AgentName, SPName, MonthGroup_From, MonthGroup_To, YearGroup_From, YearGroup_To, string.Empty, string.Empty, string.Empty); foreach (var d in rt_RPT_AGENT_POINT) { d.paramMonth_From = CV_Month(MonthGroup_From); d.paramMonth_To = CV_Month(MonthGroup_To); d.paramYear_From = YearGroup_From; d.paramYear_To = YearGroup_To; } cryRpt.Load(Server.MapPath("~/Report/RT_ReportPoint_Agent.rpt")); cryRpt.SetDataSource(rt_RPT_AGENT_POINT); break; } //BinaryReader stream = new BinaryReader(cryRpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)); //Response.ClearContent(); //Response.ClearHeaders(); //Response.ContentType = "application/pdf"; //Response.BinaryWrite(stream.ReadBytes(Convert.ToInt32(stream.BaseStream.Length))); //Response.Flush(); //Response.Close(); ReportViewer1.ToolPanelView = ToolPanelViewType.None; ReportViewer1.HasCrystalLogo = false; ReportViewer1.ReportSource = cryRpt; ReportViewer1.RefreshReport(); } catch (Exception ex) { logger.Error(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { var processRepo = new ProcessRepository(); var finishProductionProcessId = processRepo.Get(a => a.Name == "اتمام تولید").FirstOrDefault().Id; CheckShamsiDateFunctions(); int id; if (Page.Request.QueryString[0].ToSafeInt() == 0) { id = new WorksheetRepository().GetMaxId(); } else { id = Page.Request.QueryString[0].ToSafeInt(); } Report report = new ReportWorksheets(); Telerik.Reporting.SqlDataSource sqlDataSource = new Telerik.Reporting.SqlDataSource(); sqlDataSource.ConnectionString = "Tarin"; sqlDataSource.SelectCommand = "select WID,[Date],PartNo,WaxNo,ColorName,OperatorId,OperatorName,ProcessId,ProcessName from (" + "SELECT distinct w.Id WID, dbo.shamsidate(w.Date) as [Date] ,w.PartNo,w.WaxNo,c.Name ColorName, u.FriendlyName OperatorName," + //" d.ProductId,p.Code PCode, cat.Name + ' ' + p.Name PName" + " pro.Name ProcessName," + " pro.Id ProcessId," + " cat.Id CatId," + " u.Id OperatorId " + //" pcat.[order] " + "FROM worksheets w " + "join Colors c on c.Id = w.ColorId " + "join Users u on u.Id = w.OperatorId " + "join WorksheetDetails d on w.Id = d.WorksheetId " + "join Products p on p.Id = d.ProductId " + "join Categories cat on cat.Id = p.ProductCategoryId " + "join ProcessCategories pcat on pcat.CategoryId = cat.Id " + "join Processes pro on pro.Id = pcat.ProcessId" + ") s1 " + "where WId = @id " + "group by WID,[Date],PartNo,WaxNo,ColorName,OperatorId,OperatorName,ProcessId,ProcessName " + "order by ProcessId"; sqlDataSource.Parameters.Add("@id", System.Data.DbType.Int32, id); report.DataSource = sqlDataSource; InstanceReportSource reportSource = new InstanceReportSource(); reportSource.ReportDocument = report; ReportViewer1.ReportSource = reportSource; var table1 = report.Items.Find("table1", true)[0]; ((table1 as Telerik.Reporting.Table).DataSource as Telerik.Reporting.SqlDataSource).Parameters[0].Value = id; ReportViewer1.RefreshReport(); }
private void fStampa_Load(object sender, EventArgs e) { movimentiBindingSource.DataSource = DataTable_; #if __MonoCS__ #else ReportViewer1.RefreshReport(); #endif }
protected void btnShowReport_Click(object sender, EventArgs e) { try { ReportViewer1.Report = new rptSizeProduction(); DateTime dateFrom = Convert.ToDateTime(txtStartDate.Text); DateTime?dateTo = null; if (txtEndDate.Text != "") { dateTo = Convert.ToDateTime(txtEndDate.Text); } int shift = Convert.ToInt32(ddlShift.SelectedValue); int buyer = Convert.ToInt32(ddlShift.SelectedValue); int pi = Convert.ToInt32(ddlShift.SelectedValue); int item = Convert.ToInt32(ddlItem.SelectedValue); int set = Convert.ToInt32(ddlSet.SelectedValue); int machine = Convert.ToInt32(ddlMachine.SelectedValue); int pOperator = Convert.ToInt32(ddlMachine.SelectedValue); int company = Convert.ToInt16(Session["CompanyID"]); (ReportViewer1.Report as rptSizeProduction).paramDateFrom = dateFrom; //UniqueCode.GetDateFormat_MM_dd_yyy(txtStartDate.Text); (ReportViewer1.Report as rptSizeProduction).paramDateTo = dateTo; (ReportViewer1.Report as rptSizeProduction).paramShift = shift; (ReportViewer1.Report as rptSizeProduction).paramBuyer = buyer; (ReportViewer1.Report as rptSizeProduction).paramPI = pi; (ReportViewer1.Report as rptSizeProduction).paramItem = item; (ReportViewer1.Report as rptSizeProduction).paramSet = set; (ReportViewer1.Report as rptSizeProduction).paramMachine = machine; (ReportViewer1.Report as rptSizeProduction).paramOperator = pOperator; (ReportViewer1.Report as rptSizeProduction).companyId = company; //Telerik.Reporting.Report report = (Telerik.Reporting.Report)this.ReportViewer1.Report; //Telerik.Reporting.TextBox txt = report.Items.Find("dtFrom", true)[0] as Telerik.Reporting.TextBox; //Telerik.Reporting.TextBox txt1 = report.Items.Find("dtTo", true)[0] as Telerik.Reporting.TextBox; //txt.Value = dateFrom.ToString("dd-MM-yyyy"); //string edate = dateTo != null ? dateTo.Value.ToString("dd-MM-yyyy") : ""; //if (txtEndDate.Text != "") //{ // txt1.Value = "To " + edate; //} //else //{ // txt1.Value = edate; //} ReportViewer1.RefreshReport(); } catch (Exception ex) { ex.ToString(); } }
protected void GenerateReport(string RPT, string PRM, string Region, string AgentName, string SPName, string RequisitionDate_From, string RequisitionDate_To, string ProductGroup, string Size) { try { ReportDocument cryRpt = new ReportDocument(); switch (RPT) { case "ReportSaleSummaryByProductGroup": ReportViewer1.ID = "รายงานสรุปยอดขายแยกตามกลุ่มสินค้า_" + datetime.Replace("/", string.Empty) + "_" + Time.Replace(":", string.Empty); List <RPT_SUMM_SO_PG_41214> rt_RPT_Order = new List <RPT_SUMM_SO_PG_41214>(); // rt_RPT_Order = Reports.RPT_SUMM_SO_PG_41214(string.Empty,string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty); rt_RPT_Order = Reports.RPT_SUMM_SO_PG_41214(Region, AgentName, SPName , RequisitionDate_From, RequisitionDate_To, ProductGroup, Size, string.Empty, string.Empty, string.Empty); if (rt_RPT_Order.Count > 0) { foreach (RPT_SUMM_SO_PG_41214 r in rt_RPT_Order) { r.paramRegion_Name = Request.QueryString["Region"]; r.paramCV_Name = Request.QueryString["AgentFullName"]; r.paramSP_ID = Request.QueryString["SPName"]; r.paramSP_Name = Request.QueryString["SPFullName"].Replace(Request.QueryString["SPName"], ""); r.paramStartDate = Request.QueryString["RequisitionDate_From"]; r.paramEndDate = Request.QueryString["RequisitionDate_To"]; r.paramProd_Group = Request.QueryString["ProductGroup"]; r.paramSize = Request.QueryString["Size"];; } } cryRpt.Load(Server.MapPath("~/Report/RT_ReportSaleSummaryByProductGroup.rpt")); cryRpt.SetDataSource(rt_RPT_Order); break; } //BinaryReader stream = new BinaryReader(cryRpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)); //Response.ClearContent(); //Response.ClearHeaders(); //Response.ContentType = "application/pdf"; //Response.BinaryWrite(stream.ReadBytes(Convert.ToInt32(stream.BaseStream.Length))); //Response.Flush(); //Response.Close(); ReportViewer1.ToolPanelView = ToolPanelViewType.None; ReportViewer1.HasCrystalLogo = false; ReportViewer1.ReportSource = cryRpt; ReportViewer1.RefreshReport(); } catch (Exception ex) { logger.Error(ex.Message); } }
//public enum MonthEnum //{ // January, // February, // March, // April, // May, // June, // July, // August, // September, // October, // November, // December //} //protected void LoadMonth() //{ // try // { // ddlMonth.DataSource = Enum.GetNames(typeof(MonthEnum)); // ddlMonth.DataBind(); // ListItem item = new ListItem("--Select Month--", "0"); // ddlMonth.Items.Insert(0, item); // } // catch (Exception e) // { // e.ToString(); // } //} //void GetMonthBoundaries(int month, int year, out DateTime firstDayOfMonth, out DateTime lastDayOfMonth) //{ // // how to get the 1st day of the month? it's always day 1, so this is simple enough // DateTime first = new DateTime(year, month, 1); // // how do we get the last day of the month when months have // // varying numbers of days? // // // // adding 1 month to "first" gives us the 1st day of the following month // // then if we subtract one second from that date, we get a DateTime that // // represents the last second of the last day of the desired month // // example: if month = 2 and year = 2011, then // // first = 2011-02-01 00:00:00 // // last = 2011-02-28 23:59:59 // DateTime last = first.AddMonths(1).AddSeconds(-1); // // if you're not concerned with time of day in your DateTime values // // and are only comparing days, then you can use the following line // // instead to get the last day: // // // // DateTime last = first.AddMonths(1).AddDays(-1); // // example: if month = 2 and year = 2011, then // // first = 2011-02-01 00:00:00 // // last = 2011-02-28 00:00:00 // firstDayOfMonth = first; // lastDayOfMonth = last; //} protected void btnShowReport_Click(object sender, EventArgs e) { try { ReportViewer1.Report = new rptWeavingProductionSummery(); DateTime dateFrom = Convert.ToDateTime(txtStartDate.Text); DateTime?dateTo = null; if (txtEndDate.Text != "") { dateTo = Convert.ToDateTime(txtEndDate.Text); } int company = Convert.ToInt16(Session["CompanyID"]); int department = 0; if (company == 1) { department = 11; } else if (company == 2) { department = 60; } //var month = ddlMonth.SelectedIndex; (ReportViewer1.Report as rptWeavingProductionSummery).paramDateFrom = dateFrom; //UniqueCode.GetDateFormat_MM_dd_yyy(txtStartDate.Text); (ReportViewer1.Report as rptWeavingProductionSummery).paramDateTo = dateTo; (ReportViewer1.Report as rptWeavingProductionSummery).companyId = company; (ReportViewer1.Report as rptWeavingProductionSummery).departmentId = department; //Telerik.Reporting.Report report = (Telerik.Reporting.Report)this.ReportViewer1.Report; //Telerik.Reporting.TextBox txt = report.Items.Find("dtFrom", true)[0] as Telerik.Reporting.TextBox; //Telerik.Reporting.TextBox txt1 = report.Items.Find("dtTo", true)[0] as Telerik.Reporting.TextBox; //txt.Value = dateFrom.ToString("dd-MM-yyyy"); //string edate = dateTo != null ? dateTo.Value.ToString("dd-MM-yyyy") : ""; //if (txtEndDate.Text != "") //{ // txt1.Value = "To " + edate; //} //else //{ // txt1.Value = edate; //} ReportViewer1.RefreshReport(); } catch (Exception ex) { ex.ToString(); } }
private void DisplayReportDN_CN() { //ReportDocument cryRpt = new ReportDocument(); List <RPT_DN_CN_41224> rt_RPT_DN_CN = new List <RPT_DN_CN_41224>(); rt_RPT_DN_CN = Reports.RPT_DN_CN_41224(Region, AgentName, string.Empty, InvoiceDate, InvoiceDateTo, ddlType, CN_DN, Status, string.Empty); foreach (var d in rt_RPT_DN_CN) { d.paramRegion_Name = Request.QueryString["Region"]; if (d.paramRegion_Name == "") { d.paramRegion_Name = "เลือกทั้งหมด"; } if (AgentName != "") { _agent = dbo_AgentDataClass.Select_Record(AgentName); d.pramAgent_Name = _agent.AgentName; } else { d.pramAgent_Name = "เลือกทั้งหมด"; } d.pramDocNo = Request.QueryString["DebtID"]; d.pramType = Request.QueryString["ddlType"]; if (d.pramType == "") { d.pramType = "เลือกทั้งหมด"; } d.pramDebt_StartDate = Request.QueryString["InvoiceDate"]; d.pramDebt_EndDate = Request.QueryString["InvoiceDateTo"]; d.pramStatus = Request.QueryString["Status"]; if (d.pramStatus == "") { d.pramStatus = "เลือกทั้งหมด"; } } cryRpt.Load(Server.MapPath("~/Report/RT_ReportReduceDebt.rpt")); cryRpt.SetDataSource(rt_RPT_DN_CN); ReportViewer1.ToolPanelView = ToolPanelViewType.None; ReportViewer1.HasCrystalLogo = false; ReportViewer1.ReportSource = cryRpt; ReportViewer1.RefreshReport(); //BinaryReader stream = new BinaryReader(cryRpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)); //Response.ClearContent(); //Response.ClearHeaders(); //Response.ContentType = "application/pdf"; //Response.BinaryWrite(stream.ReadBytes(Convert.ToInt32(stream.BaseStream.Length))); //Response.Flush(); //Response.Close(); }
protected void ddlCompanyName_SelectedIndexChanged(object sender, EventArgs e) { if (ddlCompanyName.SelectedValue != "") { var companyId = Convert.ToInt32(ddlCompanyName.SelectedValue.ToString()); BindPV(companyId); } ReportViewer1.Report = new BankPaymentVoucherNew(); ReportViewer1.RefreshReport(); }
private void DisplayReportReduceDebt_CustomerAndSP() { ReportDocument cryRpt = new ReportDocument(); connDB = new ConnectionManager(); List <RPT_SP_DEBT_41221> rt_RPT_CUSTOMER_SP = new List <RPT_SP_DEBT_41221>(); rt_RPT_CUSTOMER_SP = Reports.RPT_SP_DEBT_41221(Region, AgentName, SPName, DebtID, DebtName, DebtDate_From, DebtDate_To, Status, string.Empty, string.Empty); foreach (var d in rt_RPT_CUSTOMER_SP) { d.paramRegion_Name = Request.QueryString["Region"]; if (d.paramRegion_Name == "") { d.paramRegion_Name = "เลือกทั้งหมด"; } if (AgentName != "") { _agent = dbo_AgentDataClass.Select_Record(AgentName); d.pramAgent_Name = _agent.AgentName; } else { d.pramAgent_Name = "เลือกทั้งหมด"; } d.pramSP_Name = Request.QueryString["SPName"]; d.pramDebt_StartDate = Request.QueryString["DebtDate_From"]; d.pramDebt_EndDate = Request.QueryString["DebtDate_To"]; d.pramStatus = Request.QueryString["Status"]; if (d.pramStatus == "") { d.pramStatus = "เลือกทั้งหมด"; } } cryRpt.Load(Server.MapPath("~/Report/RT_ReportReduceDebt_CustomerAndSP.rpt")); cryRpt.SetDataSource(rt_RPT_CUSTOMER_SP); ReportViewer1.ToolPanelView = ToolPanelViewType.None; ReportViewer1.HasCrystalLogo = false; ReportViewer1.ReportSource = cryRpt; ReportViewer1.RefreshReport(); //BinaryReader stream = new BinaryReader(cryRpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)); //Response.ClearContent(); //Response.ClearHeaders(); //Response.ContentType = "application/pdf"; //Response.BinaryWrite(stream.ReadBytes(Convert.ToInt32(stream.BaseStream.Length))); //Response.Flush(); //Response.Close(); }
protected void Button1_Click(object sender, EventArgs e) { var x = new Telerik.Reporting.InstanceReportSource(); x.Parameters.Add(new Telerik.Reporting.Parameter("pramPINo", "PI-00000155-Revise-2")); x.ReportDocument = new rptPI(); ReportViewer1.ReportSource = x; ReportViewer1.RefreshReport(); //ReportViewer1.Report = new rptPI(); //(ReportViewer1.Report as rptPI).pramPINo = "PI-00000155-Revise-2"; //ReportViewer1.RefreshReport(); }
protected void btnShowReport_Click(object sender, EventArgs e) { if (ddlCSNo.SelectedValue != "0") { ReportViewer1.Report = new rptCS(); (ReportViewer1.Report as rptCS).CSId = Convert.ToInt16(ddlCSNo.SelectedValue.ToString()); (ReportViewer1.Report as rptCS).companyId = Convert.ToInt16(ddlCompany.SelectedValue); ReportViewer1.RefreshReport(); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "myScript", "WarningMessage();", true); } }
protected void btnShowReport_Click(object sender, EventArgs e) { if (txtStartDate.Text != "" && txtEndDate.Text != "" && ddlCompany.SelectedValue != "") { ReportViewer1.Report = new rptFabricDeliveryStatement(); (ReportViewer1.Report as rptFabricDeliveryStatement).StartDate = UniqueCode.GetDateFormat_MM_dd_yyy(txtStartDate.Text); (ReportViewer1.Report as rptFabricDeliveryStatement).EndDate = UniqueCode.GetDateFormat_MM_dd_yyy(txtEndDate.Text); (ReportViewer1.Report as rptFabricDeliveryStatement).CompanyID = Convert.ToInt16(ddlCompany.SelectedValue); ReportViewer1.RefreshReport(); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "myScript", "WarningMessage();", true); } }
protected void btnShow_Click(object sender, EventArgs e) { try { string accountHead = ""; if (chkAll.Checked) { accountHead = "All"; } if (dpStartdate.Value != "" && dpEnddate.Value != "" && ddlCompanyName.SelectedValue != "") { ReportViewer1.Report = new TrialBalanveLevel15(); (ReportViewer1.Report as TrialBalanveLevel15).pvparam = ddlCompanyName.SelectedValue; (ReportViewer1.Report as TrialBalanveLevel15).pvparam1 = UniqueCode.GetDateFormat_MM_dd_yyy(dpStartdate.Value); (ReportViewer1.Report as TrialBalanveLevel15).pvparam2 = UniqueCode.GetDateFormat_MM_dd_yyy(dpEnddate.Value); if (ddlAccountCode.Value == "" || ddlAccountCode.Value == String.Empty) { (ReportViewer1.Report as TrialBalanveLevel15).pvparam3 = "All"; } else { (ReportViewer1.Report as TrialBalanveLevel15).pvparam3 = ddlAccountCode.Value; } ReportViewer1.RefreshReport(); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "myScript", "WarningMessage();", true); } } catch (Exception ex) { throw ex; } }
protected void btnShowReport_Click(object sender, EventArgs e) { if (txtStartDate.Text != "" && txtEndDate.Text != "" && ddlCompany.SelectedValue != "") { ReportViewer1.Report = new rptQuotationDetail(); (ReportViewer1.Report as rptQuotationDetail).startDate = UniqueCode.GetDateFormat_MM_dd_yyy(txtStartDate.Text); (ReportViewer1.Report as rptQuotationDetail).endDate = UniqueCode.GetDateFormat_MM_dd_yyy(txtEndDate.Text); (ReportViewer1.Report as rptQuotationDetail).createdBy = Convert.ToInt16(Session["UserID"]); (ReportViewer1.Report as rptQuotationDetail).companyId = Convert.ToInt16(ddlCompany.SelectedValue); ReportViewer1.RefreshReport(); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "myScript", "WarningMessage();", true); } }
protected void Page_Load(object sender, EventArgs e) { try { CheckSession(); var instanceReportSource = new Telerik.Reporting.InstanceReportSource(); instanceReportSource.ReportDocument = new ReportWebAppCNRS.TLDReagentReport(); instanceReportSource.Parameters.Add("poid", getPoID()); ReportViewer1.ReportSource = instanceReportSource; ReportViewer1.RefreshReport(); } catch (Exception ex) { Controller.SaveErrors(Path.GetFileName(Request.PhysicalPath), ex.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name); } }