Display Calendar Weeks in Fast Report! how?

edited 5:23PM in FastReport VCL 5
Hi,

i wonder why there is no function which returns the Calendar Week Value for a certain Date-field?

At this point id like to know how to bypass this Problem?
Id be grateful for a working code snippet for that.



Best Regards

Comments

  • edited 5:23PM
    no1 got a clue for me >?
  • PolomintPolomint Australia
    edited 5:23PM
    Could you not use Delphi's System.DateUtils.WeekOf?
  • edited March 2016
    Actually i cant since im not that experienced in Delphi it self...

    How can i use this System.DateUtils.WeekOf in a simple Memo Field???
    ... And if thats not possible, how can i do this on code side?




    For better understanding:
    I just want a certain DateTime Datafield to return a Simple Calender Week for the the current Year...

    Thats a pretty basic function needed in a lot financial/business situations... i tough that such a common thing must be available in the given functions-set of Fast Report...? This is the very last thing missing in my report and i really want to finish this D: ...
  • gpigpi
    edited 5:23PM
    See a Developer's manual https://www.fast-report.com/en/download/public_files/214/ how to create custom functions for FR
  • edited 5:23PM
    iif i were that skilled in writing my own functions yet, i would't have to ask.


    so there is no implemented function in FR for that?

  • gpigpi
    edited 5:23PM
    wrote:
    so there is no implemented function in FR for that?
    Yes, there is no such function in the FR's script
    wrote:
    iif i were that skilled in writing my own functions yet, i would't have to ask
    Try to read Developer's manual
  • edited March 2016
    Well then, here is my solution.
    I think other people may take advantage of that someday [img]style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> ... Memo Field:[/img]
    [Trunc((<frxDBDataset1."LIEFERTERMIN">-(EncodeDate(YearOf(<frxDBDataset1."LIEFERTERMIN">-(<frxDBDataset1."LIEFERTERMIN">-2) MOD 7+3),1,1)+((<frxDBDataset1."LIEFERTERMIN">-2) MOD 7-9)-1))/7)]
    
  • PolomintPolomint Australia
    edited 5:23PM
    Hmmmm. Not sure that code will produce an ISO 8601 standard value...

    Wikipedia on ISO 8601 Week Dates

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.