In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

SetFormatSettings()

FastReport for Xailer & [x]Harbour (English/Spanish)
a.ilic
Posts: 37
Joined: Fri Sep 27, 2013 1:13 am

SetFormatSettings()

Postby a.ilic » Fri Mar 07, 2014 5:58 pm

Hi,
What is alternative for SetFormatSettings() method? In Sergey version, we used this:
oFr:SetFormatSettings(frxThousandSeparator, ".")
oFr:SetFormatSettings(frxDecimalSeparator, ",")
oFr:SetFormatSettings(frxCurrencyDecimals, 2)
oFr:SetFormatSettings(frxDateSeparator, ".")
oFr:SetFormatSettings(frxShortDateFormat, "dd.mm.yy")
oFr:SetFormatSettings(frxLongDateFormat, "dd.mm.yyyy.")
oFr:SetFormatSettings(frxTimeSeparator, ":")
oFr:SetFormatSettings(frxShortTimeFormat, "hh:mm")
oFr:SetFormatSettings(frxLongTimeFormat, "hh:mm:ss")

Thanks!
Regards, AI
Aleksandar Ili?
Software developer
Wings Software
http://www.wings.rs
User avatar
ignacio
Site Admin
Posts: 8691
Joined: Mon Apr 06, 2015 8:00 pm
Location: Madrid, Spain
Contact:

SetFormatSettings()

Postby ignacio » Sat Mar 08, 2014 5:42 pm

a.ilic escribió el vie, 07 marzo 2014 17:58
Hi,
What is alternative for SetFormatSettings() method? In Sergey version, we used this:
oFr:SetFormatSettings(frxThousandSeparator, ".")
oFr:SetFormatSettings(frxDecimalSeparator, ",")
oFr:SetFormatSettings(frxCurrencyDecimals, 2)
oFr:SetFormatSettings(frxDateSeparator, ".")
oFr:SetFormatSettings(frxShortDateFormat, "dd.mm.yy")
oFr:SetFormatSettings(frxLongDateFormat, "dd.mm.yyyy.")
oFr:SetFormatSettings(frxTimeSeparator, ":")
oFr:SetFormatSettings(frxShortTimeFormat, "hh:mm")
oFr:SetFormatSettings(frxLongTimeFormat, "hh:mm:ss")

Thanks!
Regards, AI

Thre is no alternative.
Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
http://www.xailer.com
a.ilic
Posts: 37
Joined: Fri Sep 27, 2013 1:13 am

SetFormatSettings()

Postby a.ilic » Tue Mar 11, 2014 7:07 pm

ignacio wrote on Sat, 08 March 2014 17:42
Thre is no alternative.

Does this mean that we have for every date field to manually define display format? Also for currency values.
We have an option in our ERP for date format (and other field types) and that affects all reports.
Any suggestion is appreciated.
Regards
Aleksandar Ili?
Software developer
Wings Software
http://www.wings.rs
User avatar
ignacio
Site Admin
Posts: 8691
Joined: Mon Apr 06, 2015 8:00 pm
Location: Madrid, Spain
Contact:

SetFormatSettings()

Postby ignacio » Tue Mar 11, 2014 7:47 pm

a.ilic escribió el mar, 11 marzo 2014 19:07
ignacio wrote on Sat, 08 March 2014 17:42
Thre is no alternative.

Does this mean that we have for every date field to manually define display format? Also for currency values.
We have an option in our ERP for date format (and other field types) and that affects all reports.
Any suggestion is appreciated.
Regards

Hello,
Since I'm not an expert on FR I need to know how to set those settings on report design time. Of course, there should be a way to do it.
Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
http://www.xailer.com
a.ilic
Posts: 37
Joined: Fri Sep 27, 2013 1:13 am

SetFormatSettings()

Postby a.ilic » Tue Mar 11, 2014 9:13 pm

ignacio wrote on Tue, 11 March 2014 19:47
Since I'm not an expert on FR I need to know how to set those settings on report design time. Of course, there should be a way to do it.

Hello,
Sorry, I thought you are, since you're the only one who is replying to our posts
This is how it should function, at least that's how it worked in Sergey version.

  1. Put Text object on design area

  2. Right click on that object -> Display format...

  3. For category select Date/Time

  4. Set field Format string to be empty

  5. Confirm changes by clicking button Ok



When category is selected and field Format string is set to be empty, then format is taken from settings which is defined by:
oFr:SetFormatSettings(frxShortDateFormat, "dd.mm.yy")

I suppose this concept is pretty fine, but if you have some other idea, I'm ready to discuss it.
BTW, FR is able to automatically detect when Text object contains date, and then, format is taken from Regional settings (Short date format). Since it can vary from system to system, that's why it's good for format to be set.
Regards,
Aleksandar Ili?
Software developer
Wings Software
http://www.wings.rs
User avatar
ignacio
Site Admin
Posts: 8691
Joined: Mon Apr 06, 2015 8:00 pm
Location: Madrid, Spain
Contact:

SetFormatSettings()

Postby ignacio » Wed Mar 12, 2014 10:52 am

a.ilic escribió el mar, 11 marzo 2014 21:13
ignacio wrote on Tue, 11 March 2014 19:47
Since I'm not an expert on FR I need to know how to set those settings on report design time. Of course, there should be a way to do it.

Hello,
Sorry, I thought you are, since you're the only one who is replying to our posts
This is how it should function, at least that's how it worked in Sergey version.

  1. Put Text object on design area

  2. Right click on that object -> Display format...

  3. For category select Date/Time

  4. Set field Format string to be empty

  5. Confirm changes by clicking button Ok



When category is selected and field Format string is set to be empty, then format is taken from settings which is defined by:
oFr:SetFormatSettings(frxShortDateFormat, "dd.mm.yy")

I suppose this concept is pretty fine, but if you have some other idea, I'm ready to discuss it.
BTW, FR is able to automatically detect when Text object contains date, and then, format is taken from Regional settings (Short date format). Since it can vary from system to system, that's why it's good for format to be set.
Regards,

I'm an expert on connecting FR with [x]Harbour. Not in FR itself. I will do some research and keep you informed.
Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
http://www.xailer.com
User avatar
ignacio
Site Admin
Posts: 8691
Joined: Mon Apr 06, 2015 8:00 pm
Location: Madrid, Spain
Contact:

SetFormatSettings()

Postby ignacio » Wed Mar 12, 2014 2:03 pm

Done!
It will be available on next release.
Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
http://www.xailer.com
a.ilic
Posts: 37
Joined: Fri Sep 27, 2013 1:13 am

SetFormatSettings()

Postby a.ilic » Wed Mar 12, 2014 2:50 pm

ignacio wrote on Wed, 12 March 2014 14:03
Done!
It will be available on next release.

Super!
If this is can help, these are available settings which are supported in Sergey version:
*******************************************************************************
* Defines for SetFormatSettings()
*******************************************************************************
#define frxCurrencyString 1
#define frxCurrencyFormat 2
#define frxNegCurrFormat 3
#define frxThousandSeparator 4
#define frxDecimalSeparator 5
#define frxCurrencyDecimals 6
#define frxDateSeparator 7
#define frxShortDateFormat 8
#define frxLongDateFormat 9
#define frxTimeSeparator 10
#define frxTimeAMString 11
#define frxTimePMString 12
#define frxShortTimeFormat 13
#define frxLongTimeFormat 14
#define frxShortMonthNames 15
#define frxLongMonthNames 16
#define frxShortDayNames 17
#define frxLongDayNames 18
#define frxTwoDigitYearCenturyWindow 20
#define frxListSeparator 21

From documentation:
:SetFormatSettings(<nSetting>, <xValue>)

