示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (User.Identity.IsAuthenticated)
        {
            SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["connection"]);
            SqlCommand    cmd = new SqlCommand("select * from user_details where Name='" + User.Identity.Name + "'", con);
            SqlDataReader dr;
            con.Open();
            dr = cmd.ExecuteReader();
            if (dr.Read())
            {
                company_id = Convert.ToInt32(dr["com_id"].ToString());
            }
            con.Close();
        }

        TextBox1.Text = Session["Name"].ToString();
        TextBox2.Text = company_id.ToString();
        ReportDocument rprt = new ReportDocument();

        rprt.Load(Server.MapPath("CrystalReport2.rpt"));

        DataSet3TableAdapters.DataTable1TableAdapter TA = new DataSet3TableAdapters.DataTable1TableAdapter();
        DataSet3.DataTable1DataTable TABLE = TA.GetData(TextBox1.Text, Convert.ToInt32(TextBox2.Text), Convert.ToInt32(TextBox2.Text));

        rprt.SetDataSource(TABLE.DefaultView);



        CrystalReportViewer1.ReportSource = rprt;
        CrystalReportViewer1.DataBind();
    }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string path = "";

        path = Server.MapPath("~/Report/SEATALLOCATIONREPORTCOEC.rpt");
        rptStudent.Load(path);
        rptStudent.SetParameterValue("@termid", Request.QueryString["A"].ToString());
        rptStudent.SetDatabaseLogon("software", "DelFirMENA$idea");
        CrystalReportViewer1.ReportSource = rptStudent;
        CrystalReportViewer1.DataBind();
        CrystalReportViewer1.HasCrystalLogo           = false;
        CrystalReportViewer1.HasDrilldownTabs         = false;
        CrystalReportViewer1.HasDrillUpButton         = false;
        CrystalReportViewer1.HasExportButton          = true;
        CrystalReportViewer1.HasGotoPageButton        = true;
        CrystalReportViewer1.HasPageNavigationButtons = true;
        CrystalReportViewer1.HasPrintButton           = true;

        CrystalReportViewer1.HasSearchButton          = false;
        CrystalReportViewer1.HasToggleGroupTreeButton = false;

        CrystalReportViewer1.DisplayToolbar = true;

        CrystalReportViewer1.BackColor = System.Drawing.Color.White;
    }
        private void GenerateReport()
        {
            DataSet _ds = new DataSet();

            //_ds.WriteXmlSchema(Server.MapPath("") + "\\bsummary.xml");


            _ds = GetRptData();


            if (lblsch.Text == "10" || lblsch.Text == "20")
            {
                cryRpt.Load(Server.MapPath("pcd_comparison1.rpt"));
            }
            else
            {
                cryRpt.Load(Server.MapPath("pcd_comparison.rpt"));
            }


            cryRpt.Database.Tables[0].SetDataSource(_ds.Tables[0]);
            cryRpt.Database.Tables[1].SetDataSource(_ds.Tables[1]);
            cryRpt.SetParameterValue("id", lblsch.Text);


            CrystalReportViewer1.ReportSource = cryRpt;
            CrystalReportViewer1.DataBind();
            Session["Report"] = cryRpt;
            ////cryRpt.Dispose();
        }
    public void loadcry(string DCNO, string VID)
    {
        TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
        TableLogOnInfo  crtableLogoninfo  = new TableLogOnInfo();
        ConnectionInfo  crConnectionInfo  = new ConnectionInfo();
        Tables          CrTables;
        string          q2 = "SELECT * FROM Quotation WHERE QUTNO=" + DCNO + "  AND VID=" + VID + "";

        Ds  = SqlObj.GetData_DS(q2);
        rep = new ReportDocument();
        rep.Load(Server.MapPath("~/CryQuotation.rpt"));
        rep.SetDataSource(Ds.Tables[0]);
        CrTables = rep.Database.Tables;

        foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
        {
            crtableLogoninfo = CrTable.LogOnInfo;

            crtableLogoninfo.ConnectionInfo = crConnectionInfo;

            CrTable.ApplyLogOnInfo(crtableLogoninfo);
        }
        rep.Refresh();

        CrystalReportViewer1.ReportSource = rep;
        Session["Report"] = rep;

        CrystalReportViewer1.DataBind();
        CrystalReportViewer1.RefreshReport();
    }
