cancel
Turn on suggestions
Showing results for
Search instead for
Did you mean:
The next set of progression badges have been announced! Let's Discuss!
Read only

Support CrystalReportViewer.DoubleClickPage in ASP.NET Webforms?

SoftwareMemo
Explorer

‎2025 Apr 14 5:32 PM - edited ‎2025 Apr 14 5:33 PM

0 Kudos
1,208

Please I need to know if Crystal Reports in ASP.NET WebForms support DoubleClickPage event to do a Drill-down feature.

I use it in my WinForms App. to open another report based on current report object info in page line.

 private void CrystalReportViewer_DoubleClickPage(object sender, PageMouseEventArgs e)
 {
 int drillbrn = 0, drilltyp = 0, drillnum = 0;
 if (e.ObjectInfos != null)
 {
 if (e.ObjectInfos.HasName("tdtbrn1"))
 {
 foreach (ObjectInfo oi in e.ObjectInfos)
 {
 if (oi.Name == "tdtbrn1")
 drillbrn = oi.Text.AsInt32();
 if (oi.Name == "tdttyp1")
 drilltyp = oi.Text.AsInt32();
 if (oi.Name == "tdtnum1")
 drillnum = oi.Text.AsInt32();
 }
 ReportDocument2.FileName = ReportsPath + "AccJV.rpt";
 ReportDocument2.RecordSelectionFormula = "{AccTransHed.thd_brn} = " + drillbrn + " and {AccTransHed.thd_typ} = " + drilltyp + " and {AccTransHed.thd_num} = " + drillnum;
 ReportDocument2.Execute(showAsDialog: true); // open another report dialog
 ReportDocument2.Close();
 }
 }
 }

I try to ask ChatGPT for any resources. but don't find anything.

https://chatgpt.com/share/67fd36b2-eb7c-8010-9518-f4f947b1dc0d

Can you please tell me how to do DoublePageClick event or alternate in ASP.NET WebForms CrystalReportVIewer.

Know the answer?

Help others by sharing your knowledge.

Answer

Need more details?

Request clarification before answering.

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.

Accepted Solutions (1)

Accepted Solutions (1)

ido_millet
Active Contributor
‎2025 Apr 16 2:10 AM
0 Kudos

You may be able to use a single-click by setting a dynamic hyperlink property:

ido_millet_0-1744765816994.png

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.

SoftwareMemo
Explorer
‎2025 Apr 16 8:36 AM
0 Kudos
Hello ido!, your solution is very perfect!, Now I don't need to create custom javascript. I can now just use hyperlink to open new report based on current row data. this is amazing. I try to set HyperlinkTarget="_blank" to make hyperlink open a report in new tab. I wish I can open it in new window but didn't find a way to do that. such as window.open javascript. see my video please https://youtu.be/pdZRMit7ebQ I also have shared reports between windows and ASP.NET how to turn off hyperlink in WinForms (Windows) and allow it in ASP.NET Web?
SoftwareMemo
Explorer
‎2025 Apr 16 8:36 AM
0 Kudos
This is my complete hyperlink formula it work perfect. "/Report.aspx?reportPath=D:\Business\Exa Cloud\Exa Cloud Source\ExaCloud\Reps02円\AccJV.rpt&reportSelection=" + URLEncode( "{AccTransHed.thd_brn} = " + ToText({VwAccTrans.tdt_brn}, 0, "") + " and {AccTransHed.thd_typ} = " + ToText({VwAccTrans.tdt_typ}, 0, "") + " and {AccTransHed.thd_num} = " + ToText({VwAccTrans.tdt_num}, 0, "") )

Answers (2)

Answers (2)

ido_millet
Active Contributor
‎2025 Apr 16 1:10 PM
0 Kudos

Glad it worked for you.

Re: "how to turn off hyperlink in WinForms (Windows) and allow it in ASP.NET Web?"
The simplest option is to use 2 different rpt file.

An alternative is to use a function from a UFL (User Function Library) to identify an environment variable, read a registry entry or an ini file setting, get the machine name, etc. Ken Hamady maintains a listing of 3rd-party UFLs here. Several of them provide functions for some/all these use cases.

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.

