示例#1
0
    protected void bt_Refresh_Click(object sender, EventArgs e)
    {
        ReportViewer1.ServerReport.ReportServerCredentials = new MCSReportServerCredentials();
        ReportViewer1.ServerReport.ReportPath = ViewState["ReportPath"].ToString();
        ReportViewer1.ServerReport.ReportServerUrl = new Uri(ViewState["ReportServerUrl"].ToString());

        if (ReportViewer1.ServerReport.GetParameters().Count == 3)
        {
            int staff = 0;
            int position = new Org_StaffBLL((int)Session["UserID"]).Model.Position;
            string remark = new Org_PositionBLL(position).Model.Remark;
            if (remark != null && remark.Contains("OnlyViewSelfReport"))
            {
                staff = (int)Session["UserID"];
            }
            ReportParameter[] _parms = {
                new ReportParameter("BeginDate",tbx_begin.Text),
                new ReportParameter("EndDate", tbx_end.Text),
                new ReportParameter("Staff",staff.ToString())
             };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }
        else
        {
            ReportParameter[] _parms = {
                new ReportParameter("BeginDate",tbx_begin.Text),
                new ReportParameter("EndDate", tbx_end.Text)
            };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }



    }
    protected void bt_Refresh_Click(object sender, EventArgs e)
    {
        if (tr_OrganizeCity.SelectValue == "0")
        {
            MessageBox.Show(this, "请选择要查询的管理片区!");
            return;
        }

        ReportViewer1.ServerReport.ReportServerCredentials = new MCSReportServerCredentials();
        ReportViewer1.ServerReport.ReportPath = ViewState["ReportPath"].ToString();
        ReportViewer1.ServerReport.ReportServerUrl = new Uri(ViewState["ReportServerUrl"].ToString());

        if (ReportViewer1.ServerReport.GetParameters().Count == 2)
        {
            int staff = 0;
            int position = new Org_StaffBLL((int)Session["UserID"]).Model.Position;
            string remark = new Org_PositionBLL(position).Model.Remark;
            if (remark != null && remark.Contains("OnlyViewSelfReport"))
            {
                staff = (int)Session["UserID"];
            }
            ReportParameter[] _parms = {
                new ReportParameter("OrganizeCity", tr_OrganizeCity.SelectValue),
                new ReportParameter("Staff",staff.ToString())
             };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }
        else
        {
            ReportParameter[] _parms = {
                new ReportParameter("OrganizeCity", tr_OrganizeCity.SelectValue)
            };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }
    }
    protected void bt_Refresh_Click(object sender, EventArgs e)
    {
        ReportViewer1.ServerReport.ReportServerCredentials = new MCSReportServerCredentials();
        ReportViewer1.ServerReport.ReportPath = ViewState["ReportPath"].ToString();
        ReportViewer1.ServerReport.ReportServerUrl = new Uri(ViewState["ReportServerUrl"].ToString());

        if (ReportViewer1.ServerReport.GetParameters().Count == 3)
        {
            int staff = 0;
            int position = new Org_StaffBLL((int)Session["UserID"]).Model.Position;
            string remark = new Org_PositionBLL(position).Model.Remark;
            if (remark != null && remark.Contains("OnlyViewSelfReport"))
            {
                staff = (int)Session["UserID"];
            }
            ReportParameter[] _parms = {
                new ReportParameter("BeginDate",tbx_begin.Text),
                new ReportParameter("EndDate", tbx_end.Text),
                new ReportParameter("Staff",staff.ToString())
             };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }
        else
        {
            ReportParameter[] _parms = {
                new ReportParameter("BeginDate",tbx_begin.Text),
                new ReportParameter("EndDate", tbx_end.Text)
            };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }
    }
    protected void bt_Refresh_Click(object sender, EventArgs e)
    {
        string orgcitys = "";

        if (tr_OrganizeCity.SelectValue != "0")
        {
            Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(int.Parse(tr_OrganizeCity.SelectValue), true);
            orgcitys = orgcity.GetAllChildNodeIDs();
            if (orgcitys != "")
            {
                orgcitys += ",";
            }
            orgcitys += tr_OrganizeCity.SelectValue;
        }
        else
        {
            MessageBox.Show(this, "请选择要查询的管理片区!");
            return;
        }

        ReportViewer1.ServerReport.ReportServerCredentials = new MCSReportServerCredentials();
        ReportViewer1.ServerReport.ReportPath      = ViewState["ReportPath"].ToString();
        ReportViewer1.ServerReport.ReportServerUrl = new Uri(ViewState["ReportServerUrl"].ToString());

        if (ReportViewer1.ServerReport.GetParameters().Count == 3)
        {
            int    staff    = 0;
            int    position = new Org_StaffBLL((int)Session["UserID"]).Model.Position;
            string remark   = new Org_PositionBLL(position).Model.Remark;
            if (remark != null && remark.Contains("OnlyViewSelfReport"))
            {
                staff = (int)Session["UserID"];
            }
            ReportParameter[] _parms =
            {
                new ReportParameter("OrganizeCitys", orgcitys),
                new ReportParameter("Month",         ddl_Month.SelectedValue),
                new ReportParameter("Staff",         staff.ToString())
            };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }
        else
        {
            ReportParameter[] _parms =
            {
                new ReportParameter("OrganizeCitys", orgcitys),
                new ReportParameter("Month",         ddl_Month.SelectedValue)
            };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }
    }
    protected void bt_Refresh_Click(object sender, EventArgs e)
    {
        string orgcitys = "";
        if (tr_OrganizeCity.SelectValue != "0")
        {
            Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(int.Parse(tr_OrganizeCity.SelectValue), true);
            orgcitys = orgcity.GetAllChildNodeIDs();
            if (orgcitys != "") orgcitys += ",";
            orgcitys += tr_OrganizeCity.SelectValue;
        }
        else
        {
            MessageBox.Show(this, "请选择要查询的管理片区!");
            return;
        }

        ReportViewer1.ServerReport.ReportServerCredentials = new MCSReportServerCredentials();
        ReportViewer1.ServerReport.ReportPath = ViewState["ReportPath"].ToString();
        ReportViewer1.ServerReport.ReportServerUrl = new Uri(ViewState["ReportServerUrl"].ToString());

        if (ReportViewer1.ServerReport.GetParameters().Count == 3)
        {
            int staff = 0;
            int position = new Org_StaffBLL((int)Session["UserID"]).Model.Position;
            string remark = new Org_PositionBLL(position).Model.Remark;
            if (remark != null && remark.Contains("OnlyViewSelfReport"))
            {
                staff = (int)Session["UserID"];
            }
            ReportParameter[] _parms = {
                new ReportParameter("OrganizeCitys", orgcitys),
                new ReportParameter("Month", ddl_Month.SelectedValue),
                new ReportParameter("Staff",staff.ToString())
             };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }
        else
        {
            ReportParameter[] _parms = {
                new ReportParameter("OrganizeCitys", orgcitys),
                new ReportParameter("Month", ddl_Month.SelectedValue)
            };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }
    }
