Symptom
How to retrive the name of group element selected in a Crystal Reports.
Reproducing the Issue
- Create a report which contains groups.
- Add the report to .Net web-application.
- Assign the report to viewer in application.
- Execuite the application.
- Select an element in the group tree in report.
- User wants the name of the selected element.
Resolution
- Create a report which contains groups.
- Add the report to .Net web-application.
- Assign the report to viewer in application.
- Add following line of code to the CrystalReportViewer_navigate() method:
string groupName = Server.UrlDecode(Request.Form["__EVENTARGUMENT"].ToString());
int i;// The groupname always starts with 'drillname=' so well get rid of that first
groupName = groupName.Replace("drillname=", "");// Find the location of '&grp=' in this string as it at the end
i = groupName.Length - groupName.IndexOf("&grp=");// drop everything from '&grp=' and back. This is now the group name
groupName = groupName.Substring(0, groupName.Length - i); - Display the groupName value in the application.
See Also
Keywords
dot net, vs, cr, gptree , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , How To