I am using visual studio 2015 and crystal reports 2013 (version 14.1.4.1327). On crystalReportViewer when I click a TextObject, or anything else on the report, is there a way to get the section name or the value of the clicked content?
Thanks!
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);
}
Found the answer here: https://archive.sap.com/discussions/thread/1073492
However, this won't work for subreports.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.