示例#5
0
        private void Generate_Reports()
        {
            BLL_Dml   _objbll = new BLL_Dml();
            _database _objdb  = new _database();

            _objdb.DBName = "DBCML";
            _clsproject _objcls1 = new _clsproject();

            _objcls1.prjcode = "CCAD";
            _objbll.Update_RPTLogo(_objcls1, _objdb);

            TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
            TableLogOnInfo  crtableLogoninfo  = new TableLogOnInfo();
            ConnectionInfo  crConnectionInfo  = new ConnectionInfo();
            Tables          CrTables;

            cryRpt.Load(Server.MapPath("sys_list.rpt"));
            crConnectionInfo.ServerName   = "37.61.235.103";
            crConnectionInfo.DatabaseName = "DBCML";
            crConnectionInfo.UserID       = "sa";
            crConnectionInfo.Password     = "******";
            CrTables = cryRpt.Database.Tables;
            foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
            {
                crtableLogoninfo = CrTable.LogOnInfo;
                crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                CrTable.ApplyLogOnInfo(crtableLogoninfo);
            }
            CrystalReportViewer1.ReportSource = cryRpt;
            CrystalReportViewer1.DataBind();
            Session["Report"] = cryRpt;
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            ReportDocument reportDocument = new ReportDocument();
            reportDocument = (ReportDocument)Session[SessionKeys.s_reportDocument];
            //reportDocument.DataDefinition.FormulaFields.Reset();
            CrystalReportViewer1.DisplayGroupTree = false;

            if (Session[SessionKeys.s_sqlQuery].ToString() != string.Empty)
            {
                SqlDataAdapter da_sqlDataAdpapter  = new SqlDataAdapter(Session[SessionKeys.s_sqlQuery].ToString(), new SqlConnection(new Connection().connection_String(ConfigurationManager.ConnectionStrings[GlobalVariables.g_s_ConnectionStringName].ConnectionString)));
                DataSet        ds_datasetForReport = new DataSet();
                da_sqlDataAdpapter.Fill(ds_datasetForReport, "datasetForReport");

                DataTable dt_dataTableForReport = new DataTable();
                dt_dataTableForReport = ds_datasetForReport.Tables["datasetForReport"];
                Session[SessionKeys.dt_dataTableForReport] = dt_dataTableForReport;
                if (dt_dataTableForReport != null)
                {
                    reportDocument.SetDataSource((DataTable)Session[SessionKeys.dt_dataTableForReport]);
                    CrystalReportViewer1.ReportSource = reportDocument;
                    CrystalReportViewer1.DataBind();
                }
            }
        }
        catch (Exception exception)
        {
            lbl_message.Text = exception.Message;
        }
        finally
        {
            Session.Remove(SessionKeys.dt_dataTableForReport);
        }
    }
示例#7
0
 protected void processbtn_Click(object sender, EventArgs e)
 {
     CrystalReportSource1.ReportDocument.SetParameterValue("categoryparam", CATDropDownList.Text);
     CrystalReportSource1.ReportDocument.SetParameterValue("fromdate", fromdate.SelectedValue);
     CrystalReportSource1.ReportDocument.SetParameterValue("todate", todate.SelectedValue);
     CrystalReportViewer1.DataBind();
 }
