Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
 protected void SearchBT_Click(object sender, EventArgs e)
 {
     using (SqlConnection Conn = new SqlConnection(strConnectString))
     {
         if (Ds.Tables.Contains("AP1"))
         {
             Ds.Tables.Remove("AP1");
         }
         string sqlstr = selectsql(), strSearch;
         strSearch = ACCTB.Text.Trim() + "%";
         SqlDataAdapter myAdapter = new SqlDataAdapter(sqlstr, Conn);
         myAdapter.SelectCommand.Parameters.AddWithValue("Search", strSearch);
         //myAdapter.SelectCommand.Parameters.AddWithValue("Search1", strSearch);
         myAdapter.Fill(Ds, "AP1");    //---- 這時候執行SQL指令。取出資料,放進 DataSet。
     }
     if (Ds.Tables["AP1"].Rows.Count > 0)
     {
         ReportViewer1.Visible        = true;
         ReportViewer1.ProcessingMode = ProcessingMode.Local;
         ReportDataSource source = new ReportDataSource("Finance005", Ds.Tables["AP1"]);
         ReportViewer1.LocalReport.DataSources.Clear();
         ReportViewer1.LocalReport.DataSources.Add(source);
         ReportViewer1.DataBind();
         ReportViewer1.LocalReport.Refresh();
         //ACPGV.DataSource = Ds.Tables["ACP"];
         //ACPGV.DataBind();
     }
     else
     {
         Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('搜尋不到資料');</script>");
     }
 }
Exemplo n.º 4
0
        protected void btnReporte_Click(object sender, EventArgs e)
        {
            gridPanel.Visible = false;
            formPanel.Visible = false;
            List <Plan_Reporte> Datos = new List <Plan_Reporte>();

            for (int i = 0; i < gridPlanes.Rows.Count; i++)
            {
                Plan_Reporte linea = new Plan_Reporte();

                linea.ID           = gridPlanes.Rows[i].Cells[0].Text;
                linea.Descripcion  = gridPlanes.Rows[i].Cells[1].Text;
                linea.Especialidad = gridPlanes.Rows[i].Cells[2].Text;

                Datos.Add(linea);
            }

            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("DataSet1", Datos));
            ReportViewer1.LocalReport.Refresh();
            ReportViewer1.DataBind();
            reportPanel.Visible          = true;
            ReportViewer1.ShowReportBody = true;
            //btnVolver_Reporte.Visible = true;
        }
Exemplo n.º 5
0
        protected void DbInit()
        {
            DataTable dt = new DataTable();

            using (SqlConnection Conn = new SqlConnection(strConnectString))
            {
                SqlDataAdapter myAdapter = new SqlDataAdapter(selectsql().ToString(), Conn);
                myAdapter.Fill(dt);    //---- 這時候執行SQL指令。取出資料,放進 DataSet。
            }
            if (dt.Rows.Count > 0)
            {
                ReportViewer1.Visible        = true;
                ReportViewer1.ProcessingMode = ProcessingMode.Local;
                ReportDataSource source = new ReportDataSource("工時成本", dt);
                ReportViewer1.LocalReport.DataSources.Clear();
                ReportViewer1.LocalReport.DataSources.Add(source);
                ReportViewer1.DataBind();
                ReportViewer1.LocalReport.Refresh();
            }
            else
            {
                MessageLT.Text = @"                            
                            <div class='form-group'>
                                <h3 class='text-info text-center'>沒有資料 </ h3 >
                            </div>";
            }
        }
Exemplo n.º 6
0
 protected void SearchBT_Click(object sender, EventArgs e)
 {
     using (SqlConnection Conn = new SqlConnection(strConnectString))
     {
         if (Ds.Tables.Contains("QC"))
         {
             Ds.Tables.Remove("QC");
         }
         string         sqlstr    = selectsql();
         SqlDataAdapter myAdapter = new SqlDataAdapter(sqlstr, Conn);
         myAdapter.Fill(Ds, "QC");    //---- 這時候執行SQL指令。取出資料,放進 DataSet。
     }
     if (Ds.Tables["QC"].Rows.Count > 0)
     {
         ReportViewer1.Visible        = true;
         ReportViewer1.ProcessingMode = ProcessingMode.Local;
         ReportDataSource source = new ReportDataSource("VN002", Ds.Tables["QC"]);
         ReportViewer1.LocalReport.DataSources.Clear();
         ReportViewer1.LocalReport.DataSources.Add(source);
         ReportViewer1.DataBind();
         ReportViewer1.LocalReport.Refresh();
     }
     else
     {
         Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('搜尋不到資料');</script>");
     }
 }
