Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: if a table is blank moving up the table under it Post Reply Post New Topic
Author Message
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Topic: if a table is blank moving up the table under it
     Posted: 17 Oct 2012 at 8:08am
Hello Everyone,
 
I have a report that has a text object and a date field next to it.  I have a formula that will suppress the text box if the date field is blank. Under the delivery date I have a text box and a field that lists the part number.  Is there a formula that will move the part number to where the delivery date is if there is no date?
 
In the report both of these tables are in the group header section of the report.
 
Delivery Date:  {delivery_date}   
Part No.:  {job_partnumber}
 
I hope I am making sense?  Any help would be very much appreciated.
 
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 17 Oct 2012 at 8:24am
Not really, but you could replace the date field with a formula and if the date field is blank show the part number.  You will need to convert the date field to the same data type as the part number.

example (assumes date field is null when blank):

if isnull({delivery_date}) then {job_partnumber} else totext({delivery_date})

I hope this helps.
IP IP Logged
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Posted: 17 Oct 2012 at 8:55am
 
But how do I get the part number not to print where it is currently if it prints on the delivery date? Crystal is so confusing!!
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 17 Oct 2012 at 10:52am
You can suppress it if {delivery_date} is null (right-click,format field,  click on x-2 box for suppress, put in isnull({delivery_date}).  This of course assumes that when {delivery_date} is blank it is a null value.
IP IP Logged
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Posted: 18 Oct 2012 at 2:33am
Thank you!  It works but it leaves a blank space for the spot where the part number is supposed to go, my boss wanted the report to be shorter by not using the space if not needed. 
 
Example below:
Delivery Date:  10/18/12
Part No:  abcxy                
 
Part No:  abcxy                
____________________
 
He would like it to look like this:
Part No:  abcxy                
 
Since he does not understand what goes into Crystal it seems like an easy fix to him. Confused
 
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 18 Oct 2012 at 10:01am
I do not know if you create another section for the "blank" field and just suppress the section when the field is blank would solve your issue.

I hope this makes sense.
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 22 Oct 2012 at 10:02am
create a single formula for this information in the group header, and evaluate the data.

Make the field (can grow in the report)

But in the logic, put something like

local stringvar data1:='';

if {delivery_date} is not null then
data1:=data1+'Delivery Date: ' + {delivery_date};
if data1 is not null and {job_partnumber} is not null then
data1:=data1+chr(13);
if {job_partnumber} is not null then
data1:=data1+'Part No.: ' + {job_partnumber};

data1

This should account if either value is null, not to add an extra line; I havent tested, but let me know.

Remember make the field a single line with 'CAN GROW' enabled.

Edited by comatt1 - 22 Oct 2012 at 10:07am
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