示例#8
0
        private void Generate_Reports()
        {
            TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
            TableLogOnInfo  crtableLogoninfo  = new TableLogOnInfo();
            ConnectionInfo  crConnectionInfo  = new ConnectionInfo();
            Tables          CrTables;

            cryRpt.Load(Server.MapPath("dbms_summary.rpt"));
            crConnectionInfo.ServerName   = "37.61.235.103";
            crConnectionInfo.DatabaseName = "DBCML";
            crConnectionInfo.UserID       = "sa";
            crConnectionInfo.Password     = "******";
            CrTables = cryRpt.Database.Tables;
            foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
            {
                crtableLogoninfo = CrTable.LogOnInfo;
                crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                CrTable.ApplyLogOnInfo(crtableLogoninfo);
            }
            //string _parm = Request.QueryString[0].ToString();
            string _parm = "ms_" + GetDocNo_All();

            string _nos  = _parm.Substring(3);
            string _type = _parm.Substring(0, 2);

            cryRpt.SetParameterValue("srv", (string)Session["srv"]);
            cryRpt.SetParameterValue("project", (string)Session["projectname"]);
            cryRpt.SetParameterValue("total", _nos);
            cryRpt.SetParameterValue("type", _type);
            CrystalReportViewer1.ReportSource = cryRpt;
            CrystalReportViewer1.DataBind();
            Session["Report"] = cryRpt;
        }
示例#9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         try
         {
             DropDownList1.DataSource     = objNinio.consultarNinio2();
             DropDownList1.DataTextField  = "Nombre";
             DropDownList1.DataValueField = "IdPersona";
             DropDownList1.DataBind();
         }
         catch
         {
         }
     }
     else
     {
         ReportDocument crystalrpt = new ReportDocument();
         path = Server.MapPath("");
         crystalrpt.Load(path + "\\CrystalReport1.rpt");
         //crystalrpt.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, "");
         crystalrpt.Refresh();
         crystalrpt.SetParameterValue("@IdPersona", DropDownList1.SelectedValue);
         CrystalReportViewer1.ReportSource = crystalrpt;
         CrystalReportViewer1.DataBind();
     }
 }
示例#10
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string        sqlCon = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\userside.mdf;Integrated Security=True;User Instance=True";
        SqlConnection con    = new SqlConnection(sqlCon);

        String str;

        str = "select * from Seat_Master where status ='" + DropDownList1.SelectedItem.Text + "'";



        SqlDataAdapter da = new SqlDataAdapter(str, con);


        DataSet ds;

        ds = new DataSet();

        da.Fill(ds);


        ReportDocument report = new ReportDocument();


        string reportPath = Server.MapPath("bookedticket.rpt");

        report.Load(reportPath);

        report.SetDataSource(ds.Tables[0]);

        CrystalReportViewer1.ReportSource = report;
        CrystalReportViewer1.DataBind();
        CrystalReportViewer1.RefreshReport();
    }
