报告视图滚动问题,同时在模态窗口中显示它

时间:2017-01-03 10:01:43

标签: c# winforms modal-dialog report

首先,我打开一个报告标准视图(父工作区),我选择TalentinShow,year和Show等标准,然后点击getReport按钮,它在modalwindow(智能部分)中显示报告,如果用户向下滚动并关闭报告然后在下次打开报告时显示向下的视图。该视图未在下次保留

enter image description here enter image description here

在这里输入代码 报告视图:enter code here                 var talentInShowDataSource = new ReportDataSource();                 talentInShowDataSource.Name =" CastingNDiversity_DomainModel_BusinessEntities_TalentInShow&#34 ;;                 talentInShowDataSource.Value = value;

            _reportViewer.LocalReport.DataSources.Clear();
            _reportViewer.LocalReport.DataSources.Add(talentInShowDataSource);
            _reportViewer.LocalReport.ReportEmbeddedResource = "CastingNDiversity.Reports.ReportFiles.TalentInShowReport.rdlc";

            ResumeLayout(false);
            _reportViewer.RefreshReport();
            Dock = DockStyle.Fill;
public T ShowModalWindow<T>(T view, string title)
    {
        var info = new WindowSmartPartInfo
        {

            Modal = true,
            ControlBox = true,
            MinimizeBox = true,
            MaximizeBox = true,
            Width = Screen.PrimaryScreen.WorkingArea.Width * 2/3 ,
            Height = Screen.PrimaryScreen.WorkingArea.Height * 2/3 ,
            Title = title 

        };



            info.Keys.Add(WindowWorkspaceSetting.FormBorderStyle, FormBorderStyle.Sizable);
            info.Keys.Add(WindowWorkspaceSetting.StartPosition, FormStartPosition.CenterParent);

            ReportView._reportViewer.RefreshReport();
            WorkItem.Workspaces[WorkspaceNames.ModalWindows].Show(view, info);

            return view;


    }

如果我使用dispose方法然后下次我得到Exception as:ObjectDisposedException:无法访问已处置的对象。对象名称:'%name%'。 enter code here

0 个答案:

没有答案