Exemplo n.º 7
0
    public override void Abas_AntesDeTrocarAba(AbaBeforeChangedCancelEventArgs e)
    {
        base.Abas_AntesDeTrocarAba(e);

        if (e.IndiceDaAba == 3)
        {
            TelerikReport.Report1 dd = new TelerikReport.Report1();
            using (ContatoEstadoBLL bll = new ContatoEstadoBLL())
            {
                bll.Filters          = GetFilters();
                dd.DataSource        = bll.listaRelatorio();
                ReportViewer1.Report = dd;
                ReportViewer1.DataBind();
            }
        }

        if (e.IndiceDaAba == 4)
        {
            TelerikReport.Report3 dd = new TelerikReport.Report3();
            using (ContatoEstadoBLL bll = new ContatoEstadoBLL())
            {
                bll.Filters          = GetFilters();
                dd.DataSource        = bll.listaRelatorio();
                ReportViewer2.Report = dd;
                ReportViewer2.DataBind();
            }
        }
    }
Exemplo n.º 8
0
        protected void DbInit(int iid)
        {
            DataTable dt = new DataTable();

            using (SqlConnection Conn = new SqlConnection(strConnectString))
            {
                SqlDataAdapter myAdapter = new SqlDataAdapter(selectsql("明細", iid).ToString(), Conn);
                myAdapter.Fill(dt);    //---- 這時候執行SQL指令。取出資料,放進 DataSet。
            }
            if (dt.Rows.Count > 0)
            {
                ReportViewer1.Visible        = true;
                ReportViewer1.ProcessingMode = ProcessingMode.Local;
                ReportDataSource source = new ReportDataSource("MGT004", dt);
                ReportViewer1.LocalReport.DataSources.Clear();
                ReportViewer1.LocalReport.DataSources.Add(source);
                DataTable dt2 = new DataTable();
                using (SqlConnection Conn = new SqlConnection(strConnectString))
                {
                    SqlDataAdapter myAdapter = new SqlDataAdapter(selectsql("單頭", iid).ToString(), Conn);
                    myAdapter.Fill(dt2);    //---- 這時候執行SQL指令。取出資料,放進 DataSet。
                }
                ReportDataSource source2 = new ReportDataSource("MGT004_1", dt2);
                ReportViewer1.LocalReport.DataSources.Add(source2);
                ReportViewer1.DataBind();
                ReportViewer1.LocalReport.Refresh();
            }
            else
            {
                F_ErrorShow("搜尋不到資料");
            }
        }
