Faceți căutări pe acest blog

Se încarcă...

luni, 21 noiembrie 2016

IMport from OpenOffice / LibreOffice for VFP6

Version compatible with VFP6

Description
A single unfied function to import data from tables contained in OpenOffice / LibreOffice documents (Calc's ods, Impress' odp and Writer's odt)

The signature is the same used for ImportFromOoCalc https://www.foxite.com/archives/import-from-calc-ooffice-0000439109.htm

The data are extracted directly from the document.
No automation, no ODBC are used.

Features
- return the name of the generated DBF / cursor; the same name with de ods,odp,odt / SYS(2015)
- analyze the first (imported) row of the ods,odp,odt table and get the number of columns and data types from this row
- creates a DBF / cursor (according to the sixth parameter)
- and populate this DBF with data from the ods,odp,odt
- when parameter lnHeader between 1 and lnStartRows the field names are taken from that row of the table, otherwise the fields are named mField1,mField2 and so on
- a field is considered of type date, if CTOD() is not empty; SET DATE must be set properly, to import the date and datetime values
- the decimal separator is taken from SET POINT TO
- a field is considered of type number, if contains only digits, and no more than a decimal separator, and no more than one + or - (either one +, either one -) in the leftmost position
- the size and precision of the numeric field is calculated with MAX(LEN(ALLTRIM(cell value))), respectively with MAX(LEN(ALLTRIM(cell value))-AT(decimal separator,ALLTRIM(cell value))
- a field is considered logical if the cell contains "true" or "false"
- the length of character fields is MAX(LEN(cell value))
- if MAX(LEN(cell value)) > 254 or contains at least one CHR(13), the field is MEMO

Download link
importoofice6 1.0

Export to xlsx

Versions for VFP 6.0
Both for class (BRAND NEW) and procedure (improved version)

1) Class exportxlsx
a) Small correction in method TheFirstTime
b) New properties
    LangId
        Public
        Character (can be EN, RO,etc.)
        Default En
    aErrMess[7]
        Public
        Error messages
c) New method
    langSet
        Public
        Set the contents of aErrMess property

2) class propxlsx

a) New properties
    LangId
        Public
        Character (can be EN, RO,etc.)
        Default En
b) New method
    langSet
        Public
        Set the caption of various objects

Description
Export the data displayed in a grid, or the data contained by a table / cursor

Properties:
a) To export the data displayed in a grid (only the visible columns)
    Drop an instance of the exportxlsx class to your form and set :
    - grid=grid reference
    - label (optional)=the default file name; a reference to an object with the "caption" property; by default DATETIME()


b) To export the data contained in a table / cursor
    Drop an instance of the exportxlsx class to your form and set :
    - grid=table / cursor name
    - label (optional)=the default file name; a reference an object with the "caption" property; by default DATETIME()
    - cFields (optional)= list of fields to be displayed, separated by commas; by default all the fields are exported
    - cHeaders (optional)= list of field headers to be displayed, separated by commas; by default the field names


c) Formatting properties (right click)
    headbackcolor=back color for column headers (if >=0)
    headfontbold= .T./.F.
    headfontitalic= .T./.F.
    headfontname=if not empty and installed
    headfontsize=if>0
    headforecolor=font color for column headers (if >=0)

    rowbackcolor=back color for rows (if >=0)
    rowfontbold= .T./.F.
    rowfontitalic= .T./.F.
    rowfontname=if not empty and installed
    rowfontsize=if>0
    rowforecolor=font color for rows (if >=0)
    lMemoAsComment    optional When passed as .T., memo fields are converted into memo while the cell contains the word "memo"

d) Miscelaneous
    a) SheetName
        character (default sheet1)
        public
        desired sheetname
    b) sheetFirstCol
        character (default A)
        public
        start column
    c) sheetFirstRow
        numeric (default 1)
        public
        start row
    d) lastcol
        character (XFD)
        public
        last valid column (maximum column / sheet)
    e) lastrow
        numeric (1048576)
        public
        last valid row (maximum number of rows / sheet)
    f) autocolw
        logical (default .F.)
        public
        .T. columns width are evaluated based on font size and the data type (the autosize feature)
    g) nCodePage
        numeric (default 0)
        public
        support for codpages for strings
        acceptable values: 437,620,737,850,852,857,861,865,866,874,895,932,936,949,950,1250,1251,1252,1253,1254,1255,1256 (see VFP help)
    h) lOpen
        logical (default .F.)
        public
        when .T. the document is open
    i) LangId
        Character (can be EN, RO,etc.)
        Public
        Default En
    j) aErrMess[7]
        Character array
        Public
        Error messages


