Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: How to hide selected column if null data Post Reply Post New Topic
Author Message
cloud45
Newbie
Newbie
Avatar

Joined: 14 Mar 2011
Online Status: Offline
Posts: 4
Quote cloud45 Replybullet Topic: How to hide selected column if null data
     Posted: 14 Mar 2011 at 3:24pm
Hi guys, just want to ask on how to hide the column if the data is null or empty? Actually I already know to hide the column but I wanted to auto adjust the next column to the position after the column that was hide. Appreciate your help guys please...Please see the image below.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 15 Mar 2011 at 3:07am
you would need to adjust the x coordinate by the correct amount for every column in all bands.  adjustments would be in twips and is relative to the initial position of the column, so if you want to move the column 1 inch to the left, it would be a change -1440.  if there are multiple columns that are to be adjusted for, you would need to know when to adjust by the additional space, unless they are all next to each other.
 
HTH
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 15 Mar 2011 at 3:55am
Originally posted by lockwelle

you would need to adjust the x coordinate by the correct amount for every column in all bands.  adjustments would be in twips and is relative to the initial position of the column, so if you want to move the column 1 inch to the left, it would be a change -1440.  if there are multiple columns that are to be adjusted for, you would need to know when to adjust by the additional space, unless they are all next to each other.
 

HTH


Would this be done during run-time? Or during the design stage? If so, how might one dynamically re-size columns based on the data read?

Edited by Keikoku - 15 Mar 2011 at 3:56am
IP IP Logged
cloud45
Newbie
Newbie
Avatar

Joined: 14 Mar 2011
Online Status: Offline
Posts: 4
Quote cloud45 Replybullet Posted: 15 Mar 2011 at 1:24pm
Originally posted by lockwelle

you would need to adjust the x coordinate by the correct amount for every column in all bands.  adjustments would be in twips and is relative to the initial position of the column, so if you want to move the column 1 inch to the left, it would be a change -1440.  if there are multiple columns that are to be adjusted for, you would need to know when to adjust by the additional space, unless they are all next to each other.
 
HTH


Hi sir, thank you for your reply. If I'm going to adjust the x coordinate, would you give us instruction or step by step procedure so that I could adjust the columns or multiple columns left?How would I do that?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 16 Mar 2011 at 3:14am

you would need to know which columns are empty.  knowing that you would tell you how much need to shift and when, then you take the measurement in the width of the object and multiply by 1440.  Moving left is negative and right is positive.

I found using a function helped in making it easier to compute where what was going.  You will have to play, as I did.  The only report that I did like this was over 3 years ago and not currently being used...probably lost.
 
As to dynamically resizing, I would guess that you would put your logic in the x-2 button for size, using the same logic for sizing (multiplying by +/- 1440)
 
HTH
IP IP Logged
cloud45
Newbie
Newbie
Avatar

Joined: 14 Mar 2011
Online Status: Offline
Posts: 4
Quote cloud45 Replybullet Posted: 16 Mar 2011 at 2:14pm
Can I do what you've been instructed? because i didn't understand exactly what to do. I'm using Crystal Report Seagate 8.5. Perhaps if you can give me a screenshot on how to do, that would be better. I just want to know how to move the other columns after the selected columns if null or empty in positioning.Thank you for usual reply and I appreciate that.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 17 Mar 2011 at 3:09am
sorry, didn't know it was for 8.5...the ability to move a column didn't arrive until XI.  I don't believe that you have this ability.
 
if you right click on an object on the report, if you have the option for Size and Position, then you can, if not you can't.
IP IP Logged
cloud45
Newbie
Newbie
Avatar

Joined: 14 Mar 2011
Online Status: Offline
Posts: 4
Quote cloud45 Replybullet Posted: 17 Mar 2011 at 6:25pm
Hi sir, I upgrade my crystal report to XI. Would you please give us screenshot on how to make a logic formula to Size and Position so that I can move the mutiple columns if ever there were columns that were hide. Thanks in advance.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 18 Mar 2011 at 2:41am
Sorry, I don't take screen shots.
 
To hide a column, you would use the Format Field for an object, and click on in the button 'x-2' to the right of Suppress, you would enter the formula/logic that would cause that the object to not be shown.
 
For moving the object (columns) you would right click on the object, select Size and Position, and in the 'x-2' button define the logic to move the column in the direction that you want, and be the amount...
 
How to check if a column is empty? I don't know off-hand...my first thought would be to put logic in the record selection formula to check if the column is empty, Iam guessing that you can do this, but I don't know as I haven't had to do it myself.  I am guessing that you would need to keep track of which columns are to be suppressed and how big those columns are. then when you are displaying the report you would need to hide those columns(maybe, maybe not, as they are empty, I am guessing you could write over them, but I may be mistaken) and to move the non-hidden columns by the correct amount. 
 
Yes there is a lot of trial and error and figuring out how to do it.  It has been over 3 years since I did a report like this, and then it was just a proof of concept, and was never put into production.  The most important thing to remember in moving an object is that 1440 equal 1 inch, and that it is relative to where you placed the field to begin with.
 
Good luck
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum