Solved

Dynamically Moving Report Objects if SubReport Suppressed

Posted on 2004-04-23
9
683 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
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 42

Accepted Solution

by:
frodoman earned 225 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 100

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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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 125 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Combine and display field 5 72
Insert timestamp data field of max summary 8 38
Crystal Reports - Trim Data 7 39
Pull date to Group header 6 25
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. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

929 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now