2

I have a report. The report has a header. Sometimes, users view my report by itself. Other times, they view it as part of a larger combined report.

The combined report also has a header. So, in 'subreport mode' my report ends up with two headers.

I want to hide the header of the subreport, but only when it is a subreport.

I'm hoping for something like Visible=IsSubreport. Is there a way for my report to tell if it is running as a subreport? Or do I have to add a new parameter and pass it in from the outside, telling it whether it is a subreport or not?

JosephStyons
  • 57,317
  • 63
  • 160
  • 234
  • 1
    Weird.. when I embed a subreport in my main report.. the sub report headers are suppressed automatically.. I.E. subreport headers are not show when run from parent report. so in theory, you should only ever see one header.. unless you have the "header" as part of the body of the subreport. – Harry May 07 '18 at 04:08
  • Hey, that's a great observation. The "header" of my subreport is in fact contained in the body of the report. That probably explains the issue right there. The thing is, that just makes it clear that the report *does* know if it is a subreport. Do you know any way to access that from an expression? – JosephStyons May 07 '18 at 14:26
  • if the whole idea is to suppress the double header.. why not make the subreport header that is currently in the body of the subreport an actual header? That way.. if the report is called from the parent.. the subreport headers are suppressed.. if the subreport is run on it's own.. then it already will have proper header.. no need to figure anything out. – Harry May 07 '18 at 21:13
  • @Harry You are right, and I realize that's the correct solution here. In this case the subreport was written by someone else, and it is enormously complex. I am hesitant to touch it more than i absolutely have to. – JosephStyons May 10 '18 at 18:54

1 Answers1

2

You can add a parameter as isSubReport to you report like this:

enter image description here

And then pass "true" from the Sub report properties menu.

enter image description here

Pelin
  • 936
  • 5
  • 12
  • Yeah, that's what I meant by "Or do I have to add a new parameter and pass it in from the outside". That approach works. What I was hoping for, was a built-in field that automatically "knows" if the report is running as a subreport or not. – JosephStyons May 07 '18 at 14:24