Exemplo n.º 9
0
        protected void btnviewreport_Click(object sender, EventArgs e)
        {
            ReportViewer1.Visible = true;
            var res = validatedate();

            if (res == false)
            {
                errordiv.Visible      = true;
                ReportViewer1.Visible = false;
            }
            else
            {
                ReportViewer1.Visible = true;
                parm.Fromdate         = DateTime.ParseExact(txtFrom.Text.Trim(), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MMM-yyyy");
                parm.ToDate           = DateTime.ParseExact(txtTo.Text.Trim(), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MMM-yyyy");
                var DataSet1         = MapSvc.getNewHotelsAddedReport(parm);
                ReportDataSource rds = new ReportDataSource("DataSet1", DataSet1);
                ReportViewer1.LocalReport.DataSources.Clear();
                ReportViewer1.LocalReport.ReportPath = "staticdata/hotels/rptNewhotelsReport.rdlc";
                ReportViewer1.LocalReport.DataSources.Add(rds);
                ReportViewer1.Visible  = true;
                ReportViewer1.ZoomMode = Microsoft.Reporting.WebForms.ZoomMode.PageWidth;
                ReportViewer1.DataBind();
                ReportViewer1.LocalReport.Refresh();
            }
        }
Exemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int dispozicijaId = int.Parse(Request.QueryString["dispozicijaId"]);
                var Header        = DispozicijaRM.GetHeader(dispozicijaId);
                ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Header", Header));

                var Body = DispozicijaRM.GetBody(dispozicijaId);
                ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Body", Body));

                var Info = DispozicijaRM.GetDispozicijaInfo(dispozicijaId);
                ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Info", Info));

                var Primalac = DispozicijaRM.GetPrimalacInfo(dispozicijaId);
                ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Primalac", Primalac));

                var Posiljalac = DispozicijaRM.GetPosiljalacInfo(dispozicijaId);
                ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Posiljalac", Posiljalac));


                ReportViewer1.LocalReport.ReportPath = Server.MapPath("") + "/Dispozicija.rdlc";
                ReportViewer1.DataBind();
                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();
        }
Exemplo n.º 12
0
        public void LoadStudentChallan()
        {
            try
            {
                if (Request.QueryString["ChallanID"] != "" && Request.QueryString["ChallanID"] != null)
                {
                    List <GetChallan_Result>        lstChallan = db.GetChallan(Convert.ToInt32(Request.QueryString["ChallanID"])).ToList();
                    List <GetChallanService_Result> lstCS      = db.GetChallanService(Convert.ToInt32(Request.QueryString["ChallanID"])).ToList();
                    ReportViewer1.ProcessingMode         = ProcessingMode.Local;
                    ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Reporting/Reports/rptGetChallan.rdlc");
                    ReportDataSource datasource  = new ReportDataSource("DataSet1", lstChallan);
                    ReportDataSource datasource2 = new ReportDataSource("DataSet2", lstCS);
                    ReportViewer1.LocalReport.DataSources.Clear();
                    ReportViewer1.LocalReport.DataSources.Add(datasource);
                    ReportViewer1.LocalReport.DataSources.Add(datasource2);

                    ReportViewer1.LocalReport.EnableExternalImages = true;
                    string          imagePath = new Uri(Server.MapPath("~/assets/img/CampusConnectLogo.png")).AbsoluteUri;
                    ReportParameter parameter = new ReportParameter("ImagePath", imagePath);
                    ReportViewer1.LocalReport.SetParameters(parameter);
                    ReportViewer1.LocalReport.Refresh();
                    ReportViewer1.DataBind();
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.ToString());
            }
        }
Exemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["userInfo"] == null)
            {
                Response.Redirect("/Home/Login");
            }

            if (!IsPostBack)
            {
                int   idPokupi = Int32.Parse(Request.QueryString["id"]);
                mssql s        = new mssql();
                List <UlazSkidanje>           u   = s.UlazSkidanje.Where(x => x.Id == idPokupi).ToList();
                List <UlazSkidanjeProizvodVM> usp = s.UlazSkidanjeProizvod.Include("Proizvod").Include("Proizvod.Klasa").Where(x => x.UlazSkidanjeId == idPokupi).Select(x => new UlazSkidanjeProizvodVM()
                {
                    Datum             = x.Datum,
                    Id                = x.Id,
                    Kolicina          = x.Kolicina,
                    PlaniranaKolicina = x.PlaniranaKolicina,
                    Debljina          = x.Proizvod.Visina.ToString(),
                    Sirina            = x.Proizvod.Sirina.ToString(),
                    Duzina            = x.Proizvod.Duzina.ToString(),
                    Klasa             = x.Proizvod.Klasa.Naziv,
                    Naziv             = x.Proizvod.Naziv
                }).ToList();

                ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet", u));
                ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", usp));

                ReportViewer1.LocalReport.ReportPath = Server.MapPath("") + "/RadniNalog.rdlc";

                ReportViewer1.DataBind();
                ReportViewer1.LocalReport.Refresh();
            }
        }
