gpt4 book ai didi

wpf - 我如何知道 Crystal Reports 已完成呈现?

转载 作者:行者123 更新时间:2023-12-01 11:49:23 24 4
gpt4 key购买 nike

我有一个 Crystal Reports 13 wpf 控件,我正在加载来自数据集的报表和数据:

ReportDocument report = new ReportDocument();
if (report != null)
{
report.Load(ReportFileName);
report.SetDataSource(DataSet);
reportViewer.ViewerCore.ReportSource = report;
}

为了知道控件何时完成渲染,我可以处理什么事件?查看器导出:

public event PageMouseEventHandler ClickPage;
public event PageMouseEventHandler DoubleClickPage;
public event DrillEventHandler Drill;
public event DrillSubreportEventHandler DrillDownSubreport;
public event NavigateEventHandler Navigate;
public event RefreshEventHandler Refresh;
public event SearchEventHandler Search;
public event RoutedEventHandler SelectionChange;
public event RoutedEventHandler ViewChange;
public event ZoomEventHandler ViewZoom;

ViewerCore 仅导出:

public event ExceptionEventHandler Error;

这些似乎都不合理。我也曾短暂地使用过 ReportClientDocument。

最佳答案

为了后代:

DependencyPropertyDescriptor p = DependencyPropertyDescriptor.FromProperty(SAPBusinessObjects.WPF.Viewer.ViewerCore.TotalPageNumberProperty, typeof(SAPBusinessObjects.WPF.Viewer.ViewerCore));
p.AddValueChanged(reportViewer.ViewerCore, OnPageCountChanged);

由于 TotalPageNumber 属性在该页面呈现后正确更新...

private void OnPageCountChanged(object sender, EventArgs e)
{
//do whats needed
}

您知道控件何时完成呈现。

关于wpf - 我如何知道 Crystal Reports 已完成呈现?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12959511/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com