Solved

Dynamic Hiding

Posted on 2011-02-18
13
287 Views
Last Modified: 2012-05-11
How can we hide columns in Crystal without any white spaces? Is there any auto fit width of fields option in Crystal? Conditional suppression will leave some white space.  
I want to hide some fields based on the user prompt response and dynamically move the fields to the left or right side and adjust the layout
eg:-
I have 10 fields.  I want to hide field 3, 5, 7 if the user input some value in the <? Hide Fields> prompt.  The 4th, 6th and 8th field should automatically adjust/align without any whitespaces.

Thanks!
0
Comment
Question by:Shamanth
  • 3
  • 3
  • 2
  • +2
13 Comments
 
LVL 26

Assisted Solution

by:Kurt Reinhardt
Kurt Reinhardt earned 150 total points
ID: 34926503
This might work:

1)  Create an empty report with nothing but parameters
2)  In the Report Header create a subreport with all 8 columns
3)  In a second Report Header section create a subreport minus the 3, 5 and 7 columns just like you want
4)  Link the subreports to the main report based on the data-driven parameters
5)  Conditionally suppress BOTH the subreport objects AND the section in which they reside based on the {?Hide Fields> prompt

To the end user, the report will be exactly what you want to see.  You don't have to worry about returning the data twice, because the hidden subreport will never actually run if you've suppressed both it and the section properly.

~Kurt
0
 
LVL 77

Accepted Solution

by:
peter57r earned 250 total points
ID: 34926553
There isn't any feature in CR which will let you move fields around horizontally.
You can maybe use a series of formula fields in fixed positions and work out what goes in each position.

Alternatively, it sounds like you could simply use two detail lines, one defined  with all fields and another with some fields not present and then use a conditional suppression rule to suppress one or the other detail line based on the parameter value.
0
 

Author Comment

by:Shamanth
ID: 34926632
Thanks rhinok. I will try your approach.

Peter, How do two detail sections help me here. I am not clear.

Is there anyway to shrink the field widh based on a formula/parameter. I see 'Can Grow' option. but it is not doing what i am looking for...
0
 
LVL 26

Expert Comment

by:Kurt Reinhardt
ID: 34926651
lol - I had to make things much too complicated - couldn't see the forest through the trees...

Peter's approach is better - same concepjt - just create multiple sections and suppress one when the other is displayed....

~Kurt
0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 100 total points
ID: 34926654
Agree, there is no way inherent in Crystal to move fields horizontally to cover white space.

I built a report that had 7 detail sections and based on the data, the correct section was displayed.
It also had similar group sections for headings and footers for summaries.

Suppression was done based on the data in each record.
It would be easy to do it based on a parameter

mlmcc
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 77

Expert Comment

by:peter57r
ID: 34927815
If you create two detail sections then they can have completely different layouts even though they show some or all of the same fields.
Then in the Section expert you use the conditional suppression button for each detail section and for one you say something like :

{?HideFields} = "Yes"

which will suppress this detail section when the parameter has the value Yes
and in the conditional suppression button for the other detail section you use the opposite condition..

{?HideFields} <> "Yes"
0
 

Author Comment

by:Shamanth
ID: 34928347
I agree. Peter's approach is much simpler. Thanks everyone for tall the inputs
0
 

Author Comment

by:Shamanth
ID: 34928375
Thanks
0
 
LVL 26

Expert Comment

by:Kurt Reinhardt
ID: 34928509
I would say accept Peter's comment as the solution, not your own.  Other than that, I'm good.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 34943843
COmment being accepted is not part of the solution but simply asker saying thanks
Use this as the solution

peter57r's comment #34926553 (250 points) as the solution and rhinok's comment #34926503 (150 points),  and mlmcc's comment #34926654 (100 points) as the assisted solutions

mlmcc
0
 
LVL 1

Expert Comment

by:Vee_Mod
ID: 34986434
All,
 
Following an 'Objection' by mlmcc (at http://www.experts-exchange.com/Q_26836410.html) to the intended closure of this question, it has been reviewed by at least one Moderator and is being closed as recommended by the Expert.
 
At this point I am going to re-start the auto-close procedure.
 
Thank you,
 
Vee_Mod
Community Support Moderator
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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. …
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

13 Experts available now in Live!

Get 1:1 Help Now