Set format settings for FastReport. <nSetting> is described in FastRepH.ch (fastrepf_h.h). <xValue> - value for setting. Currency and date/time formatting options:
The initial values of these variables are fetched from the system registry using the GetLocaleInfo function in the Win32 API. The description of each variable specifies the LOCALE_XXXX constant used to fetch the initial value.
CurrencyString - Defines the currency symbol used in floating-point to decimal conversions. The initial value is fetched from LOCALE_SCURRENCY.
CurrencyFormat - Defines the currency symbol placement and separation used in floating-point
to decimal conversions. Possible values are:
0 = '$1'
1 = '1$'
2 = '$ 1'
3 = '1 $'
The initial value is fetched from LOCALE_ICURRENCY.
NegCurrFormat - Defines the currency format for used in floating-point to decimal conversions
of negative numbers. Possible values are:
0 = '($1)' 4 = '(1$)' 8 = '-1 $' 12 = '$ -1'
1 = '-$1' 5 = '-1$' 9 = '-$ 1' 13 = '1- $'
2 = '$-1' 6 = '1-$' 10 = '1 $-' 14 = '($ 1)'
3 = '$1-' 7 = '1$-' 11 = '$ 1-' 15 = '(1 $)'
The initial value is fetched from LOCALE_INEGCURR.
ThousandSeparator - The character used to separate thousands in numbers with more than three digits to the left of the decimal separator. The initial value is fetched from LOCALE_STHOUSAND. A value of #0 indicates no thousand separator character should be output even if the format string specifies thousand separators.
DecimalSeparator - The character used to separate the integer part from the fractional part of a number. The initial value is fetched from LOCALE_SDECIMAL. DecimalSeparator must be a non-zero value.
CurrencyDecimals - The number of digits to the right of the decimal point in a currency amount.
The initial value is fetched from LOCALE_ICURRDIGITS.
DateSeparator - The character used to separate the year, month, and day parts of a date value. The initial value is fetched from LOCATE_SDATE.
ShortDateFormat - The format string used to convert a date value to a short string suitable for editing. For a complete description of date and time format strings, refer to the documentation for the FormatDate function. The short date format should only use the date separator character and the m, mm, d, dd, yy, and yyyy format specifiers. The initial value is fetched from LOCALE_SSHORTDATE.
LongDateFormat - The format string used to convert a date value to a long string suitable for display but not for editing. For a complete description of date and time format strings, refer to the documentation for the FormatDate function. The initial value is fetched from LOCALE_SLONGDATE.
TimeSeparator - The character used to separate the hour, minute, and second parts of a time value. The initial value is fetched from LOCALE_STIME.
TimeAMString - The suffix string used for time values between 00:00 and 11:59 in 12-hour clock format. The initial value is fetched from LOCALE_S1159.
TimePMString - The suffix string used for time values between 12:00 and 23:59 in 12-hour clock format. The initial value is fetched from LOCALE_S2359.
ShortTimeFormat - The format string used to convert a time value to a short string with only hours and minutes. The default value is computed from LOCALE_ITIME and LOCALE_ITLZERO.
LongTimeFormat - The format string used to convert a time value to a long string with hours, minutes, and seconds. The default value is computed from LOCALE_ITIME and LOCALE_ITLZERO.
ShortMonthNames - Array of strings containing short month names. The mmm format specifier in a format string passed to FormatDate causes a short month name to be substituted. The default values are fecthed from the LOCALE_SABBREVMONTHNAME system locale entries.
LongMonthNames - Array of strings containing long month names. The mmmm format specifier in a format string passed to FormatDate causes a long month name to be substituted. The default values are fecthed from the LOCALE_SMONTHNAME system locale entries.
ShortDayNames - Array of strings containing short day names. The ddd format specifier in a format string passed to FormatDate causes a short day name to be substituted. The default values are fecthed from the LOCALE_SABBREVDAYNAME system locale entries.
LongDayNames - Array of strings containing long day names. The dddd format specifier in a format string passed to FormatDate causes a long day name to be substituted. The default values are fecthed from the LOCALE_SDAYNAME system locale entries.
ListSeparator - The character used to separate items in a list. The initial value is fetched from LOCALE_SLIST.
TwoDigitYearCenturyWindow - Determines what century is added to two digit years when converting string dates to numeric dates. This value is subtracted from the current year before extracting the century. This can be used to extend the lifetime of existing applications that are inextricably tied to 2 digit year data entry. The best solution to Year 2000 (Y2k) issues is not to accept 2 digit years at all require 4 digit years in data entry to eliminate century ambiguities. Examples:
Current TwoDigitCenturyWindow Century StrToDate() of:
Year Value Pivot '01/01/03' '01/01/68' '01/01/50'
-------------------------------------------------------------------------
1998 0 1900 1903 1968 1950
2002 0 2000 2003 2068 2050
1998 50 (default) 1948 2003 1968 1950
2002 50 (default) 1952 2003 1968 2050
2020 50 (default) 1970 2003 2068 2050

Regards,
Aleksandar Ili?
Software developer
Wings Software
http://www.wings.rs
a.ilic
Posts: 37
Joined: Fri Sep 27, 2013 1:13 am

SetFormatSettings()

Postby a.ilic » Tue Apr 15, 2014 1:57 am

Hello,
Is there something specific with setting these four formats? If I enable any of them, application breaks on startup.
oFr:SetFormatSettings(frxCurrencyFormat, 3)
oFr:SetFormatSettings(frxNegCurrFormat, 8 )
oFr:SetFormatSettings(frxCurrencyDecimals, 2)
oFr:SetFormatSettings(frxTimeSeparator, ":")
Unrecoverable error 6005: Exception error:
Exception Code:0EEDFADE
Exception Address:75CBC41F
EAX:0028FB84 EBX:02644F10 ECX:00000007 EDX:00000000
ESI:0028FC1C EDI:00000000 EBP:0028FBD4
CS:EIP:0023:75CBC41F SS:ESP:002B:0028FB84
DS:002B ES:002B FS:0053 GS:002B
Flags:00200216
CS:EIP: C9 C2 10 00 CC CC CC CC CC 8B FF 55 8B EC 56 8B
SS:ESP: 0EEDFADE 00000001 00000000 75CBC41F 00000007 0262C842 03C3F2E0 02644
F10 0028FC1C 00000000 0028FCC8 0028FC08 0262C842 00000007 0262C842 03C3F2E0
C stack:
EIP: EBP: Frame: OldEBP, RetAddr, Params...
75CBC41F 0028FBD4 0028FCC8 0262C842 0EEDFADE 00000001 00000007 0028FBEC 02
62C842 03C3F2E0 02644F10 0028FC1C
0262C842 0028FCC8 0028FCF8 004067EC 00000006 003766B4 0050B02A 00406B28 00
00000D 003721BC 00378974 004FB810
004067EC 0028FCF8 0050B056 00427DE2 00357B7C 004FB810 0028FD2C 0043270C 00
506548 00000004 00000002 00430C8E

All other format settings seems to be ok.
Thanks in advance.
Aleksandar Ili?
Software developer
Wings Software
http://www.wings.rs
User avatar
ignacio
Site Admin
Posts: 8691
Joined: Mon Apr 06, 2015 8:00 pm
Location: Madrid, Spain
Contact:

SetFormatSettings()

Postby ignacio » Tue Apr 15, 2014 11:38 am

Hello,
Thank you for your feedback. We are going to do some research and we let you know.
Best regards
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
http://www.xailer.com
User avatar
ignacio
Site Admin
Posts: 8691
Joined: Mon Apr 06, 2015 8:00 pm
Location: Madrid, Spain
Contact:

SetFormatSettings()

Postby ignacio » Mon Apr 21, 2014 4:42 pm

Dear Sir,
:SetFormatSettings(frxTimeSeparator, ":") Is working here without problems. BTW, all the other settings are working perfectly under Xailer, so it seems the problem is only with console operations and currency format values.
The method SetFormatSettings() indeed only modifies a simple system Delphi record. So, if it fails is because on Console applications some of the record members are not present and Delphi does not track that issue correctly. I'm afraid there is not to much we can do about it but to catch the GPF.
Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
http://www.xailer.com
a.ilic
Posts: 37
Joined: Fri Sep 27, 2013 1:13 am

SetFormatSettings()

Postby a.ilic » Mon May 12, 2014 1:08 am

ignacio wrote on Mon, 21 April 2014 16:42
Dear Sir,
:SetFormatSettings(frxTimeSeparator, ":") Is working here without problems. BTW, all the other settings are working perfectly under Xailer, so it seems the problem is only with console operations and currency format values.
The method SetFormatSettings() indeed only modifies a simple system Delphi record. So, if it fails is because on Console applications some of the record members are not present and Delphi does not track that issue correctly. I'm afraid there is not to much we can do about it but to catch the GPF.
Regards,

Thank you very much for a reply. When I run the attached program, the message dialog appears with only ":" as a message.
Harbour Build Info
---------------------------
Version: Harbour 3.2.0dev (r1310312321)
Compiler: MinGW GNU C 4.6.1 (32-bit)
Platform: Windows 7 6.1.7601 Service Pack 1
PCode version: 0.3
ChangeLog last entry: 2013-11-01 01:21 UTC+0200 Mindaugas Kavaliauskas (dbtopas/
at/dbtopas.lt)
ChangeLog ID: 362f05d1391712c11b4d0cb935b0515a5e729c52
Built on: Nov 4 2013 02:42:17
Build options: (Clipper 5.3b) (Clipper 5.x undoc)
---------------------------


Attached files frxtest.prg (225 B)Â time.fr3 (1.1 KB)Â
Aleksandar Ili?
Software developer
Wings Software
http://www.wings.rs
a.ilic
Posts: 37
Joined: Fri Sep 27, 2013 1:13 am

SetFormatSettings()

Postby a.ilic » Sat May 24, 2014 12:20 am

a.ilic wrote on Mon, 12 May 2014 01:08
When I run the attached program, the message dialog appears with only ":" as a message.

This looks like some debug message.
Any update with this? If you build provided example, without Xailer framework, I suppose you'll get the same dialog box on run time.
Regards,
Aleksandar Ili?
Software developer
Wings Software
http://www.wings.rs
User avatar
ignacio
Site Admin
Posts: 8691
Joined: Mon Apr 06, 2015 8:00 pm
Location: Madrid, Spain
Contact:

SetFormatSettings()

Postby ignacio » Mon May 26, 2014 10:41 am

Hello,
Here is working fine. In case you are using the non Xailer version please review you are using the latest version. Chek on Xailer downloads.
Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
http://www.xailer.com
a.ilic
Posts: 37
Joined: Fri Sep 27, 2013 1:13 am

SetFormatSettings()

Postby a.ilic » Wed May 28, 2014 11:40 pm

ignacio wrote on Mon, 26 May 2014 10:41
Here is working fine. In case you are using the non Xailer version please review you are using the latest version. Chek on Xailer downloads.

Hello,
I've tried to build example on another machine, and the result is same - message dialog appears again.
From you answer here ( http://www.xailer.com/forum/index.php?t=msg&th=17793& ;goto=55280&#msg_55280) I understand it's pretty complicated to locate the problem, but we have to do it somehow. Almost every report has currency on it, which is formatted globally.
Regards,
Aleksandar Ili?
Software developer
Wings Software
http://www.wings.rs
User avatar
ignacio
Site Admin
Posts: 8691
Joined: Mon Apr 06, 2015 8:00 pm
Location: Madrid, Spain
Contact:

SetFormatSettings()

Postby ignacio » Thu May 29, 2014 12:48 pm

Please donwload newest version from the following link:
http://www.xailer.com/download?es&file=103
Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
http://www.xailer.com
a.ilic
Posts: 37
Joined: Fri Sep 27, 2013 1:13 am

SetFormatSettings()

Postby a.ilic » Thu May 29, 2014 11:06 pm

ignacio wrote on Thu, 29 May 2014 12:48
Please donwload newest version from the following link:
http://www.xailer.com/download?es&file=103

It's working now for time settings. But, I get this messages when it's about currency settings:
SetFormatSettings(frxCurrencyFormat, ?) not supported on console applications.
SetFormatSettings(frxNegCurrFormat, ?) not supported on console applications.
SetFormatSettings(frxCurrencyDecimals, ?) not supported on console applications.

What do you mean by this, isn't FR independent?
Regards,
Aleksandar Ili?
Software developer
Wings Software
http://www.wings.rs
User avatar
ignacio
Site Admin
Posts: 8691
Joined: Mon Apr 06, 2015 8:00 pm
Location: Madrid, Spain
Contact:

SetFormatSettings()

Postby ignacio » Fri May 30, 2014 10:05 am

a.ilic escribió el jue, 29 mayo 2014 23:06
ignacio wrote on Thu, 29 May 2014 12:48
Please donwload newest version from the following link:
http://www.xailer.com/download?es&file=103

It's working now for time settings. But, I get this messages when it's about currency settings:
SetFormatSettings(frxCurrencyFormat, ?) not supported on console applications.
SetFormatSettings(frxNegCurrFormat, ?) not supported on console applications.
SetFormatSettings(frxCurrencyDecimals, ?) not supported on console applications.

What do you mean by this, isn't FR independent?
Regards,

On this same thread:
Cita:
Dear Sir,
:SetFormatSettings(frxTimeSeparator, ":") Is working here without problems. BTW, all the other settings are working perfectly under Xailer, so it seems the problem is only with console operations and currency format values.
The method SetFormatSettings() indeed only modifies a simple system Delphi record. So, if it fails is because on Console applications some of the record members are not present and Delphi does not track that issue correctly. I'm afraid there is not to much we can do about it but to catch the GPF.
Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
http://www.xailer.com

Return to “FastReport”