Exemplo n.º 14
0
        public void GetFormSaleDetail()
        {
            try
            {
                if (Request.QueryString["ChallanID"] != "" && Request.QueryString["ChallanID"] != null)
                {
                    List <GetFormSaleDetail_Result> lstForms = db.GetFormSaleDetail("", "").Where(f => f.PurchaseDate != null).ToList();
                    ReportViewer1.ProcessingMode         = ProcessingMode.Local;
                    ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Reporting/Reports/rptAdmissionFormSale.rdlc");
                    ReportDataSource datasource = new ReportDataSource("DataSet1", lstForms);
                    ReportViewer1.LocalReport.DataSources.Clear();
                    ReportViewer1.LocalReport.DataSources.Add(datasource);

                    ReportViewer1.LocalReport.EnableExternalImages = true;
                    string          imagePath = new Uri(Server.MapPath("~/assets/img/CampusConnectLogo.png")).AbsoluteUri;
                    ReportParameter parameter = new ReportParameter("ImagePath", imagePath);
                    ReportViewer1.LocalReport.SetParameters(parameter);
                    ReportViewer1.LocalReport.Refresh();
                    ReportViewer1.DataBind();
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.ToString());
            }
        }
Exemplo n.º 15
0
        public void FillReport()
        {
            DashboardReports.EXJournalDocumentTotalsRpt rpt = new DashboardReports.EXJournalDocumentTotalsRpt();
            string selectedServer = "";

            if (this.ServerListBox.SelectedItems.Count > 0)
            {
                selectedServer = "";
                for (int i = 0; i < this.ServerListBox.SelectedItems.Count; i++)
                {
                    selectedServer += "'" + this.ServerListBox.SelectedItems[i].Text + "'" + ",";
                }
                try
                {
                    selectedServer = selectedServer.Substring(0, selectedServer.Length - 1);
                }
                catch
                {
                    selectedServer = "";
                }
                finally { }
            }
            rpt.Parameters["ServerName"].Value = selectedServer;
            rpt.Parameters["Threshold"].Value  = TCutoffTextBox.Text;
            ReportViewer1.Report = rpt;
            ReportViewer1.DataBind();
        }
        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();
            }
        }
