protected void ClearAll() { TxtClientName.Text = ""; TxtFirmName.Text = ""; TxtEMailId.Text = ""; TxtFDOJ.Text = ""; TxtTDOJ.Text = ""; TxtFLeftDate.Text = ""; TxtTLeftDate.Text = ""; var ContryDs = from c in HRMLinq.Country_Masts orderby c.CountryName select new { CountryId = c.Id, c.CountryName }; ddlCountry.Items.Clear(); ddlCountry.DataSource = ContryDs; //BLayer.FillCountry(); ddlCountry.DataValueField = "CountryId"; ddlCountry.DataTextField = "CountryName"; ddlCountry.DataBind(); ddlCountry.Items.Insert(0, new ListItem("--Select Country--", "0")); ddlState.Items.Clear(); ddlState.Items.Insert(0, new ListItem("---Select State---", "0")); ddlCity.Items.Clear(); ddlCity.Items.Insert(0, new ListItem("---Select City---", "0")); //ReportViewer1.ProcessingMode = ProcessingMode.Local; //ReportViewer1.LocalReport.ReportPath = Server.MapPath("ClientInfo.rdlc"); ReportViewer1.Reset(); TxtClientName.Focus(); }
private void PrintLeave(int studentID) { try { clsManager manager = new clsManager(); ReportViewer1.Visible = true; ReportDataSource rds = new ReportDataSource(); ReportViewer1.Reset(); ReportViewer1.ProcessingMode = ProcessingMode.Local; LocalReport rep = ReportViewer1.LocalReport; rep.Refresh(); rds.Name = "Student"; rep.ReportPath = "Reports/rptStudentInfo.rdlc"; rds.Value = manager.RetrunDataset("select *from tblStudent where StudentId =" + studentID + " ").Tables[0]; ReportParameter[] p = { new ReportParameter("Company", "Square") }; rep.SetParameters(p); //This name must be in "<datasetname>_<datatablename>" format. This name can also be seen in dataset's datasource view. rep.DataSources.Add(rds); } catch { } }
public void Reporte() { Reportes xReporte = new Reportes(); //Parametros indicados string Conexion = Properties.Settings.Default.Conexion; string FechaInicial, FechaFinal; int Sucursal; //Sucursal Seleccionada Sucursal = int.Parse(ddSucursales.SelectedValue); //Convertir las entradas a un formato de tiempo reconocible para SQL Sever FechaInicial = DateTime.Parse(txtFechaIni.Text).ToString("u"); FechaFinal = DateTime.Parse(txtFechaFin.Text).ToString("u"); //Creacion del reporte ReportViewer1.Reset(); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/ReporteEntradas.rdlc"); ReportDataSource rds = new ReportDataSource(); rds.Name = "DataSetReporteEntradas"; rds.Value = xReporte.EntradaMercaderia(Sucursal, FechaInicial, FechaFinal, Conexion); ReportViewer1.LocalReport.DataSources.Add(rds); ReportViewer1.ShowRefreshButton = true; }
//protected void Page_Load(object sender, EventArgs e) //{ // try // { // if (!IsPostBack) // { // DateTime Sdt = Convert.ToDateTime(Request.QueryString["startdate"].ToString()); // DateTime Edt = Convert.ToDateTime(Request.QueryString["enddate"].ToString()); // int useridd = Convert.ToInt32(Request.QueryString["userid"].ToString()); // ReportViewer1.Reset(); // ReportViewer1.LocalReport.ReportPath = "Report/empReport.rdlc"; // ReportViewer1.LocalReport.SetParameters(new ReportParameter("EmpID", useridd.ToString())); // ReportViewer1.LocalReport.DataSources.Clear(); // ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", objEmpModelService.GetEmployeeAttendanceInfo(useridd, Sdt, Edt))); // ReportViewer1.DataBind(); // this.ReportViewer1.LocalReport.Refresh(); // } // ReportViewer1.Drillthrough += new DrillthroughEventHandler(ReportViewer1_Drillthrough); ; // } // catch (Exception ex) // { // } //} protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { DateTime Sdt = Convert.ToDateTime(Request.QueryString["startdate"].ToString()); DateTime Edt = Convert.ToDateTime(Request.QueryString["enddate"].ToString()); int userid = Convert.ToInt32(Request.QueryString["userid"].ToString()); ReportViewer1.Reset(); ReportViewer1.ShowPrintButton = false; ReportViewer1.LocalReport.ReportPath = "Report/mainreport.rdlc"; ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.SetParameters(new ReportParameter("startdate", Sdt.ToString())); ReportViewer1.LocalReport.SetParameters(new ReportParameter("enddate", Edt.ToString())); ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", objEmpModelService.GetEmployeeInfo(userid))); ReportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(LocalReport_SubreportProcessing); ReportViewer1.DataBind(); this.ReportViewer1.LocalReport.Refresh(); } ReportViewer1.Drillthrough += new DrillthroughEventHandler(ReportViewer1_Drillthrough); } catch (Exception ex) { } }
private void ShowReport() { ReportViewer1.Reset(); ReportDataSource dsOctober16 = new ReportDataSource("DataSet1", GetOctober16()); ReportDataSource dsNovember16 = new ReportDataSource("DataSet2", GetNovember16()); //ReportDataSource dsDecember16 = new ReportDataSource("DataSet3", GetDecember16()); //ReportDataSource dsAugust4th = new ReportDataSource("DataSet4", GetAugust4th()); ReportViewer1.LocalReport.DataSources.Add(dsOctober16); ReportViewer1.LocalReport.DataSources.Add(dsNovember16); //ReportViewer1.LocalReport.DataSources.Add(dsDecember16); //ReportViewer1.LocalReport.DataSources.Add(dsAugust4th); ReportViewer1.LocalReport.ReportPath = "Spreading_Report2.rdlc"; //ReportViewer1.LocalReport.Refresh(); //testing pdf var bytes = ReportViewer1.LocalReport.Render("PDF"); Response.Buffer = true; Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "inline;attachment; filename=Sample.pdf"); Response.BinaryWrite(bytes); Response.Flush(); // send it to the client to download Response.Clear(); }
public void RenderReport() { DataSet ds = new DataSet(); using (System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString)) { using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand()) { cmd.CommandText = "usp_DanhSachXuatNhapTonSp2"; //cmd.Parameters.AddWithValue("@CandidateID", CandidateID); cmd.Connection = conn; cmd.CommandType = CommandType.StoredProcedure; conn.Open(); System.Data.SqlClient.SqlDataAdapter adapter = new System.Data.SqlClient.SqlDataAdapter(cmd); adapter.Fill(ds); conn.Close(); } } ds.Tables[0].TableName = "HeaderInfomation"; ds.Tables[1].TableName = "Detail"; ReportViewer1.Reset(); ReportViewer1.LocalReport.EnableExternalImages = true; //ReportViewer1.LocalReport.EnableHyperlinks = true; ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("HeaderInfomation", ds.Tables[0])); ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("Detail", ds.Tables[1])); ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Report/DanhSachXuatNhapTonSP.rdlc"); //ReportViewer1.LocalReport.DisplayName = "Phieu-dang-ki-tim-viec-KT-" + CreateDate + "-" + code; ReportViewer1.ServerReport.Refresh(); }
private void MostrarReporte() { ReportViewer1.Reset(); DataTable dt = GenerarReporte(int.Parse(TextBox1.Text)); DataTable dt2 = GenerarReporte2(int.Parse(TextBox1.Text)); // DataTable dt3 = GenerarReporte3(int.Parse(TextBox1.Text));*/ ReportDataSource rds = new ReportDataSource("DataSet1", dt); ReportDataSource rds2 = new ReportDataSource("DataSet2", dt2); //ReportDataSource rds3 = new ReportDataSource("DataSet3",dt3); //ReportViewer1.LocalReport.DataSources.Add(rds3); ReportViewer1.LocalReport.DataSources.Add(rds); ReportViewer1.LocalReport.DataSources.Add(rds2); ReportViewer1.LocalReport.ReportPath = "Report1Abonos.rdlc"; ReportParameter[] rptpara = new ReportParameter[] { new ReportParameter("Nit", TextBox1.Text) }; ReportViewer1.LocalReport.SetParameters(rptpara); ReportViewer1.LocalReport.Refresh(); }
public void CrearFactura() { Reportes xReporte = new Reportes(); ReportDataSource rds = new ReportDataSource(); string Conexion = Properties.Settings.Default.Conexion; try { int Numero = 0; string Serie = ddSerie.SelectedValue.ToString(); Numero = int.Parse(txtNumero.Text); ReportViewer1.Reset(); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/rpFacturaDetalle.rdlc"); rds.Name = "DataSetFacturaDetalle"; rds.Value = xReporte.Factura(Serie, Numero, Conexion); ReportViewer1.LocalReport.DataSources.Add(rds); ReportViewer1.ShowRefreshButton = true; Mensaje("Reporte generado correctamente", "success", ""); } catch (Exception ex) { Mensaje("Error: ", "danger", ex.Message); } }
protected void btnPrint_Click(object sender, EventArgs e) { DataTable data = oRTN_Service.getDataRtnList(lblID.Text); System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(@"<script type='text/javascript'>"); sb.Append("$('#printRtnModal').modal('show');"); sb.Append(@"</script>"); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "PrintModalScript", sb.ToString(), false); ReportViewer1.Reset(); ReportViewer1.Visible = true; ReportDataSource dt = new ReportDataSource("DataSet1", data); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(dt); ReportViewer1.LocalReport.ReportPath = @"Reports\RtnList.rdlc"; ReportViewer1.LocalReport.Refresh(); ReportViewer1.DataBind(); //byte[] bytes = ReportViewer1.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); //Response.Buffer = true; //Response.ClearHeaders(); //Response.Clear(); //Response.ContentType = mimeType; //Response.AddHeader("content-disposition", "inline; filename= " + lblLCSRequestNo.Text + "." + extension); //Response.BinaryWrite(bytes); //Response.Flush(); }
protected void btnbuscar_Click(object sender, EventArgs e) { string company, fechaini, fechafin; company = ""; //usuario = ""; fechafin = ""; fechafin = ""; company = txtcompany.Text.ToString(); //usuario = txtUsuario.Text.ToString(); fechaini = txtfechaini.Text.ToString(); fechafin = txtfechafin.Text.ToString(); ObtenerIndicadorNivelCumplimiento(company, fechaini, fechafin); DataTable table = ConvertListToDataTable(Indicadores); ReportViewer1.Reset(); ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Content/Report/Report1.rdlc"); ReportDataSource rds = new ReportDataSource("DataSet", table); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(rds); ReportViewer1.DataBind(); ReportViewer1.LocalReport.Refresh(); }
public void CargarReporte() { Reportes xReporte = new Reportes(); ReportDataSource rds = new ReportDataSource(); string Conexion = Properties.Settings.Default.Conexion; int Numero = 0; try { ReportViewer1.Reset(); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/rpEntradasYSalidasMercaderia.rdlc"); rds.Name = "DataSetEntradasYSalidasMercaderia"; if (chkOpcion.Checked) { rds.Value = xReporte.BoletasDetalle(Char.Parse(ddTipoBoleta.SelectedValue.ToString()), Conexion); } else { Numero = int.Parse(txtNumero.Text); rds.Value = xReporte.BoletasDetalle(Numero, Conexion); } ReportViewer1.LocalReport.DataSources.Add(rds); ReportViewer1.ShowRefreshButton = true; Mensaje("Reporte generado correctamente", "success", ""); } catch (Exception ex) { Mensaje("Error: ", "danger", ex.Message); } }
public void PopulateGrid(IQueryable <trn_PurchaseOrderDetails> quotation) { var companyName = _currentContext.GetCompany.companyName; var agentList = from p in quotation.ToList() select new { CompanyName = _currentContext.GetCompany.companyName, PurchaseCD = p.trn_PurchaseOrder.PurchaseCD, TrnCD = p.trn_PurchaseOrder.TrnCD, SupplierCD = p.trn_PurchaseOrder.SupplierCD, DocumentDate = p.trn_PurchaseOrder.DocumentDate.ToString(HmGlobal.StandardDateFormat), Subject = p.trn_PurchaseOrder.Subject, PartNo = p.mst_Product.PartNo, Quantity = p.OrderQuantity, UnitPrice = p.UnitPrice, Amount = p.Amount }; ReportViewer1.Reset(); ReportViewer1.LocalReport.ReportPath = "Report/RDLC/PurchaseOrder.rdlc"; ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("PurchaseOrderDataset", agentList)); ReportViewer1.LocalReport.Refresh(); }
private void GenerateReport() { //dataTable ReportViewer1.Reset(); DataTable dt = GetData(); ReportDataSource dataSource = new ReportDataSource("DataSet1", dt); ReportViewer1.LocalReport.DataSources.Add(dataSource); ReportViewer1.LocalReport.ReportPath = "Laporan/InvRusak.rdlc"; PageSettings pg = new System.Drawing.Printing.PageSettings(); pg.Margins.Top = 0; pg.Margins.Bottom = 0; pg.Margins.Left = 0; pg.Margins.Right = 0; PrinterSettings ps = new System.Drawing.Printing.PrinterSettings(); ps.PrinterName = "Microsoft XPS Document Writer"; PaperSize size = new PaperSize(); size.RawKind = (int)PaperKind.A4; pg.PaperSize = size; pg.PrinterSettings = ps; ReportViewer1.SetPageSettings(pg); ReportViewer1.LocalReport.Refresh(); }
/// <summary> /// 绑定数据 /// </summary> protected void getData() { //string pNian = Application["Nian"].ToString().Trim(); //string pDanwei = Application["DanweiMingcheng"].ToString().Trim(); //string pTitle = pNian + "年" + pDanwei + "考点代码表"; SqlConnection conn = new SqlConnection(con); conn.Open(); string sql = string.Format("select * from dm_kaodian"); SqlDataAdapter da = new SqlDataAdapter(sql, conn); DataTable dt = new DataTable(); da.Fill(dt); conn.Close(); //各单位报到单格式不同 ReportViewer1.Reset(); ReportViewer1.LocalReport.ReportPath = Server.MapPath("Report2.rdlc"); //ReportViewer1.LocalReport.DisplayName = pTitle + "_" + Application["danwei"].ToString() + "_" + DateTime.Now.ToString("yyyyMMdd_HHmmssff"); //ReportParameter[] parameters = new ReportParameter[2]; //parameters[0] = new ReportParameter("pTitle", pTitle); //parameters[1] = new ReportParameter("pDanwei", "单位:" + pDanwei); ReportDataSource rds1 = new ReportDataSource("DataSet1", dt); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(rds1); //ReportViewer1.LocalReport.SetParameters(); //getReportViewr(); ReportViewer1.LocalReport.Refresh(); }
/// <summary> /// Leonardo Carrion /// 06/may/2021 /// Efecto: cargar el reporte con los datos filtrados /// Requiere: - /// Modifica: datasource del reporte /// Devuelve: - /// </summary> public void cargarDatosReporte() { Periodo periodo = new Periodo(); periodo.anoPeriodo = Convert.ToInt32(ddlPeriodos.SelectedValue); Proyectos proyecto = new Proyectos(); proyecto.idProyecto = Convert.ToInt32(ddlProyectos.SelectedValue); Unidad unidad = new Unidad(); unidad.idUnidad = Convert.ToInt32(ddlUnidades.SelectedValue); Session["listaReporteEgresos"] = reporte_DetalleEjecucionesServicios.getReporteEgresosPorUnidades(proyecto.idProyecto, periodo.anoPeriodo, unidad.idUnidad); ReportViewer1.Reset(); ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.ReportPath = Server.MapPath("ReporteDetalleEjecuciones.rdlc"); ReportDataSource reportDataSource = null; List <ReporteDetalleEjecucion> listaReporteDuracion = (List <ReporteDetalleEjecucion>)Session["listaReporteEgresos"]; reportDataSource = new ReportDataSource("DataSet1", listaReporteDuracion); if (reportDataSource.Equals(null) == false) { ReportViewer1.LocalReport.DataSources.Add(reportDataSource); } ReportViewer1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ReportViewer1.Reset(); ReportViewer1.ProcessingMode = ProcessingMode.Local; //ReportViewer1.LocalReport.DataSources.Clear(); ////ReportDataSource rptsrc = new ReportDataSource("DataSet1", GetData()); //ReportParameter rp1 = new ReportParameter("Month", DateTime.Now.Month.ToString()); //ReportParameter rp2 = new ReportParameter("Year", DateTime.Now.Year.ToString()); ReportViewer1.LocalReport.ReportPath = "Report.rdlc"; ////ReportViewer1.LocalReport.DataSources.Add(rptsrc); //ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp1, rp2 }); ReportViewer1.LocalReport.Refresh(); //ReportDocument rd = new ReportDocument(); //string path2 = Server.MapPath("~/CrystalReport2.rpt"); //rd.Load(path2); //rd.SetParameterValue("reportdate", DateTime.Now.ToString("dddd, dd-MM-yyyy")); //rd.SetParameterValue("totaloperational", Session["totop"]); //rd.SetParameterValue("totalcash", Session["totcash"]); //rd.SetParameterValue("totalstocks", Session["totstocks"]); //rd.SetParameterValue("sisastocks", Session["sisastocks"]); //rd.SetParameterValue("keterangan", Session["keterangan"]); //CrystalReportPartsViewer1.ReportSource = rd; //CrystalReportPartsViewer1.Refresh(); } }
protected void Page_Load(object sender, EventArgs e) { orgId = Convert.ToInt32(Session["OrgId"]); if (orgId == 0) { Response.Redirect("~/CMSHome.aspx"); } if (!IsPostBack) { int orgId = Convert.ToInt32(Session["OrgId"]); usercode = Convert.ToString(Session["UserName"]); ReportViewer1.Reset(); DataTable dt = GetData(); ReportDataSource ds = new ReportDataSource("DataSet1", dt); ReportViewer1.LocalReport.DataSources.Add(ds); ReportViewer1.LocalReport.ReportPath = "Report2.rdlc"; ReportViewer1.LocalReport.Refresh(); } lblObtain.Text = db.getDbstatus_Value("SELECT COUNT(Status) AS Expr1 FROM tblOnlineResult WHERE (OrgId = '" + Convert.ToInt32(Session["OrgId"]) + "') AND (UserCode = '" + Convert.ToString(Session["UserName"]) + "') AND (unitType = '" + Session["testtype"].ToString() + "') AND (SubjectName = '" + Convert.ToString(Session["subject"]) + "') AND (Status = '" + "TRUE" + "')"); lblOutOf.Text = db.getDbstatus_Value("SELECT COUNT(Status) AS Expr1 FROM tblOnlineResult WHERE (OrgId = '" + Convert.ToInt32(Session["OrgId"]) + "') AND (UserCode = '" + Convert.ToString(Session["UserName"]) + "') AND (unitType = '" + Session["testtype"].ToString() + "') AND (SubjectName = '" + Convert.ToString(Session["subject"]) + "')"); Thread.Sleep(1000); db.insert("delete tblOnlineResult where UserCode ='" + Convert.ToString(Session["UserName"]) + "'"); //Response.Redirect("~/Student_Home.aspx"); }
private void GenerateReport() { //dataTable string idPengajuan = Request.QueryString["IdPengajuan"]; ReportViewer1.Reset(); ReportViewer1.LocalReport.ReportPath = "Laporan/PengajuanInvDetail.rdlc"; PengajuanDomain peDomain = GeneratePengajuan(idPengajuan); ReportParameter[] parameters = new ReportParameter[5]; parameters[0] = new ReportParameter("IDPengajuan", peDomain.IDPengajuan); parameters[1] = new ReportParameter("TglPengajuan", peDomain.Tgl); // parameters[2] = new ReportParameter("Judul", peDomain.Hal); parameters[2] = new ReportParameter("Judul", peDomain.Judul); parameters[3] = new ReportParameter("Keterangan", peDomain.Keterangan); if (peDomain.Prioritas.Equals("3")) { parameters[4] = new ReportParameter("Prioritas", "Normal"); } else if (peDomain.Prioritas.Equals("2")) { parameters[4] = new ReportParameter("Prioritas", "Penting"); } else if (peDomain.Prioritas.Equals("1")) { parameters[4] = new ReportParameter("Prioritas", "Urgen"); } ReportViewer1.LocalReport.SetParameters(parameters); DataTable dt = GetData(peDomain.IDPengajuan); ReportDataSource dataSource = new ReportDataSource("DataSet1", dt); ReportViewer1.LocalReport.DataSources.Add(dataSource); ReportViewer1.ShowPrintButton = true; PageSettings pg = new System.Drawing.Printing.PageSettings(); pg.Margins.Top = 0; pg.Margins.Bottom = 0; pg.Margins.Left = 0; pg.Margins.Right = 0; PrinterSettings ps = new System.Drawing.Printing.PrinterSettings(); ps.PrinterName = "Microsoft XPS Document Writer"; PaperSize size = new PaperSize(); size.RawKind = (int)PaperKind.A4; pg.PaperSize = size; pg.PrinterSettings = ps; ReportViewer1.SetPageSettings(pg); ReportViewer1.LocalReport.Refresh(); }
protected void btnQuery_Click(object sender, EventArgs e) { Page_Load(sender, e); string strCurrentDate1 = ddlStartYear.SelectedValue.ToString() + "-" + ddlStartMonth.SelectedValue.ToString(); OracleConnection conn = DB.createConn(); OracleDataAdapter da = new OracleDataAdapter(); DataSet ds = new DataSet(); string strSQL = ""; try { if (newdate) { newdate = false; } conn.Open(); //SELECT '岗位点检' as djfl,sum(gwsl) as djsl from xgwebrpt.TS_SBDJZB where logtime='2019-10' and zhou='4' //UNION //SELECT '技术点检' as djfl,sum(jssl) as djsl from xgwebrpt.TS_SBDJZB where logtime='2019-10' and zhou='4' //UNION //SELECT '专业点检' as djfl,sum(zysl) as djsl from xgwebrpt.TS_SBDJZB where logtime='2019-10' and zhou='4' //strSQL = "Select * from ts_sbdjzb where LOGTIME ='" + strCurrentDate1 + "' and zhou='" + ddlzhou.SelectedValue.ToString() + "'"; strSQL = "select '" + strCurrentDate1 + "' as logtime ,'" + ddlzhou.SelectedValue.ToString() + "' as zhou,djfl,djsl,wtsl from "; strSQL += "("; strSQL += "SELECT '管理点检' as djfl,sum(zysl) as djsl,sum(glwtsl) as wtsl from xgwebrpt.TS_SBDJZB where djdw in('冶炼维修车间','连铸维修车间','冶炼一车间') and logtime='" + strCurrentDate1 + "' and zhou='" + ddlzhou.SelectedValue.ToString() + "'"; strSQL += " union "; strSQL += "SELECT '岗位点检' as djfl,sum(gwsl) as djsl,sum(wtsl) as wtsl from xgwebrpt.TS_SBDJZB where djdw in('连铸车间','精炼车间','冶炼一车间') and logtime='" + strCurrentDate1 + "' and zhou='" + ddlzhou.SelectedValue.ToString() + "'"; strSQL += " union "; strSQL += "SELECT '维修点检' as djfl,sum(jssl) as djsl,sum(wtsl-glwtsl) as wtsl from xgwebrpt.TS_SBDJZB where djdw in('冶炼维修车间','连铸维修车间','冶炼一车间') and logtime='" + strCurrentDate1 + "' and zhou='" + ddlzhou.SelectedValue.ToString() + "'"; strSQL += ")"; //strSQL += " order by logtime"; da.SelectCommand = new OracleCommand(strSQL, conn); ds = new DataSet(); da.Fill(ds, "tb"); ReportViewer1.Visible = true; ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.Reset(); ReportDataSource rds = new ReportDataSource("Dsdjfl", ds.Tables[0]); ReportViewer1.LocalReport.DataSources.Add(rds); ReportViewer1.LocalReport.ReportPath = "Quality\\sbdjzbfl.rdlc"; ReportViewer1.LocalReport.Refresh(); ds.Dispose(); conn.Close(); } catch (Exception ee) { string strMessage = ee.Message.ToString(); } finally { ds.Dispose(); conn.Close(); } }
protected void btnShowReport_Click(object sender, EventArgs e) { ReportViewer1.Reset(); ReportDataSource rptSrc = new ReportDataSource("DataSet1", GetData()); ReportViewer1.LocalReport.DataSources.Add(rptSrc); ReportViewer1.LocalReport.ReportPath = "ContactList.rdlc"; ReportViewer1.LocalReport.Refresh(); }
protected void btnSearch_Click(object sender, EventArgs e) { if (DDLBusinessUnit.SelectedValue != "-1" && !string.IsNullOrEmpty(txtStdDate.Text.Trim()) && !string.IsNullOrEmpty(txtEndDate.Text.Trim())) { DateTime dateFrom = DateTime.ParseExact(txtStdDate.Text.Trim(), "dd/MM/yyyy", null); DateTime dateTo = DateTime.ParseExact(txtEndDate.Text.Trim(), "dd/MM/yyyy", null); if (dateFrom > dateTo) { oUtility.MsgAlert(this, "Plese select end date more than start date."); } else { DataTable result = null; if (DDLCustomer.SelectedValue == "-1") { result = oREPORT_Service.getData_VW_RPT_SUMMARY(DDLBusinessUnit.SelectedValue, DDLCustomer.SelectedValue, txtStdDate.Text.Trim(), txtEndDate.Text.Trim()); } else { result = oREPORT_Service.getData_VW_RPT_SUMMARY(DDLBusinessUnit.SelectedValue, DDLCustomer.SelectedValue, txtStdDate.Text.Trim(), txtEndDate.Text.Trim()); } ReportViewer1.Reset(); ReportViewer1.Visible = true; ReportDataSource dt = new ReportDataSource("DataSet1", result); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(dt); if (DDLReportType.SelectedValue == "A") { ReportViewer1.LocalReport.ReportPath = @"Reports\VW_RPT_SUMMARY.rdlc"; } else { ReportViewer1.LocalReport.ReportPath = @"Reports\VW_RPT_SUMMARY_DETAIL.rdlc"; } string oHeader = "Summary Report from " + txtStdDate.Text.Trim() + " - " + txtEndDate.Text.Trim(); string oDepartment = "Department : " + DDLCustomer.SelectedItem.ToString(); ReportParameter header = new ReportParameter("header", oHeader); ReportParameter department = new ReportParameter("department", oDepartment); ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { header, department }); ReportViewer1.LocalReport.Refresh(); ReportViewer1.DataBind(); //byte[] bytes = ReportViewer1.LocalReport.Render("EXCEL", null, out mimeType, out encoding, out extension, out streamIds, out warnings); //Response.Buffer = true; //Response.ClearHeaders(); //Response.Clear(); //Response.ContentType = mimeType; //Response.AddHeader("content-disposition", "attachment; filename= VW_RPT_SUMMARY." + extension); //Response.BinaryWrite(bytes); //Response.Flush(); } } else { oUtility.MsgAlert(this, "Plese select all fields."); } }
protected void btnPrint_Click(object sender, EventArgs e) { DataTable data = oEQUIPMENT_Service.invoiceEditData(lblDetailId.Text); ReportViewer1.Reset(); ReportDataSource dt = new ReportDataSource("DataSet1", data); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(dt); if (chkNoDate.Checked && chkNoVat.Checked) { ReportViewer1.LocalReport.ReportPath = @"Reports\Equipment\Invoice\Invoice_ExcDateExcVat.rdlc"; } else if (!chkNoDate.Checked && chkNoVat.Checked) { ReportViewer1.LocalReport.ReportPath = @"Reports\Equipment\Invoice\Invoice_ExcVat.rdlc"; } else if (chkNoDate.Checked && !chkNoVat.Checked) { ReportViewer1.LocalReport.ReportPath = @"Reports\Equipment\Invoice\Invoice_ExcDate.rdlc"; } else { ReportViewer1.LocalReport.ReportPath = @"Reports\Equipment\Invoice\Invoice.rdlc";; } //Calculate double total = 0; if (data.Rows.Count > 0) { for (int i = 0; i < data.Rows.Count; i++) { double aa = Convert.ToDouble(data.Rows[i]["Amount"]); total += aa; } if (!string.IsNullOrEmpty(data.Rows[0]["Invoice_Discount"].ToString())) { double bb = Convert.ToDouble(data.Rows[0]["Invoice_Discount"]); total -= bb; } } ReportParameter totalExVat = new ReportParameter("TotalExVat", total.ToString()); ReportParameter Vat = new ReportParameter("Vat", ((Convert.ToDecimal(total) * Convert.ToDecimal(data.Rows[0]["Cus_Vat"])) / 100).ToString()); ReportParameter totalIncVat = new ReportParameter("TotalIncVat", (Convert.ToDecimal(total) + ((Convert.ToDecimal(total) * (Convert.ToDecimal(data.Rows[0]["Cus_Vat"]) / 100)))).ToString()); ReportParameter thaiBahtIncVat = new ReportParameter("ThaiBahtIncVat", oUtility.ThaiBaht((Convert.ToDecimal(total) + ((Convert.ToDecimal(total) * (Convert.ToDecimal(data.Rows[0]["Cus_Vat"]) / 100)))).ToString())); ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { totalExVat, Vat, totalIncVat, thaiBahtIncVat }); byte[] bytes = ReportViewer1.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings); Response.Buffer = true; Response.ClearHeaders(); Response.Clear(); Response.ContentType = mimeType; Response.AddHeader("content-disposition", "inline; filename= " + lblDetailInvoiceNumber.Text + "." + extension); Response.BinaryWrite(bytes); Response.Flush(); }
protected void btnGenerar_Click(object sender, EventArgs e) { string sProveedor = ""; try { //Ocultar los botones ReportViewer1.ShowPageNavigationControls = false; ReportViewer1.ShowBackButton = false; ReportViewer1.ShowFindControls = false; ReportViewer1.ShowPrintButton = true; ReportViewer1.ShowExportControls = true; ReportViewer1.LocalReport.EnableExternalImages = true; //ReportViewer1.LocalReport.ExecuteReportInCurrentAppDomain(AppDomain.CurrentDomain.Evidence); ReportViewer1.Reset(); ReportViewer1.LocalReport.Dispose(); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.ReportPath = "Reports\\RepFacXFolio_" + ((Usuario)Session["oUsuario"]).Idioma + ".rdlc"; ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local; //Si el usuario es un usuario del proveedor, agrega el proveedor a los filtros NegocioPF.Proveedor oProveedor = new NegocioPF.Proveedor(((Usuario)Session["oUsuario"]).Id); oProveedor.Cargar(); if (oProveedor.Nombre != "" && oProveedor.Nombre != null) { sProveedor = "'" + oProveedor.Id + "'"; } DateTime fecFacIni = new DateTime(1900, 1, 1); DateTime fecFacFin = new DateTime(1900, 1, 1); DateTime fecIni = new DateTime(1900, 1, 1); DateTime fecFin = new DateTime(1900, 1, 1); NegocioPF.Facturas oFacturas = new NegocioPF.Facturas(); oFacturas.Cargar(sProveedor, "", "", "", fecFacIni, fecFacFin, fecIni, fecFin, 0, 0, "", txtOrden.Text, ""); string subtitulo = ((Idioma)Session["oIdioma"]).Texto("OrdenDeCompra") + ":" + txtOrden.Text; ReportParameter[] reportParameter = new ReportParameter[2]; reportParameter[0] = new ReportParameter("Titulo", ((Idioma)Session["oIdioma"]).Texto("FacXODC")); reportParameter[1] = new ReportParameter("Subtitulo", subtitulo); ReportViewer1.LocalReport.SetParameters(reportParameter); ReportViewer1.LocalReport.Refresh(); ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DsFactReg_DsFactReg", oFacturas.Datos.Tables[0])); ReportViewer1.Visible = true; ReportViewer1.LocalReport.Refresh(); divReporte.Visible = true; lblTitulo.Visible = false; divFiltros.Visible = false; } catch (Exception ex) { MessageBox(sender, e, ((Idioma)Session["oIdioma"]).Texto(ex.Message)); } }
protected void ShowReport() { DataTable dt = GetData(); ReportViewer1.Reset(); ReportViewer1.AsyncRendering = AsyncMode.Checked; ReportDataSource rds = new ReportDataSource("DataSet1", dt); ReportViewer1.LocalReport.DataSources.Add(rds); ReportViewer1.LocalReport.ReportPath = "Reports/Report1.rdlc"; ReportViewer1.LocalReport.DisplayName = "Report1"; ReportViewer1.LocalReport.Refresh(); ReportViewer1.ShowFindControls = false; ReportViewer1.ShowPrintButton = false; ReportViewer1.ShowFindControls = false; ReportViewer1.ShowZoomControl = false; ReportViewer1.ShowRefreshButton = false; ReportViewer1.ShowBackButton = false; ReportViewer1.Visible = Show1.Checked; ReportViewer2.Reset(); ReportViewer2.AsyncRendering = AsyncMode.Checked; ReportDataSource rds2 = new ReportDataSource("DataSet1", dt); ReportViewer2.LocalReport.DataSources.Add(rds2); ReportViewer2.LocalReport.ReportPath = "Reports/Report2.rdlc"; ReportViewer2.LocalReport.DisplayName = "Report2"; ReportViewer2.LocalReport.Refresh(); ReportViewer2.ShowFindControls = false; ReportViewer2.ShowPrintButton = false; ReportViewer2.ShowFindControls = false; ReportViewer2.ShowZoomControl = false; ReportViewer2.ShowRefreshButton = false; ReportViewer2.ShowBackButton = false; ReportViewer2.Visible = Show2.Checked; ReportViewer2.Visible = true; ReportViewer3.Reset(); ReportViewer3.AsyncRendering = AsyncMode.Checked; ReportDataSource rds3 = new ReportDataSource("DataSet1", dt); ReportViewer3.LocalReport.DataSources.Add(rds2); ReportViewer3.LocalReport.ReportPath = "Reports/Report3.rdlc"; ReportViewer3.LocalReport.DisplayName = "Report3"; ReportViewer3.LocalReport.Refresh(); ReportViewer3.ShowFindControls = false; ReportViewer3.ShowPrintButton = false; ReportViewer3.ShowFindControls = false; ReportViewer3.ShowZoomControl = false; ReportViewer3.ShowRefreshButton = false; ReportViewer3.ShowBackButton = false; ReportViewer3.Visible = Show3.Checked; }
protected void Page_Load(object sender, EventArgs e) { if (Session["User_ID"] != null && Session["Customer_ID"] != null) { if (!IsPostBack) { DataSet ds1 = new DataSet(); try { if (Request.QueryString["calibId"] != null) { string strcalibId = Request.QueryString["calibId"].ToString(); string[] str = strcalibId.Split(','); int calibId = Convert.ToInt32(str[0].ToString()); ds1 = g.ReturnData1("Select cs.calibration_schedule_id, cs.calibrate_id, sp.supplier_name as Calibrator, cs.last_calibrated_by, sp1.supplier_name as LasCalibratedBy , gt.cycles, cs.calibration_frequency, cs.calibration_hours, cs.frequency_type, DATE_FORMAT(cs.last_calibration_date,'%d/%m/%Y') as last_calibration_date, DATE_FORMAT(cs.next_due_date,'%d/%m/%Y') as next_due_date, DATE_FORMAT(cs.projected_calib_schedule,'%d/%m/%Y') as projected_calib_schedule, cs.customer_id, ct.customer_name, cs.created_by_id, em.employee_name, gt.gauge_name, cs.gauge_id from calibration_schedule_TB as cs Left Outer Join customer_TB as ct ON cs.customer_id=ct.customer_id Left Outer Join supplier_TB as sp ON cs.calibrate_id=sp.supplier_id Left Outer Join supplier_TB as sp1 ON cs.last_calibrated_by=sp1.supplier_id Left Outer Join gaugeMaster_TB as gt ON cs.gauge_id=gt.gauge_id Left Outer Join employee_TB as em ON cs.created_by_id=em.employee_id where cs.calibration_schedule_id='" + calibId + "'"); if (ds1.Tables[0].Rows.Count > 0) { ReportViewer1.Reset(); ReportViewer1.LocalReport.Refresh(); ReportViewer1.LocalReport.ReportPath = MapPath("~/CalibrationDueStatusReport.rdlc"); ReportDataSource rep = new ReportDataSource("DataSet1", ds1.Tables[0]); ReportViewer1.LocalReport.DataSources.Add(rep); } } else if (Session["PrintduestatusData"] != null) { DataTable dt2; dt2 = (DataTable)(Session["PrintduestatusData"]); if (dt2.Rows.Count > 0) { ReportViewer1.Reset(); ReportViewer1.LocalReport.Refresh(); ReportViewer1.LocalReport.ReportPath = MapPath("~/CalibrationDueStatusReport.rdlc"); ReportDataSource rep = new ReportDataSource("DataSet1", dt2); ReportViewer1.LocalReport.DataSources.Add(rep); } } DataTable dtcust = new DataTable(); dtcust = g.GetCustomerDetails(Convert.ToInt32(Session["Customer_ID"])); ReportDataSource repcust = new ReportDataSource("DataSetcust", dtcust); ReportViewer1.LocalReport.DataSources.Add(repcust); } catch (Exception ex) { g.ShowMessage(this.Page, ex.Message); } } } else { Response.Redirect("Login.aspx"); } }
protected void Ngay_Click(object sender, EventArgs e) { ReportViewer1.Reset(); DataTable dt = GetData2(); ReportDataSource ds = new ReportDataSource("DataSet4", dt); ReportViewer2.LocalReport.DataSources.Add(ds); ReportViewer2.LocalReport.ReportPath = Server.MapPath("ReportNgay.rdlc"); ReportViewer2.LocalReport.Refresh(); }
private void Mostrar() { ReportViewer1.Reset(); DataTable dsC = PreparaAcceso.BuscarTecnicoRut(Convert.ToInt32(Session["rut"]), cadenaConexion); ReportDataSource datasource = new ReportDataSource("DataSet1", dsC); ReportViewer1.LocalReport.DataSources.Add(datasource); ReportViewer1.LocalReport.ReportPath = Server.MapPath("Reportes/ReporteTecnicos.rdlc"); ReportViewer1.LocalReport.Refresh(); }
protected void btnThang_Click1(object sender, EventArgs e) { ReportViewer1.Reset(); DataTable dt = GetData1(); ReportDataSource ds = new ReportDataSource("DataSet1", dt); ReportViewer1.LocalReport.DataSources.Add(ds); ReportViewer1.LocalReport.ReportPath = Server.MapPath("Reporthongketuan.rdlc"); ReportViewer1.LocalReport.Refresh(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ReportViewer1.Reset(); DataTable dt = getData(); ReportDataSource ds = new ReportDataSource("DataSet1", dt); ReportViewer1.LocalReport.DataSources.Add(ds); ReportViewer1.LocalReport.ReportPath = "report/rptDues.rdlc"; } }
protected void getReport() { try { ReportViewer1.ShowExportControls = true; ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.Reset(); ReportViewer1.ShowPrintButton = true; SqlCommand cmd; DataTable dt; SqlConnection con; SqlDataAdapter adp; //lblError.Text = ""; //validate specimen id or not cmd = new SqlCommand(); con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["PPTConnection"].ConnectionString.ToString()); cmd.CommandType = CommandType.StoredProcedure; con.Open(); cmd.Connection = con; cmd.CommandText = "SP_SubProgReport"; cmd.Parameters.AddWithValue("@Action", "RPT"); if (drpInvID.SelectedValue != "0") { cmd.Parameters.AddWithValue("@INVID", drpInvID.SelectedValue); } if (drpSubject.SelectedValue != "0") { cmd.Parameters.AddWithValue("@SUBJID", drpSubject.SelectedValue); } cmd.Parameters.AddWithValue("@USERID", Session["User_ID"].ToString()); dt = new DataTable(); adp = new SqlDataAdapter(cmd); adp.Fill(dt); ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/rptSubProg.rdlc"); ReportDataSource datasource = new ReportDataSource("DataSet1", dt); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(datasource); } catch (Exception ex) { lblErrorMsg.Text = ""; lblErrorMsg.Text = ex.Message; } }