0

サブレポートにパラメーターを送信して画像を表示していますが、送信できません。なんで ?

同じ方法で親レポートに画像をロードしましたが、そのプロセスはサブレポートでは機能しません。

なんで ?

親レポート:

public void Fill_AuditsReport()
    {
        ReportViewer1.AsyncRendering = false;
        ReportViewer1.SizeToReportContent = true;
        ReportViewer1.ZoomMode = ZoomMode.FullPage;
        this.ReportViewer1.Reset();

        DataTable dt = new DataTable();
        PersonalInfo.ManagePersonalInfo MngPersonalInfo = new PersonalInfo.ManagePersonalInfo();

        dt = MngPersonalInfo.ReportSelectPersonalInfo();

        ReportViewer1.ProcessingMode = ProcessingMode.Local;
        ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/DataManagementReports/Report.rdlc");
        ReportDataSource rpds = new ReportDataSource("DataSetEmployeeInfo", dt);

        ReportViewer1.LocalReport.EnableExternalImages = true;
        string FilePath = new Uri(Server.MapPath("~/SiteImages/")).AbsoluteUri;
        ReportParameter param = new ReportParameter("ImgPath", FilePath);
        ReportViewer1.LocalReport.SetParameters(param);
        ReportViewer1.LocalReport.Refresh();

        ReportViewer1.LocalReport.DataSources.Clear();
        ReportViewer1.LocalReport.DataSources.Add(rpds);
        ReportViewer1.Visible = true;
    }

サブレポート: (ドリルスルー)

protected void ReportViewer1_Drillthrough(object sender, DrillthroughEventArgs e)
{
    try
    {
        LocalReport Report = (LocalReport)e.Report;
        int ID = Convert.ToInt32(e.Report.GetParameters()[0].Values[0].ToString());


        Report.DataSources.Add(new ReportDataSource("DataSetEmployeeAllData", LoadValues(ID)));
        Report.Refresh();


    }
    catch (Exception ex)
    {
        throw new Exception(ex.Message);
    }

}

    private DataTable LoadValues(int PersonalInfoID)
    {
        try
        {

            //DataSetPersonalInfoTableAdapters.ReportEmployeeAllDataTableAdapter tba = new DataSetPersonalInfoTableAdapters.ReportEmployeeAllDataTableAdapter();

            DataSetEmployeeAllDataTableAdapters.ReportEmployeeAllDataTableAdapter tba = new DataSetEmployeeAllDataTableAdapters.ReportEmployeeAllDataTableAdapter();

            return tba.GetData(PersonalInfoID);


        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
            throw;
        }
    }
4

0 に答える 0