Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Fast Report: Converting Data Values in a Report


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 8 - Last Post: Apr 18, 2018 7:49 AM Last Post By: Paul Gursky
Expreso Brio

Posts: 4
Registered: 4/22/18
Fast Report: Converting Data Values in a Report  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 22, 2018 5:16 AM
Hello Community!

I need some help in a report that is created in an Time Attendance Software..

The Thing is that when i generate my report, the report in fact shows me the values of the hours in numbers and when i try to force a convertion of values (hh:mm:ss) the values of for example: 00:45:15 (45 minutes 15 seconds) it is display like 12:45:15 (12 hours 45 minutes 15 seconds).

With this topic i post the datas i need to convert to the format hh:mm:ss and the places where the report designer let me modify some values...

I never used delphi and i dont know how to use it... if you can help me solved this issue i will be much apreciate it because i need it in a rush!!

Thanks in advice!.

https://vgy.me/Kpj7Fb.jpg

https://vgy.me/ykH5TB.jpg

https://vgy.me/OMSIVQ.jpg

Edited by: Expreso Brio on Mar 22, 2018 5:17 AM
Paul Gursky

Posts: 13
Registered: 7/6/11
Re: Fast Report: Converting Data Values in a Report  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 24, 2018 1:07 AM   in response to: Expreso Brio in response to: Expreso Brio
It seems your OVerTime field stores data as float instead of TDateTime
Attach your report template (frf) and data for report's preparing in the xls, dbf, csv or mdb format here
Expreso Brio

Posts: 4
Registered: 4/22/18
Re: Fast Report: Converting Data Values in a Report  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 26, 2018 4:16 AM   in response to: Paul Gursky in response to: Paul Gursky
Here i attach the mdb file of my database and the report. http://www.mediafire.com/file/e489oveilhml4df/DB.zip

I hope you can help me!!!

Thanks!

Edited by: Expreso Brio on Mar 26, 2018 4:16 AM
Expreso Brio

Posts: 4
Registered: 4/22/18
Re: Fast Report: Converting Data Values in a Report  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 4, 2018 4:24 AM   in response to: Expreso Brio in response to: Expreso Brio
Someone could figure it some solution for my issue???

Im still wanting some help
Charles Tyson

Posts: 4
Registered: 2/4/05
Re: Fast Report: Converting Data Values in a Report  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 4, 2018 11:29 AM   in response to: Expreso Brio in response to: Expreso Brio
Expreso Brio wrote:
Someone could figure it some solution for my issue???

Im still wanting some help

I'm guessing that you have an accumulated overtime amount in a float variable (where 1.0 = 24 hours), and want to display it in an hours-minutes-seconds format? The problem with FormatDateTime is that it's oriented toward displaying a clock time, not to showing durations. Here's an off-the-cuff Fastreport function which might help--it would be placed on the FR "Code" tab:


function formatelapsed(somex: extended): string;
var tt, h1, m1, s1: integer;
    ms, ss: string;                                                    
begin
  ms:='';
  ss:='';                  
  // convert datetime elapsed value to integer seconds...is round() better than trunc() for this?                                                                                                                                                                                            
  tt := round(somex * 24 * 60 * 60);
  // how many hours in tt?                                                         
  h1 := trunc(tt/3600);
  tt := tt - (h1 * 3600);
  // how many minutes in remaining part of tt?                                                                                                           
  m1 := trunc(tt/60);
  // remainder should be seconds in tt                                                                               
  s1 := tt - (m1 * 60);
  // pad minutes & seconds with leading zero if they're only one digit                                                                                                                                                           
  if m1<10 then ms:='0';
  if s1<10 then ss:='0';
  result := inttostr(h1) + ':' + ms + inttostr(m1) + ':' + ss + inttostr(s1);                                                                                                                 
end;
 


On the FR "Page", you call this function in a text object: [formatelapsed( YourOvertimeVariable )]. For instance, if your Overtime is 5.15075, the value displayed is 123:37:05.

Please don't assume the conversion function is perfect, I tested it only enough to get it to compile. And if my interpretation of your problem is totally off the mark, just ignore!
Paul Gursky

Posts: 13
Registered: 7/6/11
Re: Fast Report: Converting Data Values in a Report  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 9, 2018 5:57 AM   in response to: Expreso Brio in response to: Expreso Brio
Expreso Brio wrote:
Someone could figure it some solution for my issue???

Im still wanting some help
Modify this test project http://www.mediafire.com/file/m2qxu1t653uw6my/test.7z to show your problem and send it to support@fast-report.com
Expreso Brio

Posts: 4
Registered: 4/22/18
Re: Fast Report: Converting Data Values in a Report  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 12, 2018 12:15 PM   in response to: Expreso Brio in response to: Expreso Brio
Sorry but i dont know how to open that file you give me... I just have a report designer i dont codify the report... How can i run the files you give me??

Sorry but i m new with this kind of program...
Paul Gursky

Posts: 13
Registered: 7/6/11
Re: Fast Report: Converting Data Values in a Report  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 15, 2018 8:07 AM   in response to: Expreso Brio in response to: Expreso Brio
Expreso Brio wrote:
Sorry but i dont know how to open that file you give me... I just have a report designer i dont codify the report... How can i run the files you give me??

Sorry but i m new with this kind of program...
If you are not a programmer - try to contact Time Attendance Software developers. Them may contact support@fast-report if this is necessary
Paul Gursky

Posts: 13
Registered: 7/6/11
Re: Fast Report: Converting Data Values in a Report  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 18, 2018 7:49 AM   in response to: Expreso Brio in response to: Expreso Brio
Expreso Brio wrote:
Sorry but i dont know how to open that file you give me... I just have a report designer i dont codify the report... How can i run the files you give me??

Sorry but i m new with this kind of program...
Did you try a function from Charles Tyson?
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02