0

私のシステムでは、ストアド プロシージャに基づくレポートを使用しています。C# からレポートにパラメーターが渡され、レポートはストアド プロシージャを呼び出します。コードに新しいパラメーターを追加し、ストアド プロシージャとレポートを変更しましたが、展開されたレポート マネージャーは既定値のみを使用し、アプリから渡されたパラメーターを使用していないようです。これは既知の問題ですか?回避策はありますか? ありがとう!

コード:

using System;
using System.Web;
using ICT_Web.App_Code.AcademicTableAdapters;

namespace ICT_Web.reports
{
    public partial class R43FutureStartsReport : System.Web.UI.Page
    {
        ICT_Acd_ProgramsTableAdapter myProgramAdapter = new ICT_Acd_ProgramsTableAdapter();
        string ReportServerUrl = System.Configuration.ConfigurationManager.AppSettings["ICT_WebReportServerURL"];
        Session mySess;

        protected void Page_Load(object sender, EventArgs e)
        {
            mySess = new Session(HttpContext.Current.Session.SessionID);
            if (!IsPostBack)
            {
                lbProgram.DataSource = myProgramAdapter.GetData().Select("campus_id  = " + mySess.campus_id);
                lbProgram.DataTextField = "title";
                lbProgram.DataValueField = "program_id";
                lbProgram.AppendDataBoundItems = true;
                lbProgram.DataBind();
            }
        }
        protected void submit_OnClick(object sender, EventArgs e)
        {
            if (hdnProgramIds.Value != "")
            {
                ReportViewer1.Visible = true;
                ReportViewer1.Reset();
                Microsoft.Reporting.WebForms.ReportParameter[] Param = new Microsoft.Reporting.WebForms.ReportParameter[6];
                Param[0] = new Microsoft.Reporting.WebForms.ReportParameter("campus_id", mySess.campus_id.ToString());
                Param[1] = new Microsoft.Reporting.WebForms.ReportParameter("program_ids", hdnProgramIds.Value);
                Param[2] = new Microsoft.Reporting.WebForms.ReportParameter("user_id", mySess.user_id.ToString());
                if (rball.Checked)
                {
                    Param[3] = new Microsoft.Reporting.WebForms.ReportParameter("I20", "false");
                    Param[4] = new Microsoft.Reporting.WebForms.ReportParameter("NonI20", "false");
                    Param[5] = new Microsoft.Reporting.WebForms.ReportParameter("Both", "true");
                }
                if (rbi20.Checked)
                {
                    Param[3] = new Microsoft.Reporting.WebForms.ReportParameter("I20", "true");
                    Param[4] = new Microsoft.Reporting.WebForms.ReportParameter("NonI20", "false");
                    Param[5] = new Microsoft.Reporting.WebForms.ReportParameter("Both", "false");
                }
                if (rbnoni20.Checked)
                {
                    Param[3] = new Microsoft.Reporting.WebForms.ReportParameter("I20", "false");
                    Param[4] = new Microsoft.Reporting.WebForms.ReportParameter("NonI20", "true");
                    Param[5] = new Microsoft.Reporting.WebForms.ReportParameter("Both", "false");
                }
                ReportViewer1.ServerReport.ReportServerUrl = new System.Uri(ReportServerUrl);
                ReportViewer1.ServerReport.ReportPath = "/General/R-43";
                ReportViewer1.ServerReport.SetParameters(Param);
                ReportViewer1.ShowBackButton = true;
                ReportViewer1.AsyncRendering = true;
                ReportViewer1.SizeToReportContent = true;
            }
        }
    }
}
4

0 に答える 0