SoftwareMemo
Explorer
‎2025 Apr 16 1:24 PM
0 Kudos
Thanks for your great help ido, I will maybe use a report parameter to identify whether its run on Web or Windows...
ido_millet
Active Contributor
‎2025 Apr 16 1:40 PM
0 Kudos
A report parameter (even is set as Optional) would be a distraction for he winform users.
SoftwareMemo
Explorer
‎2025 Apr 16 1:46 PM
0 Kudos
Hmmm. I don't really know anything about UFL. but this link https://www.viksoe.dk/code/u2lwin32.htm shows little functions, I need something like that if current application is executable then Hyperlink will be empty. otherwise if ASP.NET app take Hyperlink value...
DonWilliams
Active Contributor
‎2025 Apr 15 4:42 PM
0 Kudos

The only Events available in the WEB viewer are these":

DonWilliams_0-1744731450715.png

I've asked R&D about making these types of events available in the WEB viewer and the problem is the view of the report is EPF based, it's an image of each page. There isn't an easy way to allow the browser and the viewer to talk to each other.

What you can do though it add a subreport to the main report so if you want another report link the subreport to the new report, you can then simply drill down.

Use RAS to add subreports in code.

See this page for the Reference material:

https://help.sap.com/docs/SAP_CRYSTAL_REPORTS,_DEVELOPER_VERSION_FOR_MICROSOFT_VISUAL_STUDIO?locale=...

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.

SoftwareMemo
Explorer
‎2025 Apr 15 4:51 PM
0 Kudos
Hi Don!
SoftwareMemo
Explorer
‎2025 Apr 15 4:53 PM
0 Kudos
Hi Don!, It will be really helpful if DoublePageClick is javascript event or something that we can handle, so it can return e.ObjectInfos. Because I can send a Callback to the server by ASPxCallback (DevExpress callback) or Ajax callback and send objectinfo that I need then open another report after ajax is complete. but unfortunately DoublePageClick doens't exist in Web version. You can support this event as Callback event or something. so after callback is complete I can take e.ObjectInfo I need and open external report based on that...
SoftwareMemo
Explorer
‎2025 Apr 15 5:00 PM
0 Kudos

I don't actually use DrillDown, But I open external report based on e.ObjectInfos parameters after double click on Row. for example opening Statement of Account report based on current selection account from Balances Report see following video please to describe my scenario: https://youtu.be/e_f8ntBeI-w

DonWilliams
Active Contributor
‎2025 Apr 15 5:05 PM
0 Kudos

As I noted, DEV can't add any more events due to limitations in the Viewer and permissions etc. As a work around add a blank subreport in the section required, then use the DrillDownSubreport event to redirect your app to open a new report in a new tab based on your logic. Asking them for an enhancement request will take time if they agree to do it or if it's possible...

Using Java to do this should work though, I recall a while ago this was the solution but I don't recall how to now...

The Desktop Viewer does have a Double Click row Event but that's not going to help you....

SoftwareMemo
Explorer
‎2025 Apr 15 5:12 PM
0 Kudos

Thanks for your reply dear, Please I need to know from you. If i use DrillDownSubreport event can I get e.ObjectInfos in that Section? or for example get row data or row cell values? as example I have a row that consist of transaction Branch and Number. when user double click on this row (DrillDownSubreport you mentioned) the another report will shown based on that Branch and Number.

DonWilliams
Active Contributor
‎2025 Apr 15 5:20 PM
0 Kudos
This should be all done using Groups etc., Report Design is not my fortae. Maybe Dell or Ido can help you design the report...
SoftwareMemo
Explorer
‎2025 Apr 15 5:28 PM
0 Kudos
But Don, The ObjectInfo already exposed in JavaScript/HTML. I need just something like when double-click on that row by javascript maybe. take tdt_brn1 and tdt_num1 and launch external report based on these ObjectInfos. https://prnt.sc/59QvUDMFc9EN
DonWilliams
Active Contributor
‎2025 Apr 15 5:41 PM
I understand, but I did say the page is a picture of the report so there is no way to detect which object of the actual report your are double clicking on and there no way to detect the column the user clicked on... By using Drill down or a subreport will allow the report to open another report(subreport). I pinged Dell and Ido to help you with the design.
SoftwareMemo
Explorer
‎2025 Apr 15 7:13 PM
0 Kudos

Hi again, I try really hard to make things work. I found a hack solution. to inject an element i.e. Drill1 inside CrystalReport document. then use it from iframe by JQuery and make a callback to the server to allow use this drill-down parameters and after callback is complete open external report with specified row information. in this video I show it Open External Journal Entry from Statement of Account line. https://youtu.be/2eiSKF-Y4z0 Am sorry if my English is not good. But I try to explain how to hack a DoublePageClick function in ASP.NET Web. It will be really helpful if this event is supported by javascript side in Crystal Reports Web.

Ask a Question

AltStyle によって変換されたページ (->オリジナル) /