示例#11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // 報表文件類別
            ReportDocument reportdoc = new ReportDocument();

            // 讀取報表檔(建置動作改為:內容)
            reportdoc.Load(Server.MapPath("~/Report/Push.rpt"));

            // 取得資料
            ProductRepository db = new ProductRepository();
            ProductDataSet    ds = db.ExcuteDataSet();

            // 設定資料來源
            reportdoc.SetDataSource(ds);

            // 設定報表來源
            CrystalReportViewer1.ReportSource = reportdoc;

            // 建置報表
            CrystalReportViewer1.DataBind();

            // 文字物件
            TextObject txt1 = (TextObject)reportdoc.ReportDefinition.ReportObjects["MyName"];

            // 設定文字內容
            txt1.Text = "Kerry";
            // 設定文字顏色
            txt1.Color = System.Drawing.Color.Blue;
        }
    protected void Button1_Click(object sender, EventArgs e)
    {
        //Connection string replace 'databaseservername' with your db server name
        string        sqlCon = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\userside.mdf;Integrated Security=True;User Instance=True";
        SqlConnection con    = new SqlConnection(sqlCon);

        String str;

        str = "select * from Booking_master where bookingdate >='" + TextBox1.Text + "' and bookingdate <='" + TextBox2.Text + "'";



        SqlDataAdapter da = new SqlDataAdapter(str, con);


        DataSet ds;

        ds = new DataSet();

        da.Fill(ds);


        ReportDocument report = new ReportDocument();


        string reportPath = Server.MapPath("datewise.rpt");

        report.Load(reportPath);

        report.SetDataSource(ds.Tables[0]);
        CrystalReportViewer1.ReportSource = report;
        CrystalReportViewer1.DataBind();
        CrystalReportViewer1.RefreshReport();
    }
        private void Generate_Reports(string _sch)
        {
            TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
            TableLogOnInfo  crtableLogoninfo  = new TableLogOnInfo();
            ConnectionInfo  crConnectionInfo  = new ConnectionInfo();
            Tables          CrTables;

            cryRpt.Load(Server.MapPath("PackageSummary.rpt"));
            //crConnectionInfo.ServerName = "213.171.197.149,49296";
            //crConnectionInfo.DatabaseName = "DBCML";
            //crConnectionInfo.UserID = "CMLT";
            //crConnectionInfo.Password = "******";
            crConnectionInfo.ServerName   = Constants.CMLTConstants.serverName;
            crConnectionInfo.DatabaseName = Constants.CMLTConstants.dbName;
            crConnectionInfo.UserID       = Constants.CMLTConstants.dbUserName;
            crConnectionInfo.Password     = Constants.CMLTConstants.dbPassword;
            CrTables = cryRpt.Database.Tables;
            foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
            {
                crtableLogoninfo = CrTable.LogOnInfo;
                crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                CrTable.ApplyLogOnInfo(crtableLogoninfo);
            }
            cryRpt.SetParameterValue("srv", _sch);
            cryRpt.SetParameterValue("prj", lblprj.Text);
            CrystalReportViewer1.ReportSource = cryRpt;
            CrystalReportViewer1.DataBind();
            Session["Report"] = cryRpt;
        }
    protected void Button1_Click(object sender, EventArgs e)
    {
        //Connection string replace 'databaseservername' with your db server name
        string        sqlCon = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\userside.mdf;Integrated Security=True;User Instance=True";
        SqlConnection con    = new SqlConnection(sqlCon);

        String str;

        str = "select * from Booking_Master where screenname ='" + DropDownList1.SelectedItem.Value + "'";
        // str = "select * from employee where  JoiningDate>='3/24/2012' and JoiningDate<='3/26/2012' ";


        SqlDataAdapter da = new SqlDataAdapter(str, con);


        DataSet ds;

        ds = new DataSet();

        da.Fill(ds);


        ReportDocument report = new ReportDocument();


        string reportPath = Server.MapPath("screenwise.rpt");

        report.Load(reportPath);

        report.SetDataSource(ds.Tables[0]);
        CrystalReportViewer1.ReportSource = report;
        CrystalReportViewer1.DataBind();
        CrystalReportViewer1.RefreshReport();
    }
