?
Solved

Dynamically Moving Report Objects if SubReport Suppressed

Posted on 2004-04-23
9
Medium Priority
?
709 Views
Last Modified: 2008-01-16
Hi,

I hope i am asking a question which has a very simple answer, but for all my trying i dont seem able to find it.

I want to put a subreport into the Report Footer alongside an existing chart object (so that the subreport is to the left of the chart). Ideally i would really like to have the subreport in the same section as the chart.

This works well if the subreport contains data - the report looks neatly formatted.

However if the subreport does not contain any data i would like to suppress it and then move the chart object across to cover the entire space of the report footer (else the report has a silly blank space in it).

Does anybody have any ideas on how to achieve this ? - all i want to do is say 'if the subreport is suppressed then resize the chart to cover the bigger space'

Many thanks in advance for your help.


0
Comment
Question by:wilkinsg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 42

Accepted Solution

by:
frodoman earned 900 total points
ID: 10899913
What I would do is to create two charts - a full size one and a half size one and put them in different report footer sections.  If the subreport is suppressed then suppress the entire report footer a and don't suppress report footer b (containing the full size report).  If the subreport isn't suppressed then do the opposite.
0
 

Author Comment

by:wilkinsg
ID: 10900052
Sounds like it should work nicely.

One question thou' - How do i suppress the entire report footer/not the other one if the subreport is to be suppressed ?

Thanks

0
 
LVL 101

Expert Comment

by:mlmcc
ID: 10902545
That is probably the best way to do it.  Trying to resize an object would be difficult at best.

mlmcc
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 7

Expert Comment

by:ladylinet
ID: 10922331
Which version of Crystal? In version 9, you can say on subreport itself to suppress if blank, in previous versions that was impossible.
 And you can put subreport in separate section, and suppress section if blank also.
 SubReport can return shared variable that will notify main report that it should unsuppress other one...

Lady Linet
0
 

Author Comment

by:wilkinsg
ID: 10927821
It is version 9.

Sounds like creating 2 separate sections and then suppressing one or the other based upon the supreport sounds like the way to go.

But i am not sure how to suppress the subsections based on the subreport suppression value.

Lady Linet you mentioned that it is possible to use a shared variable to notify the main report - could you please expand upon this ?

Many Thanks
0
 
LVL 7

Assisted Solution

by:ladylinet
ladylinet earned 500 total points
ID: 10931745
In subreport, create formula field and put something like this in it:

 Shared blnNoData As Boolean

 IF Not(Isnull(Count({Report1.ID}))) or Count({Report1.ID}) > 0 Then
  blnNoData = True
Else
 blnNoData = False
End IF

 where Report1.ID is field that you are expecting to exist

In main report create another formula on suppress, and put something like this:
 Shared blnNoData As Boolean
 If blnNoData = True Then
  formula = True '-- hide
Else
  formula = False ' -- show
End IF

HTH,
Lady Linet
 
0
 
LVL 42

Expert Comment

by:frodoman
ID: 10932332
Lady Linet's implementation is similar to what I was thinking on the first post.  Maybe a couple things you can simplify if you want though.

In the subreport you can simply use this formula in the report footer:
       OnFirstRecord and OnLastRecord and RecordNumber<>1

There's nothing wrong with LL's approach - this one is more portable and can be used on any subreport regardless of the data fields.

For the suppression formula you can simply use: bInNoData

Since this value is already true or false there's no need to run it through an if/then statement.
0
 
LVL 7

Expert Comment

by:ladylinet
ID: 10933939
Hi frodoman, are you sure that RecordNumber is working? When I've tried it, I've got 1 even for empty (main) report ...
 And for If/Then, it's just more readable for me that way.

Thanks,
Lady Linet
0
 

Author Comment

by:wilkinsg
ID: 10936967
Many thanks for all your help - i now think i can produce the report exactly as i need it.

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month10 days, 11 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question