support for more than 702 columns
stop the export after the row 1048576 and the column XFD
rows height depend on the font size
when memo columns are present, the row height depends on the number of CR (increase the row height according to the number of memo rows)
Comments boxes height and width are variable

Download link
dbf2xlsx 3.4 (VFP9 procedure)
dbf2xlsx6 2.1 (VFP6 procedure)

exportxlsx 3.0 (VFP9 class)
exportxlsx6 1.0 (VFP6 class)

Export to Pptx

Versions for VFP 6.0
Both for class (BRAND NEW) and procedure (improved version)

1) Class exportpptx
a) Small correction in method TheFirstTime
b) New properties
    LangId
        Public
        Character (can be EN, RO,etc.)
        Default En
    aErrMess[7]
        Public
        Error messages
c) New method
    langSet
        Public
        Set the contents of aErrMess property

2) class proppptx
a) New properties
    LangId
        Public
        Character (can be EN, RO,etc.)
        Default En
b) New method
    langSet
        Public
        Set the caption of various objects


Description
Export the data displayed in a grid, or the data contained by a table / cursor

Properties:
a) To export the data displayed in a grid (only the visible columns)
    Drop an instance of the exportpptx class to your form and set :
    - grid=grid reference
    - label (optional)=the default file name; a reference to an object with the "caption" property; by default DATETIME()

b) To export the data contained in a table / cursor
    Drop an instance of the exportpptx class to your form and set :
    - grid=table / cursor name
    - label (optional)=the default file name; a reference an object with the "caption" property; by default DATETIME()
    - cFields (optional)= list of fields to be displayed, separated by commas; by default all the fields are exported
    - cHeaders (optional)= list of field headers to be displayed, separated by commas; by default the field names

Formatting properties (right click)
    headbackcolor=back color for column headers (if >=0)
    headfontbold= .T./.F.
    headfontitalic= .T./.F.
    headfontname=if not empty and installed
    headfontsize=if>0
    headforecolor=font color for column headers (if >=0)
    headtheme=.T. use theme in header

    rowbackcolor=back color for rows (if >=0)
    rowfontbold= .T./.F.
    rowfontitalic= .T./.F.
    rowfontname=if not empty and installed
    rowfontsize=if>0
    rowforecolor=font color for rows (if >=0)
    rowtheme=.T. use theme in rows

    nTransSec=slide transition automatically after (seconds)
    lTransClick=.T. slide transition on mouse click
    nTransSpeed=slide transition speed (1 fast, 2 medium, 3 slow)

    PictFB=Picture position (1 Front, 2 Back)
    PictMU=Picture MU (1 cm, 2 inch, 3 pt)
    PictW=Picture width
    PictH=Picture height
    PictL=Picture left position
    PictT=Picture top position
    PictB=Picture brightnes (%)
    PictC=Picture contrast (%)
    PictPath=Picture path

    nstyle=table theme
        public
        Integer (1-11)
        the name of the style
    naccent=table theme
        public
        Integer (1-7) 0 means no accent, 1 to 6 means accent1 to accent6
        the name of the substyle
    tabfirstrow=table first row is different
    tabfirstcol=table first column is different
    tablastrow=table last row is different
    tablastcol=table last column is different
    tabbandrow=table has alternate rows
    tabbandcol=table has alternate columns
Miscelaneous
    lOpen
        logical (default .F.)
        public
        when .T. the document is open
    LangId
        Character (can be EN, RO,etc.)
        Public
        Default En
    aErrMess[7]
        Character array
        Public
        Error messages


Number of rows / slide is automatically calculated, based upon font height

Download links
dbf2pptx 3.0 (VFP9 procedure)
dbf2pptx6 2.0 (VFP6 procedure)

exportpptx 3.0 (VFP9 class)
exportpptx6 1.0 (VFP6 class)

Export to docx

Versions  for VFP 6.0
Both for class (BRAND NEW) and procedure (improved version)

Changes
1) Class exportdocx
a) Small correction in method TheFirstTime
b) New properties
    LangId
        Public
        Character (can be EN, RO,etc.)
        Default En
    aErrMess[7]
        Public
        Error messages
c) New method
    langSet
        Public
        Set the contents of aErrMess property

2) class propdocx
a) New properties
    LangId
        Public
        Character (can be EN, RO,etc.)
        Default En
b) New method
    langSet
        Public
        Set the caption of various objects


Description
Export the data displayed in a grid, or the data contained by a table / cursor

Properties:
a) To export the data displayed in a grid (only the visible columns)
    Drop an instance of the exportxlsx class to your form and set :
    - grid=grid reference
    - label (optional)=the default file name; a reference to an object with the "caption" property; by default DATETIME()


b) To export the data contained in a table / cursor
    Drop an instance of the exportxlsx class to your form and set :
    - grid=table / cursor name
    - label (optional)=the default file name; a reference an object with the "caption" property; by default DATETIME()
    - cFields (optional)= list of fields to be displayed, separated by commas; by default all the fields are exported
    - cHeaders (optional)= list of field headers to be displayed, separated by commas; by default the field names


Formatting properties (right click)
    headbackcolor=back color for column headers (if >=0)
    headfontbold= .T./.F.
    headfontitalic= .T./.F.
    headfontname=if not empty and installed
    headfontsize=if>0
    headforecolor=font color for column headers (if >=0)

    rowbackcolor=back color for rows (if >=0)
    rowfontbold= .T./.F.
    rowfontitalic= .T./.F.
    rowfontname=if not empty and installed
    rowfontsize=if>0
    rowforecolor=font color for rows (if >=0)

    pgLand=page orientation (landscape if .T.)
    pgSz=page size(1 A4 2 A3 3 Letter 4 Custom)
    pgMu=UM (1 inch 2 cm)
    pgh=page height (inch)
    pgw=page width (inch)
    pgTop=page top margin (inch)
    pgbottom=page bottom margin (inch)
    pgleft=page left margin (inch)
    pgright=page right margin (inch)

Miscelaneous
    lOpen
        logical (default .F.)
        public
        when .T. the document is open
    LangId
        Character (can be EN, RO,etc.)
        Public
        Default En
    aErrMess[7]
        Character array
        Public
        Error messages

Download links
dbf2docx 3.0 ( VFP9 procedure)
dbf2docx6 2.0 (VFP6 procedure)

exportdocx 3.0 (VFP9 class)
exportdocx6 1.0 (VFP6 class)

miercuri, 2 noiembrie 2016

Export from VFP6 to MSOffice (docx, pptx, xlsx)

The same exporting procedures, but adapted to VFP6

The archive contains
- dbf2docx6 1.0
- dbf2pptx6 1.0
- dbf2xlsx6 2.0 (fixed a bug when the list of fields is not given in uppercase)

Download link
VFP6ToMsOffice

duminică, 25 septembrie 2016

ImportFromOoWrText 1.0

A simple function that extracts the text contained in a Writer odt document, and creates a txt file with tha same name.

Download link
ImportFromOoWrText 1.0

ImportFromOoffice 1.o

Description
A single unfied function to import data from tables contained in OpenOffice / LibreOffice documents (Calc's ods, Impress' odp and Writer's odt)
The signature is the same used for ImportFromOoCalc

The data are extracted directly from the document.
No automation, no ODBC are used.

Features
- return the name of the generated  DBF / cursor; the same name with de ods / SYS(2015)
- analyze the first (imported) row of the ods table and get the number of columns and data types from this row
- creates a DBF / cursor (according to the sixth parameter)
- and populate this DBF with data from the ods
- when parameter lnHeader between 1 and lnStartRows the field names are taken from that row of the table, otherwise the fields are named mField1,mField2 and so on
- a field is considered of type date, if CTOD() is not empty; SET DATE must be set properly, to import the date and datetime values
- the decimal separator is taken from SET POINT TO
- a field is considered of type number, if contains only digits, and no more than a decimal separator, and no more than one + or - (either one +, either one -) in the leftmost position
- the size and precision of the numeric field is calculated with MAX(LEN(ALLTRIM(cell value))), respectively with MAX(LEN(ALLTRIM(cell value))-AT(decimal separator,ALLTRIM(cell value))
- a field is considered logical if the cell contains "true" or "false"
- the length of character fields is MAX(LEN(cell value))
- if MAX(LEN(cell value)) > 254 or contains at least one CHR(13), the field is MEMO

Download link
Import From Openoffice 1.0