Exemplo n.º 17
0
        protected void btnRuleCsv_Click(object sender, EventArgs e)
        {
            ReportViewer1.Visible = true;
            var res = validatedate();

            if (res == false)
            {
                errordiv.Visible      = true;
                ReportViewer1.Visible = false;
            }
            else
            {
                ReportViewer1.Visible = true;
                errordiv.Visible      = false;
                parm.Fromdate         = DateTime.ParseExact(txtFrom.Text.Trim(), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MMM-yyyy");
                parm.ToDate           = DateTime.ParseExact(txtTo.Text.Trim(), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MMM-yyyy");
                //parm.Fromdate = fromDate.Value.ToString();
                // parm.ToDate = toDate.Value.ToString();
                var DataSet1         = MapSvc.getStatisticforRuleReport(parm);
                ReportDataSource rds = new ReportDataSource("DataSet1", DataSet1);
                ReportViewer1.LocalReport.DataSources.Clear();
                ReportViewer1.LocalReport.ReportPath = "hotels/rptRuleReport.rdlc";
                ReportViewer1.LocalReport.DataSources.Add(rds);
                ReportViewer1.Visible = true;
                ReportViewer1.DataBind();
                ReportViewer1.LocalReport.Refresh();
            }
        }
Exemplo n.º 18
0
        protected void DbInit()
        {
            DataTable dt = new DataTable(), dt2 = new DataTable();

            using (SqlConnection Conn = new SqlConnection(strConnectString))
            {
                SqlDataAdapter myAdapter = new SqlDataAdapter(selectsql("打版完成日").ToString(), Conn);
                myAdapter.Fill(dt);    //---- 這時候執c行SQL指令。取出資料,放進 DataSet。
                //SqlDataAdapter myAdapter2 = new SqlDataAdapter(selectsql("收單日").ToString(), Conn);
                //myAdapter2.Fill(dt2);    //---- 這時候執行SQL指令。取出資料,放進 DataSet。
            }
            if (dt.Rows.Count > 0)
            {
                ReportViewer1.Visible        = true;
                ReportViewer1.ProcessingMode = ProcessingMode.Local;
                ReportDataSource source = new ReportDataSource("View1", dt);
                //ReportDataSource source1 = new ReportDataSource("View2", dt2);
                ReportViewer1.LocalReport.DataSources.Clear();
                ReportViewer1.LocalReport.DataSources.Add(source);
                //ReportViewer1.LocalReport.DataSources.Add(source1);
                ReportViewer1.DataBind();
                ReportViewer1.LocalReport.Refresh();
            }
            else
            {
                F_ErrorShow("搜尋不到資料");
            }
        }
Exemplo n.º 19
0
 protected void DbInit()
 {
     if (!String.IsNullOrEmpty(MonthDDL.SelectedValue) && String.IsNullOrEmpty(YearDDL.SelectedValue))
     {
         Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('未選擇年度');</script>");
     }
     else
     {
         DataTable dt = new DataTable();
         using (SqlConnection Conn = new SqlConnection(strConnectString))
         {
             SqlDataAdapter myAdapter = new SqlDataAdapter(selectsql().ToString(), Conn);
             myAdapter.Fill(dt);    //---- 這時候執行SQL指令。取出資料,放進 DataSet。
         }
         if (dt.Rows.Count > 0)
         {
             ReportViewer1.Visible        = true;
             ReportViewer1.ProcessingMode = ProcessingMode.Local;
             ReportDataSource source = new ReportDataSource("Sample004", dt);
             ReportViewer1.LocalReport.DataSources.Clear();
             ReportViewer1.LocalReport.DataSources.Add(source);
             ReportViewer1.DataBind();
             ReportViewer1.LocalReport.Refresh();
         }
         else
         {
             Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('搜尋不到資料');</script>");
         }
     }
 }
        protected void export()
        {
            DataTable      dt  = getDataTable();
            DataTable      dt1 = new DataTable();
            SqlDataAdapter sda = new SqlDataAdapter("select * from ClassTable where ClassID='" + Session["classId"].ToString() + "' ", con);

            sda.Fill(dt1);
            DataTable dt2 = new DataTable();

            sda = new SqlDataAdapter("select TName from Teacher where TId='" + TId + "' ", con);
            sda.Fill(dt2);
            DataTable dt3 = new DataTable();

            sda = new SqlDataAdapter("select * from Course where CourseId='" + Session["courseId"].ToString() + "' ", con);
            sda.Fill(dt3);

            DataTable dt4 = new DataTable();

            sda = new SqlDataAdapter("select * from Attendance where CourseId='" + Session["courseId"].ToString() + "' and TId='" + TId + "' and ClassId='" + Session["classId"].ToString() + "'  ", con);
            sda.Fill(dt4);

            ReportViewer1.ProcessingMode         = Microsoft.Reporting.WebForms.ProcessingMode.Local;
            ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Report1.rdlc");

            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + "/AttendanceSheet.rdlc";
            ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("StudentDS", dt));
            ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("AttDS", dt4));
            ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("CourseDS", dt3));
            ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ClassDS", dt1));
            ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("TeacherDS", dt2));

            ReportViewer1.DataBind();
            ReportViewer1.LocalReport.Refresh();
        }
