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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show detail from spec detailline in footer

Status
Not open for further replies.

bascy

Programmer
Mar 6, 2001
53
NL
Hello,

Im using a table with multiple textlines, grouped by a reportnumber. I would like to extract the starttime (which is always in one of the textlines of a report) and show it in the groupfooter. Anybody know how?

Example:

Records:
[tt]
Rprt Line text
1002 1 This is the firstline
1002 2 This is the second line
1002 3 This is line with starttime: 21:04
1002 4 This is line with endtime: 22:56
1002 5 This is the last line
[/tt]

Report:
[tt]
Reportnumber: 1002 Start: 21:04 End: 22:56
[/tt]

Bascy
Network manager at
 
You could do a running total that found the MIN values for the string, but only when it has starttime in it. Then you'd need to extract the time from the string - easily done using MID if the format is always the same. A bit harder if it varies, you might use SPLIT to separate the words.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Create a formula like this:

if instr({table.text},"starttime") > 0 then
"Start: "+right({table.text},5)

Insert a maximum on this formula at the group level.

-LB
 
Thanks for the suggestions!

I'm having a partial success with another way of solving this, and i don't understand why it's only partial!

I'v defined 2 formula fields for startime:

Starttime:
Code:
whileprintingrecords;
if (Instr({v_log_form_line.log_f_text}, 'startime') > 0) then
timevar TTijdbinnen := CTime( val(Mid({v_log_form_line.log_f_text}, 23, 2)), val(Mid({v_log_form_line.log_f_text}, 26, 2)), 0);

PrintStarttime:
Code:
whileprintingrecords;
timevar TTijdbinnen;

Starttime is in the detail-section, PrintStarttime is in the footer-section.


This works like a charm!!
So i defined another two formulas for the endtime

Endtime:
Code:
whileprintingrecords;
if (Instr({v_log_form_line.log_f_text}, 'endtime') > 0) then
(timevar TTijdbuiten := CTime( val(Mid({v_log_form_line.log_f_text}, 23, 2)), val(Mid({v_log_form_line.log_f_text}, 26, 2)), 0);)

PrintEndtime:
Code:
whileprintingrecords;
timevar TTijdbuiten;

(It all looks the same, doesnt it!)
This is what happens: The endtime is calculated correctly when the line contains the text "endtime" ... but the endtime is set to 0:00:00 when the line doesnt contain "endtime"

What is going wrong?????????


Bascy
Network manager at
 
Using variables with "whileprintingrecords" slows the report, so my suggestion is better in that sense. If you wanted your end variable to work though, try adding the following to your initial formula:

else TTijdbuiten := TTijdbuiten;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top