diff options
author | Jean-Pierre Ledure <jp@ledure.be> | 2015-12-12 15:22:06 +0100 |
---|---|---|
committer | Jean-Pierre Ledure <jp@ledure.be> | 2015-12-12 15:22:06 +0100 |
commit | c2b2e698666ab51c346087b69a119a3b2026f23c (patch) | |
tree | 549485440d2985e070d6452545102523ee56a12c | |
parent | 8045b87609409c944e3e89e7e11c00822a214512 (diff) |
Access2Base - Add default FilterOptions string in Calc export to csv
Design choices:
Sseparator = comma except if decimal point is comma in locale setting, then semi-colon
Character set = Unicode (UFT-8)
Change-Id: I11eb88bf44cedaddfb52d3570f427d9e0d26b4cc
-rw-r--r-- | wizards/source/access2base/Database.xba | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/wizards/source/access2base/Database.xba b/wizards/source/access2base/Database.xba index 2398de89fd5f..52aafa0cafa5 100644 --- a/wizards/source/access2base/Database.xba +++ b/wizards/source/access2base/Database.xba @@ -1010,6 +1010,23 @@ Error_Function: End Function ' DFunction V1.1.0 REM ----------------------------------------------------------------------------------------------------------------------- +Private Function _FilterOptionsDefault() As String +' Return the default FilterOptions string for table/query export to csv + +Dim sFieldSeparator as string +Const cstComma = "," +Const cstTextDelimitor = """" +Const cstCharacterSet = 76 ' Unicode (UTF-8) + + If _DecimalPoint() = "," Then sFieldSeparator = ";" Else sFieldSeparator = cstComma + _FilteroptionsDefault = Trim(Str(Asc(sFieldSeparator))) _ + & cstComma & Trim(Str(Asc(cstTextDelimitor))) _ + & cstComma & Trim(Str(cstCharacterSet)) _ + & cstComma & "1" + +End Function ' _FilterOptionsDefault V1.4.0 + +REM ----------------------------------------------------------------------------------------------------------------------- Public Function _hasRecordset(ByVal psName As String) As Boolean ' Return True if psName if in the collection of Recordsets @@ -1282,6 +1299,7 @@ End Function ' _OutputStringToHTML V1.4.0 REM ----------------------------------------------------------------------------------------------------------------------- Private Function _OutputToCalc(poData As Object, ByVal psOutputFile As String, psFilter As String) As Boolean ' https://wiki.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Database_Import +' https://wiki.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options Dim oCalcDoc As Object, oSheet As Object, vWin As Variant Dim vImportDesc() As Variant, iSource As Integer @@ -1332,6 +1350,7 @@ Dim oRange As Object, i As Integer, iCol As Integer, oColumns As Object oCalcDoc.storeAsUrl(psOutputFile, Array( _ _MakePropertyValue("FilterName", psFilter) _ + , _MakePropertyValue("FilterOptions", _FilterOptionsDefault()) _ , _MakePropertyValue("Overwrite", True) _ )) oCalcDoc.close(False) |