Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Dynamically Moving Report Objects if SubReport Suppressed

Posted on 2004-04-23
9
Medium Priority
?
716 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
Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

 
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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

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 …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

618 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