【发布时间】:2017-10-25 20:52:23
【问题描述】:
我正在使用 Visual Studio 2015 和 Crystal Reports 2013(版本 14.1.4.1327)。在 CrystalReportViewer 上,当我单击 TextObject 或报告上的任何其他内容时,有没有办法获取部分名称或单击内容的值?
谢谢!
【问题讨论】:
标签: c# visual-studio crystal-reports
我正在使用 Visual Studio 2015 和 Crystal Reports 2013(版本 14.1.4.1327)。在 CrystalReportViewer 上,当我单击 TextObject 或报告上的任何其他内容时,有没有办法获取部分名称或单击内容的值?
谢谢!
【问题讨论】:
标签: c# visual-studio crystal-reports
private void crystalReportViewer1_ClickPage(object sender, CrystalDecisions.Windows.Forms.PageMouseEventArgs e)
{
// Collect the report object name and type.
string msg = "Report Object: " + e.ObjectInfo.Name.ToString()
+ " (" + e.ObjectInfo.ObjectType.ToString() + ")";
// Some report objects won't have text properties; verify that the property isn't null
// before attempting to access it.
if (e.ObjectInfo.Text != null)
{
msg += "... Text: " + e.ObjectInfo.Text.ToString();
}
// Display the collected information in a message box.
MessageBox.Show(msg);
}
在这里找到答案:https://archive.sap.com/discussions/thread/1073492
但是,这不适用于子报表。
【讨论】: