简体   繁体   中英

Crystal Reports 2008 - use detail data in footer

I have a report that I am trying to get the difference between two datetime variables of a change log.

The start datetime is just the first field in the details section, so I am just using Minimum to get that.

For the end datetime, I can't do Maximum because the last record is usually after the case is closed (an email survey is sent out a week later). So I have a running total that only counts if the word "Closed is found on the line.

I then have a function that says if the running total=1 then put that datetime into a variable (F1) (I've tried local, shared and global). This works when I put the formula in the detail section. Only the first line that has Closed in it has the datetime stamp before it.

The issue is that when I try to use this variable in the group footer, the field is blank. I'm not understanding why the variable clears out and how to get it to stay there. Please help!!

F1:

datetimevar endts;

if {#RTotal0}=1 then
endts:={@datetime};

F2 (Used in group footer)

datetimevar endts;
endts;

I was able to reproduce this using a similar query. You just need to force Crystal Reports to evaluate your function, so in your F2 function, add WhilePrintingRecords; to the first line, like this:

WhilePrintingRecords;
datetimevar endts;
endts;

This should force the report to evaluate the formula as it prints each grouping.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM