0

好的,所以我做了一些更改并到达了某个地方。然而,问题仍然是他们的。我发现当生成主报告时,超链接不会添加到某些字段中。但是,当我们使用相同的参数再次重新运行报告时(我们有一个重新运行报告的链接,只更改了年份参数),这些字段现在有了链接。这很奇怪。例如,我运行 2012 年的报告,按链接返回 2011,然后按链接转到 2012,这些链接现在在 2012 年有效。

4

1 回答 1

0

您是否只在第一页加载时将“ReportDocument”对象分配给 CrystalReportViewer?您应该尝试将报表文档存储在会话中,并确保在回发时再次设置 CrystalReportViewer 控件的“ReportSource”属性。

if (!IsPostBack)
{
    // do a bunch of Crystal Report's loading stuff
    ReportDocument yourReportDocument = new ReportDocument();
    // etc, etc.
    // store the report document in server memory
    yourViewerControl.ReportSource = yourReportDocument;
    Session["theReportDocument"] = yourReportDocument;
}
else
{
    yourViewerControl.ReportSource = Session["theReportDocument"];
    yourViewerControl.Show();
}
于 2012-04-17T02:19:49.363 回答