Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Object positionings

Status
Not open for further replies.

DerbyNeal

Programmer
May 12, 2005
22
0
0
GB
Hi,

In my Crystal Report (v8), I have a Time-Line running horizontally across the Page Header to determine a 24 Hour Period.

The Time-Line is used to express the duration of a vehicle trip (there could be several trips by the same vehicle within the 24 Hour frame).

I need a vary-length (width and depth) Text Objects to be displayed according to two Database Field values (Start Time & End Time).

How do I display the field (and text within) within the appropriate Time-Line positions?

Note: There may be several horizontally-adjacent fields needed to be displayed, as the vehicle could be required at various intervals.

i.e.
0600-1230
1230-1515
1800-2100

Below is a basic example where 1,2 & 3 are detail output for each trip number:

Page Header
0600 0900 1200 1500 1800 2100 2400 0300 0600
______________________________________________________

Detail
0600 - 12-30 - 1515 1800 - 2100
11111111111111122222222 3333333333

Any ideas?

Neal
 
You seem to be wanting to code a graph. Crystal has its own graph software, at least Crystal 8.5 has. Why not see if something there is suitable?

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
If none of the standard graph functions are useful, what you could do is a series of one-character formula fields. Use field suppression, based on the time. Tedious, but you can use cut-and-paste to copy fields to another Crystal report, change their name there and copy back. (This too assumes Crystal 8.5 methods work for Crystal 8.)

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I recall lbass contributing to a post last year along a similar line. Fortunately it is still in my list of replies.

If I may quote:
------------------------------
lbass (TechnicalUser) 18 May 05 13:12
You could write a formula like:

if next({@score})-{@score} = 20 then
totext({@score},0,"") + replicatestring(chr(13),2) else
if next({@score})-{@score} = 40 then
totext({@score},0,"") + replicatestring(chr(13),4) else
if next({@score})-{@score} = 60 then
totext({@score},0,"") + replicatestring(chr(13),6) else//etc.

Then you would need to format the formula to "can grow".

-LB
------------------------------

You could use this theory along with a comparison to datetime to set the width and positioning of any times along the dateline. You could also then set out your own style of construction grouping the times to half hourly or quarter hourly periods based on the comparison to the formula - e.g. if datetime({@x}) = x then {@formulax} where the formula is a variation of length and positioning suited to your needs - You can set the position based on the varying formulas and your formating within the formulae.

Phew - think that makes sense...lol - So used to thinking in reverse logic & circles...

This would be most suited to an environment where either - you are always looking at the previous set period (last 24 hours or previous day etc) as you can then set out the aesthetic design of the report in a suitable manner.

Hope it helps - Any clarification please post.

Good luck

J


 
Perhaps more specifically to clarify the above -

e.g. if MINIMUM(datetime({@x})) IN x then {@formulax} where the formula is a variation of length and positioning suited to your needs

And similar for maximum - Sorry just wanted to prevent a question before it was asked.

J
 
Thanks guys,

Just one more thing,
How do I determine the 'x' positioning of a field?

If, for example, my base(starting position) for field 1 is 4.010cm how do I determine the twips equivalent for the Top/Left position, as well as the field width in twips?

Thanks,

Neal
 
By placement of the field in the report designer.

Literally place each of these fields on top of eother and left aligned - then they each have the same styarting point.

J
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top