Squall_FF8 1 Posted August 29 Hey guys, I have old MS SQL 2008 and a Query (FireDAC), that returns some fields in Date format. In a Delphi application all work great, it seems FireDac takes care to visualize Date to FormatSettings. However when I open a FastReport document, it seems it convert Date to a the PC local settings (different from my changes in FormatSettings). And that is not good, because on different machines, results could look differently. I wonder, is there a way, to force Dates in FastReport to be in my desired format regardless of the PC local? A possible solution, could be if I force the Query to return the desired format, I just wonder how? Share this post Link to post
Lars Fosdal 1887 Posted August 29 https://stackoverflow.com/questions/38394002/how-to-format-date-on-ms-sql-server-2008 Share this post Link to post
Squall_FF8 1 Posted August 29 Good old Convert ... I'm wondering is there more convenient way - to set format per session, like in Oracle (you set some local settings only for "your" session). The reason is that I have tables with 20+ fields (at least 6 are in date format) and that will make huge Select statements. Share this post Link to post
Lars Fosdal 1887 Posted August 29 Can't you create a view that do the convert for you, so that you don't have to fiddle with the conversions in that SQL? Share this post Link to post
weirdo12 28 Posted August 29 (edited) Add a BeforePrint handler to the memo control. Make sure that you clear the DataField and DataSet properties of the memo control or BeforePrint won't have any effect.. procedure Memo13OnBeforePrint(Sender: TfrxComponent); begin TfrxMemoView(Sender).Text := FormatDateTime('yyyy-mm-dd', <Ticket."ticket_date">); end; No formatting: With the BeforePrint: Edited August 29 by weirdo12 1 Share this post Link to post
Squall_FF8 1 Posted August 29 (edited) @weirdo12 Great example and practical illustration!!! May we adapt it, if the text is in RichView (instead of Memo) and it is more complicated, like: xxxxx [Ticket."ticket_date"] xxxxxx Edited August 29 by Squall_FF8 Share this post Link to post
weirdo12 28 Posted August 29 8 minutes ago, Squall_FF8 said: May we adapt it, if the text is in RichView (instead of Memo) and it is more complicated, like: xxxxx [Ticket."ticket_date"] xxxxxx If you double-click the RichView component is there a Format tab? If so, look in expressions and pick your date/time column and set the format string there. If the RichView contains multiple columns, each one will be listed in Expressions. Share this post Link to post
Squall_FF8 1 Posted September 3 On 8/29/2025 at 7:11 PM, weirdo12 said: If you double-click the RichView component is there a Format tab? Not in RichText: Share this post Link to post
weirdo12 28 Posted Thursday at 06:48 PM (edited) Try adding a variable. I included a bunch of screen shots because it's not exactly obvious that you have to create a new Category before you can create a variable. Then add a Category: Select the Category and click Variable and assign it a value: Close Edit Variables. Now you *should* be able to drop that variable into the Rich Edit control. Edited Thursday at 09:23 PM by weirdo12 1 Share this post Link to post
Squall_FF8 1 Posted 8 minutes ago Wow it worked! Thank you VERY MUCH, @weirdo12 !!!! I had never created variables in FR itself (just trough Delphi code). That is a very neat trick! Thank you for taking time for the screenshots and step by step how to do it! Share this post Link to post