Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] how to detect regional list separator via javascript to fix CSV formats

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] how to detect regional list separator via javascript to fix CSV formats
 Login/Join
 
Platinum Member
posted
Hi All

We permit users to export reports as CSV. If your regional settings are in english, everything works fine.. click on the file and it opens in excel.

If your regional settings are in french (as many of our users are), then excel does not automatically open. The problem is that the regional setting is set to a semicolon as the list separator instead of a comma.

Obviously, in excel the user can import the file and indicate the delimiter... but we want to avoid that step for him.

So we need the following to happen.

- detect user's regional setting
- if comma separator then normal format comt export
- if semi colon then we will create a format alpha file with semi colons between the fields and call it .csv (unless there is a way in webfocus to set the list separator in comt).

In either case, we need to determine the regional setting. I found some javascript but unfortunately it only works in IE, which I guess is not surprising.

var list = ["a", "b"];
var listSeparator = list.toLocaleString().substring(1, 2);
alert(listSeparator);

I changed my settings and that gives me a semi colon in IE but a comma in chrome and FF.

Does anyone have any ideas as to how to detect the regional settings in ff and chrome? I am thinking it is a security issue and will not be possible.

Thanks

Jodye

This message has been edited. Last edited by: <Kathryn Henning>,


WF 8.0.0.5M
 
Posts: 246 | Location: Montreal, QC, Canada | Registered: October 01, 2003Report This Post
Virtuoso
posted Hide Post
You can define the deliminator when you create the file in WF. It is just a delimited file.

Do this at the WF server level. You may have to the WF_Language parameter to the server. I can't remember if the WF local parameter is actually called WF_Language, but I'm pretty sure you can find that easily enough.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Virtuoso
posted Hide Post
Please have a look at this .

It suggests to expose HTTP_ACCEPT_LANGUAGE as a variable via WebFOCUS Client's site.wfs

Once you get the configuration right, you .fex can "see" &HTTP_ACCEPT_LANGUAGE and somehow determine whether English or French is used and it's all all Dialogue Manager/WebFOCUS fron that point on Smiler



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
You may start with adding the following under WebFOCUS Administration Console / Configuration / Custom Settings:

<SET>HTTP_ACCEPT_LANGUAGE(pass)


Then, in a .fex look for &HTTP_ACCEPT_LANGUAGE. This is what I got when running on my PC:

-TYPE &HHTP_ACCEPT_LANGUAGE


Result:
en-US



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Platinum Member
posted Hide Post
Hi Guys

Thanks for the answers.

Unfortunately that won't help. We already know what language they want. Our portal is completely bilingual.

The problem is that the language used to browse the portal is not necessarily the same as the language of the regional settings or the OS. It happens all the time. A user has english settings but is browsing the portal in french.

Ideally, we really need access to the regional settings. I think it is impossible though for ff and chrome. Maybe we need to ask the user "hey what do you want to use as your csv separator?"

:-)

Thanks

Jodye


WF 8.0.0.5M
 
Posts: 246 | Location: Montreal, QC, Canada | Registered: October 01, 2003Report This Post
Virtuoso
posted Hide Post
Look here


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Expert
posted Hide Post
yeah, use a multi-drill, on whatever link it is that you allow them to click on.
'do you want your csv with commas' and 'or with semicolons?'
and then use instead of PCHOLD FORMAT COMMA
use FORMAT DFIX with the DELIMITER defined as whichever.
'regular' or 'extra crispy'...




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
quote:
'extra crispy'

I like that Smiler



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] how to detect regional list separator via javascript to fix CSV formats

Copyright © 1996-2020 Information Builders