Exemplo n.º 21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    string cargoCode     = Request.QueryString["cargoCode"].ToString().Trim();
                    string cargoName     = Request.QueryString["cargoName"].ToString().Trim();
                    string modelName     = Request.QueryString["modelName"].ToString().Trim();
                    string specName      = Request.QueryString["specName"].ToString().Trim();
                    string saleStatusStr = Request.QueryString["saleStatusStr"].ToString().Trim();
                    int    saleStatus    = -1;
                    if (!string.IsNullOrEmpty(saleStatusStr))
                    {
                        if (int.TryParse(saleStatusStr, out saleStatus) == false)
                        {
                            saleStatus = -1;
                        }
                    }

                    using (DAL.GoldEntities context = new DAL.GoldEntities())
                    {
                        List <DAL.proc_WebSelectEachDeptSaleAllocation_Result> resultList = context.proc_WebSelectEachDeptSaleAllocation().ToList <DAL.proc_WebSelectEachDeptSaleAllocation_Result>();


                        var queryResult = (from r in resultList
                                           where r.CargoCode.Contains(cargoCode) &&
                                           r.CargoName.Contains(cargoName) &&
                                           r.CargoModel.Contains(modelName) &&
                                           r.CargoSpec.Contains(specName) &&
                                           (saleStatus >= 0 ? r.SaleStatus == saleStatus : 1 == 1)
                                           select r).ToList();

                        Microsoft.Reporting.WebForms.ReportDataSource rds = new Microsoft.Reporting.WebForms.ReportDataSource("DataSet1", queryResult);
                        ReportViewer1.LocalReport.DataSources.Clear();
                        ReportViewer1.LocalReport.DataSources.Add(rds);

                        Microsoft.Reporting.WebForms.ReportParameter ReportParameter_CargoCode  = new Microsoft.Reporting.WebForms.ReportParameter("ReportParameter_CargoCode", cargoCode);
                        Microsoft.Reporting.WebForms.ReportParameter ReportParameter_CargoName  = new Microsoft.Reporting.WebForms.ReportParameter("ReportParameter_CargoName", cargoName);
                        Microsoft.Reporting.WebForms.ReportParameter ReportParameter_CargoModel = new Microsoft.Reporting.WebForms.ReportParameter("ReportParameter_CargoModel", modelName);
                        Microsoft.Reporting.WebForms.ReportParameter ReportParameter_CargoSpec  = new Microsoft.Reporting.WebForms.ReportParameter("ReportParameter_CargoSpec", specName);
                        Microsoft.Reporting.WebForms.ReportParameter ReportParameter_SaleStatus = new Microsoft.Reporting.WebForms.ReportParameter("ReportParameter_SaleStatus", saleStatus >= 0 ? (saleStatus > 0?"可售":"不可售"): "");

                        Microsoft.Reporting.WebForms.ReportParameterCollection rpList = new Microsoft.Reporting.WebForms.ReportParameterCollection();
                        rpList.Add(ReportParameter_CargoCode);
                        rpList.Add(ReportParameter_CargoName);
                        rpList.Add(ReportParameter_CargoModel);
                        rpList.Add(ReportParameter_CargoSpec);
                        rpList.Add(ReportParameter_SaleStatus);

                        ReportViewer1.LocalReport.SetParameters(rpList);
                        ReportViewer1.DataBind();
                    }
                }
            }
            catch (Exception ex)
            {
                lblGridViewMsg.Text = Utility.LogHelper.GetExceptionMsg(ex);
            }
        }
Exemplo n.º 22
0
        public void FillReport()
        {
            DashboardReports.TravelerHTTPsessionsRpt rpt = new DashboardReports.TravelerHTTPsessionsRpt();
            string selectedServer = "";

            if (this.ServerListBox.SelectedItems.Count > 0)
            {
                selectedServer = "";
                for (int i = 0; i < this.ServerListBox.SelectedItems.Count; i++)
                {
                    selectedServer += "'" + this.ServerListBox.SelectedItems[i].Text + "'" + ",";
                }
                try
                {
                    selectedServer = selectedServer.Substring(0, selectedServer.Length - 1);
                }
                catch
                {
                    selectedServer = "";
                }
                finally { }
            }
            rpt.Parameters["ServerName"].Value = selectedServer;

            rpt.Parameters["StartDate"].Value = dtPick.FromDate;
            rpt.Parameters["EndDate"].Value   = dtPick.ToDate;

            rpt.Parameters["Threshold"].Value  = TCutoffTextBox.Text;
            rpt.Parameters["ServerType"].Value = srvtype;
            ReportViewer1.Report = rpt;
            ReportViewer1.DataBind();
        }
Exemplo n.º 23
0
        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();
        }
Exemplo n.º 24
0
        private void reporte()
        {
            if (!IsPostBack)
            {
                DateTime    fecha       = DateTime.Now;
                LocalReport localReport = ReportViewer1.LocalReport;

                localReport.ReportPath = "ReportePlan.rdlc";



                ReportParameter[] parametros = new ReportParameter[1];
                parametros[0] = new ReportParameter("Fecha", (fecha).ToString());
                ReportViewer1.LocalReport.SetParameters(parametros);
                ReportViewer1.DataBind();
                PlanAdapter pa = new PlanAdapter();


                this.ReportViewer1.LocalReport.DataSources.Clear();
                DataTable dt = new DataTable();
                dt = pa.ReportePlan();

                ReportDataSource rprtDTSource = new ReportDataSource("Dataset2", dt);

                this.ReportViewer1.LocalReport.DataSources.Add(rprtDTSource);

                this.ReportViewer1.LocalReport.Refresh();
            }
        }