示例#15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        path = Server.MapPath("~/Report/cpdreport.rpt");
        rptStudent.Load(path);
        rptStudent.SetParameterValue("@MasterId", Request.QueryString["A"].ToString());
        rptStudent.SetDatabaseLogon("software", "DelFirMENA$idea");
        CrystalReportViewer1.ReportSource = rptStudent;
        CrystalReportViewer1.DataBind();
        CrystalReportViewer1.BackColor = System.Drawing.Color.White;
        //to pdf conversion starts from here
        //ExportOptions ex = rptStudent.ExportOptions;
        //ex.ExportFormatType = ExportFormatType.PortableDocFormat;
        //ExportRequestContext x = new ExportRequestContext();
        //x.ExportInfo = ex;
        //stream1 = (System.IO.MemoryStream)rptStudent.FormatEngine.ExportToStream(x);
        //Response.Clear();
        //Response.ContentType = "application/pdf";
        //Response.BinaryWrite(stream1.ToArray());
        //Response.End();
        //stream1.Close();

        System.IO.Stream oStream   = null;
        byte[]           byteArray = null;
        oStream   = rptStudent.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
        byteArray = new byte[oStream.Length];
        oStream.Read(byteArray, 0, Convert.ToInt32(oStream.Length - 1));
        Response.ClearContent();
        Response.ClearHeaders();
        Response.ContentType = "application/pdf";
        Response.BinaryWrite(byteArray);
        Response.Flush();
        Response.Close();
        rptStudent.Close();
        rptStudent.Dispose();
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         try
         {
             DropDownList1.DataSource     = objProceso.D_consultarProceso();
             DropDownList1.DataTextField  = "Nombre";
             DropDownList1.DataValueField = "IdProceso";
             DropDownList1.DataBind();
         }
         catch
         {
         }
     }
     else
     {
         ReportDocument crystalrpt = new ReportDocument();
         path = Server.MapPath("");
         crystalrpt.Load(Server.MapPath(@"~/Reportes/ReportePreguntasCerradas.rpt"));
         crystalrpt.Refresh();
         crystalrpt.SetParameterValue("@IdProceso", DropDownList1.SelectedValue);
         //crystalrpt.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, "");
         CrystalReportViewer1.ReportSource = crystalrpt;
         CrystalReportViewer1.DataBind();
     }
 }
        private void Page_Init(object sender, EventArgs e)
        {
            _ReadCookies();
            if (!IsPostBack)
            {
                lblprj.Text   = (string)Session["project"];
                lblindex.Text = Request.QueryString["idx"].ToString();

                string _parm = Request.QueryString[0].ToString();
                lbltotal.Text = _parm.Substring(3);
                lbltype.Text  = _parm.Substring(0, 2);


                Generate_Reports();



                if (lblprj.Text == "HMIM" || lblprj.Text == "ABS")
                {
                    lbltdservice.Visible = true;
                    ddtdservice.Visible  = true;
                    btntdview.Visible    = true;

                    Load_Service(lblprj.Text);
                }
            }
            else
            {
                if (Session["Report"] != null)
                {
                    CrystalReportViewer1.ReportSource = (ReportDocument)Session["Report"];
                    CrystalReportViewer1.DataBind();
                }
            }
        }
示例#18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // 資料庫類別
            ProductRepository db = new ProductRepository();
            //List<ProductModel> items =  db.GetAll();

            // 取得資料
            ProductDataSet ds = db.ExcuteDataSet();

            // 報表文件類別
            ReportDocument reportdoc = new ReportDocument();

            // 讀取報表檔
            reportdoc.FileName = Server.MapPath("~/View/Push.rpt");

            // 設定資料來源1
            reportdoc.SetDataSource(ds);

            // 設定資料來源2
            CrystalReportViewer1.ReportSource = reportdoc;

            // 建置報表
            CrystalReportViewer1.DataBind();

            // 設定文字物件
            TextObject txt = (TextObject)reportdoc.ReportDefinition.ReportObjects["MyName"];

            txt.Text  = "Kerry";
            txt.Color = System.Drawing.Color.Red;
        }
示例#19
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            SqlConnection  con  = new SqlConnection("Data Source=.;Initial Catalog=EvidenceDB;Integrated Security=True");
            ReportDocument rprt = new ReportDocument();

            con.Open();



            rprt.Load(Server.MapPath("~/CrystalReport1.rpt"));

            SqlCommand cmd = new SqlCommand("select * from Trainee where Gender=@gender", con);

            cmd.Parameters.AddWithValue("@gender", ddlGender.SelectedValue);
            SqlDataAdapter sda = new SqlDataAdapter(cmd);

            DataSet1 ds = new DataSet1();

            sda.Fill(ds, "tblStudent");

            rprt.SetDataSource(ds.Tables["tblStudent"]);

            CrystalReportViewer1.ReportSource = rprt;
            CrystalReportViewer1.DataBind();
            con.Close();
        }