示例#6
0
    protected void bt_Refresh_Click(object sender, EventArgs e)
    {
        if (tr_OrganizeCity.SelectValue == "0")
        {
            MessageBox.Show(this, "请选择要查询的管理片区!");
            return;
        }

        ReportViewer1.ServerReport.ReportServerCredentials = new MCSReportServerCredentials();
        ReportViewer1.ServerReport.ReportPath      = ViewState["ReportPath"].ToString();
        ReportViewer1.ServerReport.ReportServerUrl = new Uri(ViewState["ReportServerUrl"].ToString());

        if (ReportViewer1.ServerReport.GetParameters().Count == 2)
        {
            int    staff    = 0;
            int    position = new Org_StaffBLL((int)Session["UserID"]).Model.Position;
            string remark   = new Org_PositionBLL(position).Model.Remark;
            if (remark != null && remark.Contains("OnlyViewSelfReport"))
            {
                staff = (int)Session["UserID"];
            }
            ReportParameter[] _parms =
            {
                new ReportParameter("OrganizeCity", tr_OrganizeCity.SelectValue),
                new ReportParameter("Staff",        staff.ToString())
            };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }
        else
        {
            ReportParameter[] _parms =
            {
                new ReportParameter("OrganizeCity", tr_OrganizeCity.SelectValue)
            };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }
    }