Exemplo n.º 25
0
    private void Generate(string date, string CompanyCode)
    {
        ReportViewer1.Visible = true;
        try
        {
            DataTable temp = new DataTable();
            DataTable dt   = new DataTable();
            temp = GetData(date, CompanyCode);
            if (temp.Rows.Count > 0)
            {
                ReportDataSource rptDataSource = new ReportDataSource
                                                     ("MCB_DataSet_NRStatAccount", temp);
                ReportViewer1.LocalReport.DataSources.Clear();
                List <ReportParameter> rpParameter = new List <ReportParameter>();
                rpParameter.Add(new ReportParameter("BankName", GetBankName()));
                rpParameter.Add(new ReportParameter("ReportName", GetReportName()));
                rpParameter.Add(new ReportParameter("Date", date));

                ReportViewer1.LocalReport.DataSources.Add(rptDataSource);
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("NRStatementAccountReport.rdlc");
                ReportViewer1.DataBind();
                ReportViewer1.LocalReport.SetParameters(rpParameter);
                ReportViewer1.LocalReport.Refresh();
            }
            else
            {
                Response.Redirect("NRStatementAccountReport.aspx?IsRecord=" + "0" + "&msg=" + "No Record Found");
            }
        }
        catch (Exception ex)
        {
            Response.Write("Exception is:" + ex);
        }
    }
Exemplo n.º 26
0
        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();
        }
Exemplo n.º 27
0
        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;
        }
Exemplo n.º 28
0
        protected void btnReporte_Click(object sender, EventArgs e)
        {
            gridPanel.Visible = false;

            List<BusinessEntities.Curso_Reporte> Datos = new List<BusinessEntities.Curso_Reporte>();
            for (int i = 0; i < gridCursos.Rows.Count; i++)
            {
                BusinessEntities.Curso_Reporte linea = new BusinessEntities.Curso_Reporte();

                linea.ID = gridCursos.Rows[i].Cells[0].Text;
                linea.Materia = gridCursos.Rows[i].Cells[1].Text;
                linea.Comision = gridCursos.Rows[i].Cells[2].Text;
                linea.Año = gridCursos.Rows[i].Cells[3].Text;
                linea.Cupo = gridCursos.Rows[i].Cells[4].Text;
                linea.Profesor = gridCursos.Rows[i].Cells[5].Text;

                Datos.Add(linea);
            }

            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("DataSet1", Datos));
            ReportViewer1.LocalReport.Refresh();
            ReportViewer1.DataBind();
            ReportViewer1.Visible = true;
            ReportViewer1.ShowReportBody = true;
            btnVolver_Reporte.Visible = true;
        }
        protected void BindSSRS()
        {
            try
            {
                ReportViewer1.ShowParameterPrompts = false;
                ReportViewer1.ShowToolBar          = false;
                ReportViewer1.WaitMessageFont.Bold = true;

                ReportViewer1.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportServerURL"].ToString());
                ReportViewer1.ServerReport.ReportPath      = "/EPGM_Beneficiarly_Details";

                ReportViewer1.ProcessingMode = ProcessingMode.Remote;
                IReportServerCredentials irsc = new CustomReportCredentials(ConfigurationManager.AppSettings["RSDomainUserName"].ToString(), ConfigurationManager.AppSettings["RSDomainPassword"].ToString(), ConfigurationManager.AppSettings["RSDomainName"].ToString());
                ReportViewer1.ServerReport.ReportServerCredentials = irsc;

                ReportViewer1.SizeToReportContent = true;
                ReportViewer1.Width  = Unit.Percentage(100);
                ReportViewer1.Height = Unit.Percentage(100);

                List <ReportParameter>        parmList = new List <ReportParameter>();
                ReportParameterInfoCollection parameters;
                parameters = ReportViewer1.ServerReport.GetParameters();
                for (int i = 0; i < parameters.Count; i++)
                {
                    if (parameters[i].Name.ToLower() == "statecode")
                    {
                        parmList.Add(new ReportParameter(parameters[i].Name.ToString(), "52", false));
                    }
                    if (parameters[i].Name.ToLower() == "distcode")
                    {
                        parmList.Add(new ReportParameter(parameters[i].Name.ToString(), "12", false));
                    }
                    if (parameters[i].Name.ToLower() == "projectcode")
                    {
                        parmList.Add(new ReportParameter(parameters[i].Name.ToString(), " ", false));
                    }
                    if (parameters[i].Name.ToLower() == "sectorcode")
                    {
                        parmList.Add(new ReportParameter(parameters[i].Name.ToString(), " ", false));
                    }
                    if (parameters[i].Name.ToLower() == "centercode")
                    {
                        parmList.Add(new ReportParameter(parameters[i].Name.ToString(), " ", false));
                    }
                    if (parameters[i].Name.ToLower() == "whotype")
                    {
                        parmList.Add(new ReportParameter(parameters[i].Name.ToString(), "All", false));
                    }
                }

                ReportViewer1.ServerReport.SetParameters(parmList);
                ReportViewer1.DataBind(); //ReportViewer1.ServerReport.Refresh();
            }
            catch (Exception ex)
            {
                lblerror.Text      = ex.Message;
                lblerror.ForeColor = Color.DarkRed;
            }
        }