示例#20
0
    protected void btn_print_Click(object sender, EventArgs e)
    {
        string path     = "";
        string courseid = txt_sched.Text;
        string facname  = txt_fac.Text;

        path = Server.MapPath("~/Report/Coursefileplanner.rpt");
        myReportDocument.Load(path);
        myReportDocument.SetParameterValue("@courseschedule", courseid);
        myReportDocument.SetParameterValue("@facnme", facname);
        myReportDocument.SetDatabaseLogon("software", "DelFirMENA$idea");
        CrystalReportViewer1.ReportSource = myReportDocument;
        CrystalReportViewer1.DataBind();
        CrystalReportViewer1.HasCrystalLogo           = false;
        CrystalReportViewer1.HasDrilldownTabs         = false;
        CrystalReportViewer1.HasDrillUpButton         = false;
        CrystalReportViewer1.HasExportButton          = true;
        CrystalReportViewer1.HasGotoPageButton        = true;
        CrystalReportViewer1.HasPageNavigationButtons = true;
        CrystalReportViewer1.HasPrintButton           = true;
        CrystalReportViewer1.HasSearchButton          = false;
        CrystalReportViewer1.HasToggleGroupTreeButton = false;
        CrystalReportViewer1.DisplayToolbar           = true;
        CrystalReportViewer1.BackColor = System.Drawing.Color.White;
    }
示例#21
0
        public void generarReporte(string tipo)
        {
            switch (tipo)
            {
            case "1":
                DataTable        proyectos = prco.EstadoProyectos(Session["PK_CUENTA"].ToString());
                ReporteProyectos reporte   = new ReporteProyectos();
                reporte.SetDataSource(proyectos);
                CrystalReportViewer1.ReportSource = reporte;
                CrystalReportViewer1.DataBind();
                break;

            case "3":
                DataTable       personas = pc.ConsultarPersonas();
                ReportePersonas reporte3 = new ReportePersonas();
                reporte3.SetDataSource(personas);
                CrystalReportViewer1.ReportSource = reporte3;
                CrystalReportViewer1.DataBind();
                break;

            case "5":
                DataTable       muestras = mc.ReporteMuestrasProyecto(Request.Params["idpro"].ToString());
                ReporteMuestras prueba   = new ReporteMuestras();
                prueba.SetDataSource(muestras);
                CrystalReportViewer1.ReportSource = prueba;
                CrystalReportViewer1.DataBind();
                break;
            }
        }
