cancel
Showing results for 
Search instead for 
Did you mean: 

How to prevent Sub Report click event

Former Member
0 Kudos

I'm using a subreport as a report header. I've discovered that the user can click on the subreport and it appears to disable the tool bar. I realized that it's actually drilling into the subreport and that the name of the subreport is displayed in the tool bar. Is there anyway to prevent the user from drilling down while still displaying the content? I tried Suppress, but that just hides the report.

tia

Chris

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Chris,

Which version of VS & CR you are using ?

Please test with a crystal sample report.

It is working fine at my end.

Regards,

Shweta

Former Member
0 Kudos

I'm using the version of Crystal that ships with VS 2008.

Not sure what you mean when you say it works fine for you. Does that mean clicking on a subreport does NOT drill down?

When I click on my "Report Header" which is a subreport, the tool bar reports that I'm now in the subreport and has disabled the previous/next buttons, since there are no other pages in the subreport. This will confuse my users, so I need to prevent them from clicking into the subreport.

Does that clarify things?

Chris

Former Member
0 Kudos

Hi Chris,

I have tested at my end and I am able to view toolbar in sub report too.

As you have mentioned that you have only one page in sub report and that makes confusion.

I would suggest to give some name in report header of sub report to avoid confusion.

Test with some other report which have 2-3 pages are you getting the same issue ?

Regards,

Shweta

Former Member
0 Kudos

You still haven't responded to my initial request: Can I prevent the user from clicking on the subreport? Is there a way to disable the click event? If so, what is it?

Chris

Former Member
0 Kudos

Hi Chris,

To prevent the user from clicking on the subreport.

Try with this:

CrystalReportviewer ->Properties->EnableDrillDown =False.

Hope this helps !!

Regards,

Shweta

0 Kudos

Hi Chris,

No there is not and option directly in the GUI. Even in the full version of Crystal Reports Designer there is no option to not allow drill down. The process is if you want to display data in a sub dataset but not have it in the main report a subreport is used, for drilling into more details.

Is there a reason you can use database fileds directly in the header and use section filters or something similar to show the data?

Not sure why you are using a subreport for this info?

Thank you

0 Kudos

Unforetunately this function:

CrystalReportviewer ->Properties->EnableDrillDown =False.

Disables all drill down.

former_member200290
Contributor
0 Kudos

There is actually no way to stop the drill down in the subreport with in the report itself. However thereare two solutions:

A - From the design of the report.

If the subreport is not dynamically sized, IE you know the max size it will be then you can:

1 - create a blank formula in the main report.

2 - Size the subreport to the largest it will be

3 - Insert the formula in the same section as the subreport just above the subreport.

4 - Size the formula to be slightly bigger then the subreport

Now as the formula is blank and it sits above the subreport (layer wise) any clicks will go to it and not to the subreport.

B - From code:

The .NET viewer control has a DrillDownSubreport event. Open this even and set the handled property to true, this will tell the viewer that you are handling the drill-down so it has to do nothing. The code will look like this:

(In C# that is, and similar in VB .NET)

private void CrystalReportViewer1_DrillDownSubreport(object source, CrystalDecisions.Web.DrillSubreportEventArgs e)

{

e.Handled = true

}

Former Member
0 Kudos

Trevor,

Thanks. Answer B was exactly what the doctor ordered!

It's unlikely this particular environment will ever need to support drill down. If we do I'll work it out then. For right now just killing the whole thing is excellent.

Chris

Former Member
0 Kudos

Trevor,

I've been reviewing answer "A" on the offhand possibility that I might need to use it.

If my subreport is the size of an 8x11 sheet of paper (it uses 'Page After'), what would I put into the formula. I'm assumging that you were referring to the size of the page when you refer to "sizing the formula".

Thanks

Chris

former_member200290
Contributor
0 Kudos

The thing with this solution is you HAVE to know the size of the subreport, it cannot be dynamically sized. And I don't think this will work if the subreport spans pages.

If you know the amount of lines the subreport is going to be, you could create the text of the formula to have one line feed per line of the subreport. So if the subreport was 3 lines long your formula would read

"chr (10) + chr (13) + chr (10) + chr (13) + chr (10) + chr (13)"

I have also found that if this method is used, when running the report from InfoView (Business Objects Enterprise) it seems not to work.

Trevor

Answers (0)