Exemplo n.º 30
0
        protected void SearchBT_Click(object sender, EventArgs e)
        {
            decimal d1 = 0, d2 = 0;

            if (!string.IsNullOrEmpty(StyleTB.Text.Trim()))
            {
                入庫應付LB.BackColor = System.Drawing.Color.White;
                入庫應付LB.ForeColor = System.Drawing.Color.Black;
                入庫暫估LB.BackColor = System.Drawing.Color.White;
                入庫暫估LB.ForeColor = System.Drawing.Color.Black;

                DataTable dt = new DataTable();

                using (SqlConnection Conn = new SqlConnection(strConnectString))
                {
                    SqlDataAdapter myAdapter = new SqlDataAdapter(DB1(), Conn);
                    myAdapter.Fill(dt);    //---- 這時候執行SQL指令。取出資料,放進 DataSet。
                }
                if (dt.Rows.Count > 0)
                {
                    d1 = Convert.ToDecimal(dt.Compute("Sum(數量)", "true"));
                }

                DataTable dt2 = new DataTable();
                using (SqlConnection Conn = new SqlConnection(strConnectString))
                {
                    SqlDataAdapter myAdapter = new SqlDataAdapter(DB2(), Conn);
                    myAdapter.Fill(dt2);    //---- 這時候執行SQL指令。取出資料,放進 DataSet。
                }
                if (dt2.Rows.Count > 0)
                {
                    d2 = Convert.ToDecimal(dt2.Compute("Sum(數量)", "true"));
                }
                入庫應付LB.Text = d1.ToString();
                入庫暫估LB.Text = d2.ToString();
                if (d1 > d2)
                {
                    入庫應付LB.BackColor = System.Drawing.Color.Red;
                    入庫應付LB.ForeColor = System.Drawing.Color.Yellow;
                }
                else if (d1 < d2)
                {
                    入庫暫估LB.BackColor = System.Drawing.Color.Red;
                    入庫暫估LB.ForeColor = System.Drawing.Color.Yellow;
                }
                if (dt.Rows.Count > 0)
                {
                    ReportViewer1.Visible        = true;
                    ReportViewer1.ProcessingMode = ProcessingMode.Local;
                    ReportDataSource source  = new ReportDataSource("DataSet1", dt);
                    ReportDataSource source2 = new ReportDataSource("DataSet2", dt2);
                    ReportViewer1.LocalReport.DataSources.Clear();
                    ReportViewer1.LocalReport.DataSources.Add(source);
                    ReportViewer1.LocalReport.DataSources.Add(source2);
                    ReportViewer1.DataBind();
                    ReportViewer1.LocalReport.Refresh();
                }
            }
        }