示例#22
0
        protected void ddlDesconto_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                CrystalReportViewer1.ReportSource = null;
                CrystalReportViewer1.DataBind();
                if (txtCodigo.Text == "")
                {
                    Session.Add("danger", "Selecione um orçamento");
                    return;
                }

                double valorAtual = (string.IsNullOrEmpty(hfValorReal.Value)) ? 0 : Convert.ToDouble(hfValorReal.Value);

                double valorDesconto = (valorAtual * Convert.ToInt16(ddlDesconto.SelectedValue)) / 100;

                double novoValor = valorAtual - valorDesconto;

                txtValor.Text = Math.Round(novoValor, 2).ToString();
            }
            catch (Exception ex)
            {
                Session.Add("danger", ex.Message);
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         cargarProceso();
         for (int i = 2016; i <= int.Parse(DateTime.Now.ToString("yyyy")); i++)
         {
             ListItem li = new ListItem();
             li.Text  = i.ToString();
             li.Value = i.ToString();
             DropDownList1.Items.Add(li);
         }
     }
     if (!Page.IsPostBack)
     {
         try
         {
         }
         catch
         {
         }
     }
     else
     {
         ReportDocument crystalrpt = new ReportDocument();
         crystalrpt.Load(Server.MapPath(@"~/Reportes/AsistenciaMensual.rpt"));
         //crystalrpt.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, "");
         crystalrpt.Refresh();
         crystalrpt.SetParameterValue("@Anio", DropDownList1.SelectedValue);
         crystalrpt.SetParameterValue("@Mes", DropDownList2.SelectedValue);
         crystalrpt.SetParameterValue("@IdProceso", ddlProceso.SelectedValue);
         CrystalReportViewer1.ReportSource = crystalrpt;
         CrystalReportViewer1.DataBind();
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        string path = "";

        path = Server.MapPath("~/Report/FollowupSummary-CancelandPost.rpt");
        rptStudent.Load(path);
        string EMPID = Session["EMPID"].ToString();

        rptStudent.SetParameterValue("@FromDate", Request.QueryString["FromDate"].ToString());
        rptStudent.SetParameterValue("@ToDate", Request.QueryString["ToDate"].ToString());
        //rptStudent.SetParameterValue("@Todate", Request.QueryString["B"].ToString());
        //rptStudent.SetParameterValue("@Term", Request.QueryString["C"].ToString());
        //rptStudent.SetParameterValue("@Status", Request.QueryString["D"].ToString());
        //rptStudent.SetParameterValue("@CreatedBy", EMPID);

        rptStudent.SetDatabaseLogon("software", "DelFirMENA$idea");
        CrystalReportViewer1.ReportSource = rptStudent;
        CrystalReportViewer1.DataBind();
        CrystalReportViewer1.HasCrystalLogo           = false;
        CrystalReportViewer1.HasDrilldownTabs         = false;
        CrystalReportViewer1.HasDrillUpButton         = false;
        CrystalReportViewer1.HasExportButton          = true;
        CrystalReportViewer1.HasGotoPageButton        = true;
        CrystalReportViewer1.HasPageNavigationButtons = true;
        CrystalReportViewer1.HasPrintButton           = true;

        CrystalReportViewer1.HasSearchButton          = false;
        CrystalReportViewer1.HasToggleGroupTreeButton = false;
        CrystalReportViewer1.DisplayToolbar           = true;
        CrystalReportViewer1.BackColor = System.Drawing.Color.White;
    }
    public void loadcry(string InvoiceNo)
    {
        TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
        TableLogOnInfo  crtableLogoninfo  = new TableLogOnInfo();
        ConnectionInfo  crConnectionInfo  = new ConnectionInfo();
        Tables          CrTables;
        string          q2 = "SELECT * FROM IncNReport WHERE TAXPREFIX='E' AND INVOICENO='" + InvoiceNo + "'";

        Ds  = SqlObj.GetData_DS(q2);
        rep = new ReportDocument();
        rep.Load(Server.MapPath("~/IncSalesRptwidTAX.rpt"));
        rep.SetDataSource(Ds.Tables[0]);
        CrTables = rep.Database.Tables;

        foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
        {
            crtableLogoninfo = CrTable.LogOnInfo;

            crtableLogoninfo.ConnectionInfo = crConnectionInfo;

            CrTable.ApplyLogOnInfo(crtableLogoninfo);
        }
        rep.Refresh();

        CrystalReportViewer1.ReportSource = rep;
        Session["Report"] = rep;

        CrystalReportViewer1.DataBind();
        CrystalReportViewer1.RefreshReport();
    }
