Skip to Content
Author's profile photo Jamie Wiseman

Disable Drill-Down on Subreports in Crystal Reports CR2008 or XI 3.x DHTML Viewers

While in the CR2008 or XI 3.x DHMTL viewers, an end user can click on a subreport and drill down to that subreport. This will open the subreport in a new tab.

 

Sometimes a report developer will not want the end users to drill down on a subreport. There is no property in the Format Subreport dialogue that will disable this drill property. However, there are a couple of workarounds for this.

 

A) If the subreport does not span more than 1 page and you know the end size of the subreport, you can place Text Object on top of the subreport. Populate the new Text Object with spaces and breaks to ensure that the subreport is completely masked.

 

or

 

B) You can disallow drill-down on all sub-reports in a report using javascript.

 

Steps:

 

1) You must have Pass-Through HTML activated in your Enterprise or Crystal Reports Server environment. For more information on activating Pass-Through HTML please see the webElements download Crystal Reports webElements. There are instructions in the webElements User Guide which is in the download. By activating Pass-Through HTML a report developer can embed HTML or javascript directly on a Crystal Report.

 

2) Download the “Disallow Drill-Down In Subreports” sample report here. Press the “View this Code Sample” button to download the sample.

 

3) Open the sample report and copy the {@DisallowDrillDownInSubreports} formula in the Page Header onto an unsuppressed Page Header on your report.

 

4) Save your report back to your Enterprise or Crystal Reports Server environment. Drill-down on your report’s subreports should now be disabled.

 

NOTES:

 

1) Activating Pass-Through HTML is supported in BusinessObjects Enterprise XI and higher. The javascript or HTML that you build on your report is not supported by Customer Assurance. Therefore this workaround is not supported by Customer Assurance.

 

2) If you want to disable drill-down on Group Summaries or Group Headers, please see Ray Li’s blog Disable summary fields from drill down in Crystal Reports.

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Rajiv Dutta
      Rajiv Dutta

      Hi Jamie,

      I have used the attached script in XI 3.1 but is it not working with CR 2013/BI 4.1. Can you help/guide me where to look at for this in BI 4.1?

      Regards,
      Rajiv D

       

      Author's profile photo Jamie Wiseman
      Jamie Wiseman
      Blog Post Author

      hi Rajiv,

      i'm assuming that there's an issue with activating pass-through html on your boe or cr server system...if that is in fact the case, here are the steps farther below....note that your directory path may vary.

      you can test if pass-through html is working on your enterprise system by creating a new formula on a report with the following syntax should not show the div tags and be formatted for blue colour text.

      '<div style="color:#0000FF">this is a blue div</div>'

      regards,
      -jamie

      1. create new & empty CrystalReports.Properties file in

      <DIR>:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\warfiles\webapps\BOE\WEB-INF\config\custom  folder

       

      1. Add only the following key to the new custom properties file

       

      # This parameter is used to activate pass-through HTML for Crystal Reports

      crystal_encode_html_for_single_line_field_objects=no

       

      1. Stop the web application server (WAS) e.g. tomcat

       

      1.       Run WDeploy (Start > All Programs > SAP Business Intelligenc > <app dir>  using the Undeploy option to empty out

      <DIR>:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\wdeploy\workdir\tomcat7\application

       

      1. Deploy new BOE.WAR using WDeploy (this time using Deploy option) and restart the WAS

       

      Author's profile photo Rajiv Dutta
      Rajiv Dutta

      Hi Jamie,

      Thanks for the response. However, this has not helped either.

      BTW, I have ensured that other HTML Pass-Through Web-elements are working from DHTML Viewer when embedded in CR 2013 except this.

      Any help would be appreciated.

      Regards,
      Rajiv D

      Author's profile photo Jamie Wiseman
      Jamie Wiseman
      Blog Post Author

      hi Rajiv,

      sorry this isn't working for you. can you please do me a favour and copy the source code from the cr viewer and post a link to the txt file in dropbox? i haven't used cr & boe for quite a while but will have a quick look at your source code just to see if it's a simple naming change in the html node...i.e. before the function was looking for "Subreports".

      if it's something more complex then i'm not sure what can be done to fix this in 4.1 as this was a sample i built a while ago and as mentioned i don't really work with cr anymore. there have been significant changes in the 4.1 dhtml viewer vs. 4.0.

      -jamie