示例#26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        StudentRegistrationDAL s = new StudentRegistrationDAL();
        string path = "";

        path = Server.MapPath("~/Report/CMS_FOLLOWUP_REPORT.rpt");
        rptStudent.Load(path);
        rptStudent.SetParameterValue("@degreetype", Request.QueryString["C"].ToString());
        rptStudent.SetParameterValue("@fromdate", Request.QueryString["A"].ToString());
        rptStudent.SetParameterValue("@todate", Request.QueryString["B"].ToString());
        rptStudent.SetParameterValue("@createdby", Session["EMPID"].ToString());
        rptStudent.SetParameterValue("@GROUPCODE", Request.QueryString["E"].ToString());
        rptStudent.SetDatabaseLogon("software", "DelFirMENA$idea");
        CrystalReportViewer1.ReportSource = rptStudent;
        CrystalReportViewer1.DataBind();
        CrystalReportViewer1.HasCrystalLogo           = false;
        CrystalReportViewer1.HasDrilldownTabs         = false;
        CrystalReportViewer1.HasDrillUpButton         = false;
        CrystalReportViewer1.HasExportButton          = true;
        CrystalReportViewer1.HasGotoPageButton        = true;
        CrystalReportViewer1.HasPageNavigationButtons = true;
        CrystalReportViewer1.HasPrintButton           = true;

        CrystalReportViewer1.HasSearchButton          = false;
        CrystalReportViewer1.HasToggleGroupTreeButton = false;

        CrystalReportViewer1.DisplayToolbar = true;

        CrystalReportViewer1.BackColor = System.Drawing.Color.White;
    }
        private void Page_Init(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                lblprj.Text = Request.QueryString[0].ToString();
                lblsch.Text = Request.QueryString["sch"].ToString();
                string _sch = Request.QueryString["sch"].ToString();

                Session["b_zone"]   = "All";
                Session["cate"]     = "All";
                Session["f_level"]  = "All";
                Session["fed_from"] = "All";
                Session["loca"]     = "All";

                Load_Master();
                Load_Filtering_Elements();

                GenerateReport();
            }
            else
            {
                if (Session["Report"] != null)
                {
                    CrystalReportViewer1.ReportSource = (ReportDocument)Session["Report"];
                    CrystalReportViewer1.DataBind();
                }
            }
        }
示例#28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            rptDoc.Load(Server.MapPath("printuserrequest.rpt"));
            //rptDoc.Load(Server.MapPath("~/printuserrequest.rpt"));

            //if (!IsPostBack)
            // {
            ConnectionInfo connInfo = new ConnectionInfo();

            connInfo.ServerName = "172.24.1.74";

            connInfo.DatabaseName = "umbldms";

            connInfo.UserID = "sa";

            connInfo.Password = "******";


            foreach (CrystalDecisions.CrystalReports.Engine.Table tbl in rptDoc.Database.Tables)
            {
                TableLogOnInfo repTblLogonInfo = tbl.LogOnInfo;

                repTblLogonInfo.ConnectionInfo = connInfo;

                tbl.ApplyLogOnInfo(repTblLogonInfo);
            }

            CrystalReportViewer1.Visible = true;
            selectFormula = "{vAppReportOnTID.AppID} =" + TextBox1.Text + "";
            CrystalReportViewer1.DataBind();
            CrystalReportViewer1.ReportSource     = rptDoc;
            CrystalReportViewer1.SelectionFormula = selectFormula;
            CrystalReportViewer1.RefreshReport();
            // }
        }
示例#29
0
 protected void btnCancelar_Click(object sender, EventArgs e)
 {
     CrystalReportViewer1.ReportSource = null;
     CrystalReportViewer1.DataBind();
     txtCodigo.Text = string.Empty;
     txtData.Text   = string.Empty;
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            int idOrientador = (int)Session["id"];

            if (!IsPostBack)
            {
                cargarProceso();

                for (int i = 2016; i <= int.Parse(DateTime.Now.ToString("yyyy")); i++)
                {
                    ListItem li = new ListItem();
                    li.Text  = i.ToString() + " / " + (i + 1).ToString();
                    li.Value = i.ToString();
                    DropDownList1.Items.Add(li);
                }
            }
            ReportDocument crystalrpt = new ReportDocument();

            crystalrpt.Load(Server.MapPath(@"~/Reportes/ReporteAsistenciaAnualReunionesOrientador.rpt"));
            crystalrpt.Refresh();
            crystalrpt.SetParameterValue("@IdOrientador", idOrientador);
            crystalrpt.SetParameterValue("@Anio", DropDownList1.SelectedValue);
            crystalrpt.SetParameterValue("@IdProceso", ddlProceso.SelectedValue);
            CrystalReportViewer1.ReportSource = crystalrpt;
            CrystalReportViewer1.DataBind();
        }