Faceți căutări pe acest blog

sâmbătă, 19 decembrie 2015

AppendFromXlsx 1.5

New parameter
- llEmptyCells when .T., the source can contains empty cells (slower import); optional ; default .F.

Useful for sheets with gaps (empty cells)

Append from xlsx 1.5

Related posts
http://praisachion.blogspot.com/2016/06/inspectpptx-10.html
http://praisachion.blogspot.com/2016/06/inspectdocx-10.html

MSOffice -> DBF
http://praisachion.blogspot.com/2017/08/importfromxlsx-40.html
http://praisachion.blogspot.com/2017/06/append-from-xlsx-30.html
http://praisachion.blogspot.com/2016/08/importfromxlsx-34.html
http://praisachion.blogspot.com/2016/08/importfromxlsx-33.html
http://praisachion.blogspot.com/2016/06/importfromxlsx-32-appendfromxlsx-21.html
http://praisachion.blogspot.com/2016/06/appendfrompptx-10.html
http://praisachion.blogspot.com/2016/06/appendfromdocx-21.html
http://praisachion.blogspot.com/2016/06/importfromdocx-31.html
http://praisachion.blogspot.com/2016/06/importfrompptx-11.html
http://praisachion.blogspot.com/2016/06/importfromxlsx-31.html
http://praisachion.blogspot.com/2016/06/importfrompptx-10.html
http://praisachion.blogspot.com/2016/06/importfromdocx-30.html
http://praisachion.blogspot.com/2016/05/importfromxlsx-22.html
http://praisachion.blogspot.com/2016/02/import-dbf-from-msoffice-2007-xlsx-docx.html
http://praisachion.blogspot.com/2016/01/importfromdocx-20.html
http://praisachion.blogspot.com/2016/01/appendfromdocx-20.html
http://praisachion.blogspot.com/2016/01/importfromxlsx-13.html
http://praisachion.blogspot.com/2016/01/appendfromxlsx-20.html
http://praisachion.blogspot.com/2015/12/appendfromxlsx-15.html
http://praisachion.blogspot.com/2015/11/importfromxlsx-13.html
http://praisachion.blogspot.com/2015/09/importfromxlsx-12.html
http://praisachion.blogspot.com/2015/09/appendfromxlsx-14.html
http://praisachion.blogspot.com/2015/09/appendfromnxlsx-13.html
http://praisachion.blogspot.com/2015/08/importfromxlsx-11.html
http://praisachion.blogspot.com/2015/07/import-from-xlsx.html
http://praisachion.blogspot.com/2015/07/insert-from-focx.html
http://praisachion.blogspot.com/2015/06/append-from-docx.html

DBF -> MSOffice
Dbf2Xlsx6 4.2 (VFP6) 
http://praisachion.blogspot.com/2017/04/export-dbf-to-excel-2007.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-msexcel-xlsx.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-mspowerpoin-pptx.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-msword-docx.html
http://praisachion.blogspot.com/2016/11/export-to-xlsx.html
http://praisachion.blogspot.com/2016/11/export-to-pptx.html
http://praisachion.blogspot.com/2016/11/export-to-docx.html
http://praisachion.blogspot.com/2016/11/export-from-vfp6-to-msoffice-docx-pptx.html
http://praisachion.blogspot.com/2016/09/copytoxlsx6-10.html
http://praisachion.blogspot.com/2016/01/export-dbf-to-msoffice-2007-xlsx-docx_24.html
http://praisachion.blogspot.com/2016/01/export-dbf-to-msoffice-2007-xlsx-docx.html
http://praisachion.blogspot.com/2016/01/exporttopptx-20.html
http://praisachion.blogspot.com/2016/01/exporttodocx-20.html
http://praisachion.blogspot.com/2016/01/copytopptx-20.html
http://praisachion.blogspot.com/2016/01/exporttoxlsx-20.html
http://praisachion.blogspot.com/2016/01/copytoxlsx-30.html
http://praisachion.blogspot.com/2015/12/exporttoxlsx-19-class.html
http://praisachion.blogspot.com/2015/12/copytoxlsx-210-procedure.html
http://praisachion.blogspot.com/2015/12/exporttoxlsx-18-class.html
http://praisachion.blogspot.com/2015/12/copytoxlsx-29.html
http://praisachion.blogspot.com/2015/02/export-pptx-13.html
http://praisachion.blogspot.com/2015/01/copytodocx-12.html
http://praisachion.blogspot.com/2015/01/exportdocx-1.html

OOffice -> DBF
http://praisachion.blogspot.com/2016/11/import-from-openoffice-libreoffice-for.html
http://praisachion.blogspot.com/2016/09/importfromoowrtext-10.html
http://praisachion.blogspot.com/2016/09/importfromooffice-1o.html
http://praisachion.blogspot.com/2016/08/importfromoocalc.html

DBF -> OOffice
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice_52.html
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice_16.html
http://praisachion.blogspot.com/2016/09/copy-to-ods-10-openoffice-calc.html
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice.html
http://praisachion.blogspot.com/2016/09/copy-to-odt-10.html

sâmbătă, 5 decembrie 2015

ExportToXlsx 1.9 (class)

 The height and width of the textboxes for each comment, are variable.

General description
No need for MsExcel, LibreOffice or OpenOffice
In addition to copytoxlsx, has some formatting capabilities.

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 (at 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)

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)
    f) lMemoAsComment
        logical (default .F.)
        public
        When is .T., memo fields are converted into comments while the cell contains the word "Memo"


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)

Export To Xlsx 1.9 (class)

Related posts
http://praisachion.blogspot.com/2016/06/inspectpptx-10.html
http://praisachion.blogspot.com/2016/06/inspectdocx-10.html

MSOffice -> DBF
http://praisachion.blogspot.com/2017/08/importfromxlsx-40.html
http://praisachion.blogspot.com/2017/06/append-from-xlsx-30.html
http://praisachion.blogspot.com/2016/08/importfromxlsx-34.html
http://praisachion.blogspot.com/2016/08/importfromxlsx-33.html
http://praisachion.blogspot.com/2016/06/importfromxlsx-32-appendfromxlsx-21.html
http://praisachion.blogspot.com/2016/06/appendfrompptx-10.html
http://praisachion.blogspot.com/2016/06/appendfromdocx-21.html
http://praisachion.blogspot.com/2016/06/importfromdocx-31.html
http://praisachion.blogspot.com/2016/06/importfrompptx-11.html
http://praisachion.blogspot.com/2016/06/importfromxlsx-31.html
http://praisachion.blogspot.com/2016/06/importfrompptx-10.html
http://praisachion.blogspot.com/2016/06/importfromdocx-30.html
http://praisachion.blogspot.com/2016/05/importfromxlsx-22.html
http://praisachion.blogspot.com/2016/02/import-dbf-from-msoffice-2007-xlsx-docx.html
http://praisachion.blogspot.com/2016/01/importfromdocx-20.html
http://praisachion.blogspot.com/2016/01/appendfromdocx-20.html
http://praisachion.blogspot.com/2016/01/importfromxlsx-13.html
http://praisachion.blogspot.com/2016/01/appendfromxlsx-20.html
http://praisachion.blogspot.com/2015/12/appendfromxlsx-15.html
http://praisachion.blogspot.com/2015/11/importfromxlsx-13.html
http://praisachion.blogspot.com/2015/09/importfromxlsx-12.html
http://praisachion.blogspot.com/2015/09/appendfromxlsx-14.html
http://praisachion.blogspot.com/2015/09/appendfromnxlsx-13.html
http://praisachion.blogspot.com/2015/08/importfromxlsx-11.html
http://praisachion.blogspot.com/2015/07/import-from-xlsx.html
http://praisachion.blogspot.com/2015/07/insert-from-focx.html
http://praisachion.blogspot.com/2015/06/append-from-docx.html

DBF -> MSOffice
Dbf2Xlsx6 4.2 (VFP6) 
http://praisachion.blogspot.com/2017/04/export-dbf-to-excel-2007.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-msexcel-xlsx.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-mspowerpoin-pptx.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-msword-docx.html
http://praisachion.blogspot.com/2016/11/export-to-xlsx.html
http://praisachion.blogspot.com/2016/11/export-to-pptx.html
http://praisachion.blogspot.com/2016/11/export-to-docx.html
http://praisachion.blogspot.com/2016/11/export-from-vfp6-to-msoffice-docx-pptx.html
http://praisachion.blogspot.com/2016/09/copytoxlsx6-10.html
http://praisachion.blogspot.com/2016/01/export-dbf-to-msoffice-2007-xlsx-docx_24.html
http://praisachion.blogspot.com/2016/01/export-dbf-to-msoffice-2007-xlsx-docx.html
http://praisachion.blogspot.com/2016/01/exporttopptx-20.html
http://praisachion.blogspot.com/2016/01/exporttodocx-20.html
http://praisachion.blogspot.com/2016/01/copytopptx-20.html
http://praisachion.blogspot.com/2016/01/exporttoxlsx-20.html
http://praisachion.blogspot.com/2016/01/copytoxlsx-30.html
http://praisachion.blogspot.com/2015/12/exporttoxlsx-19-class.html
http://praisachion.blogspot.com/2015/12/copytoxlsx-210-procedure.html
http://praisachion.blogspot.com/2015/12/exporttoxlsx-18-class.html
http://praisachion.blogspot.com/2015/12/copytoxlsx-29.html
http://praisachion.blogspot.com/2015/02/export-pptx-13.html
http://praisachion.blogspot.com/2015/01/copytodocx-12.html
http://praisachion.blogspot.com/2015/01/exportdocx-1.html

OOffice -> DBF
http://praisachion.blogspot.com/2016/11/import-from-openoffice-libreoffice-for.html
http://praisachion.blogspot.com/2016/09/importfromoowrtext-10.html
http://praisachion.blogspot.com/2016/09/importfromooffice-1o.html
http://praisachion.blogspot.com/2016/08/importfromoocalc.html

DBF -> OOffice
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice_52.html
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice_16.html
http://praisachion.blogspot.com/2016/09/copy-to-ods-10-openoffice-calc.html
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice.html
http://praisachion.blogspot.com/2016/09/copy-to-odt-10.html

CopyToXlsx 2.10 (procedure)

The height and width of the textboxes for each comment ,are variable.

General description
One procedure (copytoxlsx.prg) to export the data from a table / grid to an Excel 2007+ xlsx document (like COPY TO XLS)

The demo is testxlsx.prg

No need for MSOffice or LibreOffice

Parameters
- cCur             - table / cursor name
- lcFileName  - name of the xlsx file. By default SYS(2015) (optional)
- llHead          - when .T. the first row of the xlsx is the column header. By default.F. (optional)
- lnMaxIndexLen        optional, maximum length of the indexes. A value between 19 and 120. Default 60
- lcFFields     - optional, the list of the fields to be included in xlsx. By default ""
- llMemoAsComment    optional, memo fields are converted into comments while the cell contains the word "Memo"

Copy To Xlsx 2.10 (procedure)

Related posts
http://praisachion.blogspot.com/2016/06/inspectpptx-10.html
http://praisachion.blogspot.com/2016/06/inspectdocx-10.html

MSOffice -> DBF
http://praisachion.blogspot.com/2017/08/importfromxlsx-40.html
http://praisachion.blogspot.com/2017/06/append-from-xlsx-30.html
http://praisachion.blogspot.com/2016/08/importfromxlsx-34.html
http://praisachion.blogspot.com/2016/08/importfromxlsx-33.html
http://praisachion.blogspot.com/2016/06/importfromxlsx-32-appendfromxlsx-21.html
http://praisachion.blogspot.com/2016/06/appendfrompptx-10.html
http://praisachion.blogspot.com/2016/06/appendfromdocx-21.html
http://praisachion.blogspot.com/2016/06/importfromdocx-31.html
http://praisachion.blogspot.com/2016/06/importfrompptx-11.html
http://praisachion.blogspot.com/2016/06/importfromxlsx-31.html
http://praisachion.blogspot.com/2016/06/importfrompptx-10.html
http://praisachion.blogspot.com/2016/06/importfromdocx-30.html
http://praisachion.blogspot.com/2016/05/importfromxlsx-22.html
http://praisachion.blogspot.com/2016/02/import-dbf-from-msoffice-2007-xlsx-docx.html
http://praisachion.blogspot.com/2016/01/importfromdocx-20.html
http://praisachion.blogspot.com/2016/01/appendfromdocx-20.html
http://praisachion.blogspot.com/2016/01/importfromxlsx-13.html
http://praisachion.blogspot.com/2016/01/appendfromxlsx-20.html
http://praisachion.blogspot.com/2015/12/appendfromxlsx-15.html
http://praisachion.blogspot.com/2015/11/importfromxlsx-13.html
http://praisachion.blogspot.com/2015/09/importfromxlsx-12.html
http://praisachion.blogspot.com/2015/09/appendfromxlsx-14.html
http://praisachion.blogspot.com/2015/09/appendfromnxlsx-13.html
http://praisachion.blogspot.com/2015/08/importfromxlsx-11.html
http://praisachion.blogspot.com/2015/07/import-from-xlsx.html
http://praisachion.blogspot.com/2015/07/insert-from-focx.html
http://praisachion.blogspot.com/2015/06/append-from-docx.html

DBF -> MSOffice
Dbf2Xlsx6 4.2 (VFP6) 
http://praisachion.blogspot.com/2017/04/export-dbf-to-excel-2007.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-msexcel-xlsx.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-mspowerpoin-pptx.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-msword-docx.html
http://praisachion.blogspot.com/2016/11/export-to-xlsx.html
http://praisachion.blogspot.com/2016/11/export-to-pptx.html
http://praisachion.blogspot.com/2016/11/export-to-docx.html
http://praisachion.blogspot.com/2016/11/export-from-vfp6-to-msoffice-docx-pptx.html
http://praisachion.blogspot.com/2016/09/copytoxlsx6-10.html
http://praisachion.blogspot.com/2016/01/export-dbf-to-msoffice-2007-xlsx-docx_24.html
http://praisachion.blogspot.com/2016/01/export-dbf-to-msoffice-2007-xlsx-docx.html
http://praisachion.blogspot.com/2016/01/exporttopptx-20.html
http://praisachion.blogspot.com/2016/01/exporttodocx-20.html
http://praisachion.blogspot.com/2016/01/copytopptx-20.html
http://praisachion.blogspot.com/2016/01/exporttoxlsx-20.html
http://praisachion.blogspot.com/2016/01/copytoxlsx-30.html
http://praisachion.blogspot.com/2015/12/exporttoxlsx-19-class.html
http://praisachion.blogspot.com/2015/12/copytoxlsx-210-procedure.html
http://praisachion.blogspot.com/2015/12/exporttoxlsx-18-class.html
http://praisachion.blogspot.com/2015/12/copytoxlsx-29.html
http://praisachion.blogspot.com/2015/02/export-pptx-13.html
http://praisachion.blogspot.com/2015/01/copytodocx-12.html
http://praisachion.blogspot.com/2015/01/exportdocx-1.html

OOffice -> DBF
http://praisachion.blogspot.com/2016/11/import-from-openoffice-libreoffice-for.html
http://praisachion.blogspot.com/2016/09/importfromoowrtext-10.html
http://praisachion.blogspot.com/2016/09/importfromooffice-1o.html
http://praisachion.blogspot.com/2016/08/importfromoocalc.html

DBF -> OOffice
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice_52.html
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice_16.html
http://praisachion.blogspot.com/2016/09/copy-to-ods-10-openoffice-calc.html
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice.html
http://praisachion.blogspot.com/2016/09/copy-to-odt-10.html

joi, 3 decembrie 2015

ExportToXlsx 1.8 (class)

No need for MsExcel, LibreOffice or OpenOffice
In addition to copytoxlsx, has some formatting capabilities.

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 (at 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)

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)
    f) lMemoAsComment
        logical (default .F.)
        public
        When is .T., memo fields are converted into comments while the cell contains the word "Memo"


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)

Export To Xlsx 1.8 (class)

Related posts
http://praisachion.blogspot.com/2016/06/inspectpptx-10.html
http://praisachion.blogspot.com/2016/06/inspectdocx-10.html

MSOffice -> DBF
http://praisachion.blogspot.com/2017/08/importfromxlsx-40.html
http://praisachion.blogspot.com/2017/06/append-from-xlsx-30.html
http://praisachion.blogspot.com/2016/08/importfromxlsx-34.html
http://praisachion.blogspot.com/2016/08/importfromxlsx-33.html
http://praisachion.blogspot.com/2016/06/importfromxlsx-32-appendfromxlsx-21.html
http://praisachion.blogspot.com/2016/06/appendfrompptx-10.html
http://praisachion.blogspot.com/2016/06/appendfromdocx-21.html
http://praisachion.blogspot.com/2016/06/importfromdocx-31.html
http://praisachion.blogspot.com/2016/06/importfrompptx-11.html
http://praisachion.blogspot.com/2016/06/importfromxlsx-31.html
http://praisachion.blogspot.com/2016/06/importfrompptx-10.html
http://praisachion.blogspot.com/2016/06/importfromdocx-30.html
http://praisachion.blogspot.com/2016/05/importfromxlsx-22.html
http://praisachion.blogspot.com/2016/02/import-dbf-from-msoffice-2007-xlsx-docx.html
http://praisachion.blogspot.com/2016/01/importfromdocx-20.html
http://praisachion.blogspot.com/2016/01/appendfromdocx-20.html
http://praisachion.blogspot.com/2016/01/importfromxlsx-13.html
http://praisachion.blogspot.com/2016/01/appendfromxlsx-20.html
http://praisachion.blogspot.com/2015/12/appendfromxlsx-15.html
http://praisachion.blogspot.com/2015/11/importfromxlsx-13.html
http://praisachion.blogspot.com/2015/09/importfromxlsx-12.html
http://praisachion.blogspot.com/2015/09/appendfromxlsx-14.html
http://praisachion.blogspot.com/2015/09/appendfromnxlsx-13.html
http://praisachion.blogspot.com/2015/08/importfromxlsx-11.html
http://praisachion.blogspot.com/2015/07/import-from-xlsx.html
http://praisachion.blogspot.com/2015/07/insert-from-focx.html
http://praisachion.blogspot.com/2015/06/append-from-docx.html

DBF -> MSOffice
Dbf2Xlsx6 4.2 (VFP6) 
http://praisachion.blogspot.com/2017/04/export-dbf-to-excel-2007.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-msexcel-xlsx.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-mspowerpoin-pptx.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-msword-docx.html
http://praisachion.blogspot.com/2016/11/export-to-xlsx.html
http://praisachion.blogspot.com/2016/11/export-to-pptx.html
http://praisachion.blogspot.com/2016/11/export-to-docx.html
http://praisachion.blogspot.com/2016/11/export-from-vfp6-to-msoffice-docx-pptx.html
http://praisachion.blogspot.com/2016/09/copytoxlsx6-10.html
http://praisachion.blogspot.com/2016/01/export-dbf-to-msoffice-2007-xlsx-docx_24.html
http://praisachion.blogspot.com/2016/01/export-dbf-to-msoffice-2007-xlsx-docx.html
http://praisachion.blogspot.com/2016/01/exporttopptx-20.html
http://praisachion.blogspot.com/2016/01/exporttodocx-20.html
http://praisachion.blogspot.com/2016/01/copytopptx-20.html
http://praisachion.blogspot.com/2016/01/exporttoxlsx-20.html
http://praisachion.blogspot.com/2016/01/copytoxlsx-30.html
http://praisachion.blogspot.com/2015/12/exporttoxlsx-19-class.html
http://praisachion.blogspot.com/2015/12/copytoxlsx-210-procedure.html
http://praisachion.blogspot.com/2015/12/exporttoxlsx-18-class.html
http://praisachion.blogspot.com/2015/12/copytoxlsx-29.html
http://praisachion.blogspot.com/2015/02/export-pptx-13.html
http://praisachion.blogspot.com/2015/01/copytodocx-12.html
http://praisachion.blogspot.com/2015/01/exportdocx-1.html

OOffice -> DBF
http://praisachion.blogspot.com/2016/11/import-from-openoffice-libreoffice-for.html
http://praisachion.blogspot.com/2016/09/importfromoowrtext-10.html
http://praisachion.blogspot.com/2016/09/importfromooffice-1o.html
http://praisachion.blogspot.com/2016/08/importfromoocalc.html

DBF -> OOffice
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice_52.html
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice_16.html
http://praisachion.blogspot.com/2016/09/copy-to-ods-10-openoffice-calc.html
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice.html
http://praisachion.blogspot.com/2016/09/copy-to-odt-10.html

miercuri, 2 decembrie 2015

CopyToXlsx 2.9 (procedure)

New parameter (sixth)
- llMemoAsComment    optional
When passed as .T., memo fields are converted into comments while the cell contains the word "Memo"

Update 2015/12/3 (2.9.1)
- Empty strings are memos are exported into empty cells and no comments

General description
One procedure (copytoxlsx.prg) to export the data from a table / grid to an Excel 2007+ xlsx document (like COPY TO XLS)

The demo is testxlsx.prg

No need for MSOffice or LibreOffice

Parameters
- cCur             - table / cursor name
- lcFileName  - name of the xlsx file. By default SYS(2015) (optional)
- llHead          - when .T. the first row of the xlsx is the column header. By default.F. (optional)
- lnMaxIndexLen        optional, maximum length of the indexes. A value between 19 and 120. Default 60
- lcFFields     - optional, the list of the fields to be included in xlsx. By default ""
- llMemoAsComment    optional, memo fields are converted into comments while the cell contains the word "Memo"

Copy To Xlsx 2.9.1 (procedure)

Related posts
http://praisachion.blogspot.com/2016/06/inspectpptx-10.html
http://praisachion.blogspot.com/2016/06/inspectdocx-10.html

MSOffice -> DBF
http://praisachion.blogspot.com/2017/08/importfromxlsx-40.html
http://praisachion.blogspot.com/2017/06/append-from-xlsx-30.html
http://praisachion.blogspot.com/2016/08/importfromxlsx-34.html
http://praisachion.blogspot.com/2016/08/importfromxlsx-33.html
http://praisachion.blogspot.com/2016/06/importfromxlsx-32-appendfromxlsx-21.html
http://praisachion.blogspot.com/2016/06/appendfrompptx-10.html
http://praisachion.blogspot.com/2016/06/appendfromdocx-21.html
http://praisachion.blogspot.com/2016/06/importfromdocx-31.html
http://praisachion.blogspot.com/2016/06/importfrompptx-11.html
http://praisachion.blogspot.com/2016/06/importfromxlsx-31.html
http://praisachion.blogspot.com/2016/06/importfrompptx-10.html
http://praisachion.blogspot.com/2016/06/importfromdocx-30.html
http://praisachion.blogspot.com/2016/05/importfromxlsx-22.html
http://praisachion.blogspot.com/2016/02/import-dbf-from-msoffice-2007-xlsx-docx.html
http://praisachion.blogspot.com/2016/01/importfromdocx-20.html
http://praisachion.blogspot.com/2016/01/appendfromdocx-20.html
http://praisachion.blogspot.com/2016/01/importfromxlsx-13.html
http://praisachion.blogspot.com/2016/01/appendfromxlsx-20.html
http://praisachion.blogspot.com/2015/12/appendfromxlsx-15.html
http://praisachion.blogspot.com/2015/11/importfromxlsx-13.html
http://praisachion.blogspot.com/2015/09/importfromxlsx-12.html
http://praisachion.blogspot.com/2015/09/appendfromxlsx-14.html
http://praisachion.blogspot.com/2015/09/appendfromnxlsx-13.html
http://praisachion.blogspot.com/2015/08/importfromxlsx-11.html
http://praisachion.blogspot.com/2015/07/import-from-xlsx.html
http://praisachion.blogspot.com/2015/07/insert-from-focx.html
http://praisachion.blogspot.com/2015/06/append-from-docx.html

DBF -> MSOffice
Dbf2Xlsx6 4.2 (VFP6) 
http://praisachion.blogspot.com/2017/04/export-dbf-to-excel-2007.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-msexcel-xlsx.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-mspowerpoin-pptx.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-msword-docx.html
http://praisachion.blogspot.com/2016/11/export-to-xlsx.html
http://praisachion.blogspot.com/2016/11/export-to-pptx.html
http://praisachion.blogspot.com/2016/11/export-to-docx.html
http://praisachion.blogspot.com/2016/11/export-from-vfp6-to-msoffice-docx-pptx.html
http://praisachion.blogspot.com/2016/09/copytoxlsx6-10.html
http://praisachion.blogspot.com/2016/01/export-dbf-to-msoffice-2007-xlsx-docx_24.html
http://praisachion.blogspot.com/2016/01/export-dbf-to-msoffice-2007-xlsx-docx.html
http://praisachion.blogspot.com/2016/01/exporttopptx-20.html
http://praisachion.blogspot.com/2016/01/exporttodocx-20.html
http://praisachion.blogspot.com/2016/01/copytopptx-20.html
http://praisachion.blogspot.com/2016/01/exporttoxlsx-20.html
http://praisachion.blogspot.com/2016/01/copytoxlsx-30.html
http://praisachion.blogspot.com/2015/12/exporttoxlsx-19-class.html
http://praisachion.blogspot.com/2015/12/copytoxlsx-210-procedure.html
http://praisachion.blogspot.com/2015/12/exporttoxlsx-18-class.html
http://praisachion.blogspot.com/2015/12/copytoxlsx-29.html
http://praisachion.blogspot.com/2015/02/export-pptx-13.html
http://praisachion.blogspot.com/2015/01/copytodocx-12.html
http://praisachion.blogspot.com/2015/01/exportdocx-1.html

OOffice -> DBF
http://praisachion.blogspot.com/2016/11/import-from-openoffice-libreoffice-for.html
http://praisachion.blogspot.com/2016/09/importfromoowrtext-10.html
http://praisachion.blogspot.com/2016/09/importfromooffice-1o.html
http://praisachion.blogspot.com/2016/08/importfromoocalc.html

DBF -> OOffice
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice_52.html
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice_16.html
http://praisachion.blogspot.com/2016/09/copy-to-ods-10-openoffice-calc.html
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice.html
http://praisachion.blogspot.com/2016/09/copy-to-odt-10.html

marți, 24 noiembrie 2015

ImportFromXlsx 1.3

New version with massive changes.
- new (fifth) parameter when .T., the source contains empty cells (slower import); optional ; default .F.
- the generated table is FREE

ImportFromXlsx 1.3 appends data from MSExcel 2007+ Workbooks and creates a new table or cursor.
MSExcel is not used, thus not required.
ImportFromXlsx 1.3 simply extract and parse the corresponding XMLs, read the data stored into them and populate a new table / cursor.

Beginning with version 1.2, the XMLs can alternatively be extracted with Winrar.

Parameters :
- lcFileName (rquired)     Name of the xlsx file
- lnStartRows (optional) starting row (the first lnStartRows - 1 rows are skipped)  default 1 (all rows)
- lcSheet (optional)         sheet name | number                                                           default first sheet
- llCursor (optional)       .T. result is cursor instead of table                                      default .F.
- llEmptyCells               .T., the source contains empty cells (slower import); optional ; default .F.


The number of columns and the data type are taken from the first imported row, by default.
But if the fifth parameter, llEmptyCells is passed as .T., then column position and data type is checked for each cell (much slower)
The result depends on the parameter lnStartRows and can differ very much from the point of view of number of columns and data type. Skip all the rows that contain the MSExcel sheet header

Import From Xlsx 1.3

Related posts
http://praisachion.blogspot.com/2016/06/inspectpptx-10.html
http://praisachion.blogspot.com/2016/06/inspectdocx-10.html

MSOffice -> DBF
http://praisachion.blogspot.com/2017/08/importfromxlsx-40.html
http://praisachion.blogspot.com/2017/06/append-from-xlsx-30.html
http://praisachion.blogspot.com/2016/08/importfromxlsx-34.html
http://praisachion.blogspot.com/2016/08/importfromxlsx-33.html
http://praisachion.blogspot.com/2016/06/importfromxlsx-32-appendfromxlsx-21.html
http://praisachion.blogspot.com/2016/06/appendfrompptx-10.html
http://praisachion.blogspot.com/2016/06/appendfromdocx-21.html
http://praisachion.blogspot.com/2016/06/importfromdocx-31.html
http://praisachion.blogspot.com/2016/06/importfrompptx-11.html
http://praisachion.blogspot.com/2016/06/importfromxlsx-31.html
http://praisachion.blogspot.com/2016/06/importfrompptx-10.html
http://praisachion.blogspot.com/2016/06/importfromdocx-30.html
http://praisachion.blogspot.com/2016/05/importfromxlsx-22.html
http://praisachion.blogspot.com/2016/02/import-dbf-from-msoffice-2007-xlsx-docx.html
http://praisachion.blogspot.com/2016/01/importfromdocx-20.html
http://praisachion.blogspot.com/2016/01/appendfromdocx-20.html
http://praisachion.blogspot.com/2016/01/importfromxlsx-13.html
http://praisachion.blogspot.com/2016/01/appendfromxlsx-20.html
http://praisachion.blogspot.com/2015/12/appendfromxlsx-15.html
http://praisachion.blogspot.com/2015/11/importfromxlsx-13.html
http://praisachion.blogspot.com/2015/09/importfromxlsx-12.html
http://praisachion.blogspot.com/2015/09/appendfromxlsx-14.html
http://praisachion.blogspot.com/2015/09/appendfromnxlsx-13.html
http://praisachion.blogspot.com/2015/08/importfromxlsx-11.html
http://praisachion.blogspot.com/2015/07/import-from-xlsx.html
http://praisachion.blogspot.com/2015/07/insert-from-focx.html
http://praisachion.blogspot.com/2015/06/append-from-docx.html

DBF -> MSOffice
Dbf2Xlsx6 4.2 (VFP6) 
http://praisachion.blogspot.com/2017/04/export-dbf-to-excel-2007.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-msexcel-xlsx.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-mspowerpoin-pptx.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-msword-docx.html
http://praisachion.blogspot.com/2016/11/export-to-xlsx.html
http://praisachion.blogspot.com/2016/11/export-to-pptx.html
http://praisachion.blogspot.com/2016/11/export-to-docx.html
http://praisachion.blogspot.com/2016/11/export-from-vfp6-to-msoffice-docx-pptx.html
http://praisachion.blogspot.com/2016/09/copytoxlsx6-10.html
http://praisachion.blogspot.com/2016/01/export-dbf-to-msoffice-2007-xlsx-docx_24.html
http://praisachion.blogspot.com/2016/01/export-dbf-to-msoffice-2007-xlsx-docx.html
http://praisachion.blogspot.com/2016/01/exporttopptx-20.html
http://praisachion.blogspot.com/2016/01/exporttodocx-20.html
http://praisachion.blogspot.com/2016/01/copytopptx-20.html
http://praisachion.blogspot.com/2016/01/exporttoxlsx-20.html
http://praisachion.blogspot.com/2016/01/copytoxlsx-30.html
http://praisachion.blogspot.com/2015/12/exporttoxlsx-19-class.html
http://praisachion.blogspot.com/2015/12/copytoxlsx-210-procedure.html
http://praisachion.blogspot.com/2015/12/exporttoxlsx-18-class.html
http://praisachion.blogspot.com/2015/12/copytoxlsx-29.html
http://praisachion.blogspot.com/2015/02/export-pptx-13.html
http://praisachion.blogspot.com/2015/01/copytodocx-12.html
http://praisachion.blogspot.com/2015/01/exportdocx-1.html

OOffice -> DBF
http://praisachion.blogspot.com/2016/11/import-from-openoffice-libreoffice-for.html
http://praisachion.blogspot.com/2016/09/importfromoowrtext-10.html
http://praisachion.blogspot.com/2016/09/importfromooffice-1o.html
http://praisachion.blogspot.com/2016/08/importfromoocalc.html

DBF -> OOffice
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice_52.html
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice_16.html
http://praisachion.blogspot.com/2016/09/copy-to-ods-10-openoffice-calc.html
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice.html
http://praisachion.blogspot.com/2016/09/copy-to-odt-10.html

joi, 29 octombrie 2015

How to move an entire band to the next page, if contains an object that spans to the next page.

Report's details can have long descriptions.
If a detail's long description overflows the page, then I see its remainder in the following page.

To avoid that and to put all the item (with its whole description) in the following page, SET REPORTBEHAVIOR 90 must be used.

This post shows a solution without subclassing the reportlistener, but it's slow and not intuitive.
Basically, the report is executed more times. Each time one more record is moved to the next page.
Because moving a single record to the next page rearrange the remaining records, the procedure must be repeated, until no record has to be moved.
The RECNO() of the records that spans to the next page, are stored into a cursor named "tproblems" (you can use other name, but you must change that name in the report; see steps 3 and 4 from below)

A demo prg with the report is attached in this rar archive containing a smal prg and a report

Description
1) the piece of code to prepare and finally show the report
*************
* Begin code
*************
CREATE CURSOR tproblems (nRec I) && cursor that retains all the record that tried to span across the pages
PRIVATE llRetry,lnReccount,llOneMoreTime,llBreak && some variables used by the report
llRetry = .T.
lnReccount = 0
SET REPORTBEHAVIOR 90
DO WHILE llRetry && because each record moved to the next page rearrange the remaining records, the procedure must be repeated one by one
    llOneMoreTime = .F.
    llBreak = .F.
    REPORT FORM MyReport TO test.txt  && test.txt can be change with any other name
    llRetry = llOneMoreTime
    lnReccount = lnReccount + 1
ENDDO
llBreak = .F.
REPORT FORM MyReport PREVIEW && the final report

*************
* End code
*************

 2) Open the report and add a new group, by llBreak and set New Page


3) Double click the field that expands to the next page, choose Field properties, and go to the Other Tab.
Click Edit Settings from the Run-time extensions.
Type llRetry in Execute When, and in the edit box above it :

*********
* Begin
*********
 if tP6 = 1 AND RECCOUNT('tproblems') = lnReccount
  insert into tproblems values (recno(ALIAS()))
  llOneMoreTime = .T.
endif

*********
* End
*********





4) Double click the Details band, choose Detail Band properties, and go to the Other Tab.
Click Edit Settings from the Run-time extensions.
Type AfterBand in Execute When, and in the edit box above it :

*********
* Begin
*********
lcAlias = ALIAS()
SELECT tproblems
LOCATE FOR nRec = RECNO(lcAlias) + 1
IF FOUND()
  llBreak = !llBreak
ENDIF
SELECT (lcAlias)


*********
* End
*********



Foxite link

Why a label from a band that span on a second page is printed in that second page, despite the Print When expression ?

Q
I have a report with one Group. In Group footer is a text field (Stretch with overflow) and a label, on the left side.
The label has the some expression on Print When (+Remove line if blank).
If the textbox from the same Group Footer overflows on second page then I see the label in second page even if it is not in first page, because the expression from Print When is evaluated to .F.
Please what is wrong?

A
You have ticked "When band content overflow to the new page/column", right above the "Remove line if blank"
Cut the expression from "Print only when expression is true", untick "When band..." and paste back the expression into "Print only when..."

Foxite link

Why stretched with overflow truncate the field from the bottom of page (the last record from the current page) ?

Q
I have a report with one Group.
In Group footer is a text field (Stretch with overflow).
If the text field extend too much I get only part of text field content in the first page and nothing else in the second page.
Please how to split text field into 2 pages if it overflow?

A
Change "Object position" from "Fix relative to the bottom of the band", into "Float"

Foxite link

miercuri, 30 septembrie 2015

ADIR() and SYS(2000) with mask

ADIR() and SYS(2000) behaves like the DIR command.
Dir command have a MS-DOS legacy, which carry a CP/M one.
http://blogs.msdn.com/b/oldnewthing/archive/2007/12/17/6785519.aspx

The behavior can be unexpected for files whose name contains spaces, have more than 12 characters, or the extension is longer than 3 characters.

And that's because the generated 8.3 short names
This https://support.microsoft.com/en-us/kb/142982 gives a clue about how short names are generated, but is not exhaustive.

When the folder or computer searched with ADIR() or SYS(2000) support short names, files whose short name respect the mask, will be included in the final result.

Moreover, the result include files whose short name contains characters included in the mask, even these characters are not part of the long name.
A classic example is the ~1(2,3..) suffix
http://stackoverflow.com/questions/11107044/strange-windows-dir-command-behavior

This behavior can be stopped, by removing the support for short names.

To remove short names for a single directory

DECLARE INTEGER ShellExecute IN SHELL32.DLL INTEGER nWinHandle,STRING cOperation,STRING cFileName,STRING cParameters,STRING cDirectory,INTEGER nShowWindow
 

ShellExecute(0,"runas","fsutil","8dot3name strip " + lcPathToDesiredDirectory,"",1)


1) example for ADIR()
******************
* Begin ADIR() example 
******************

STRTOFILE("","aabb.xl")
STRTOFILE("","aa bb.xl")
STRTOFILE("","aabb.xls")
STRTOFILE("","aa bb.xls")
STRTOFILE("","aabb.xlsx")
STRTOFILE("","aa bb.xlsx")
STRTOFILE("","aabb.xlsxp")
STRTOFILE("","aa bb.xlsxp")
STRTOFILE("","aabb.xlsxpm")
STRTOFILE("","aa bb.xlsxpm")

*!*    On my PC, this is the result of
*!*    DIR a*.* /x
*!*    17.09.2015  10:35                 0 AABB~1.XL    aa bb.xl
*!*    17.09.2015  10:35                 0 AABB~1.XLS   aa bb.xls
*!*    17.09.2015  10:35                 0 AABB~3.XLS   aa bb.xlsx
*!*    17.09.2015  10:35                 0 AA3C12~1.XLS aa bb.xlsxp
*!*    17.09.2015  10:35                 0 AA96D4~1.XLS aa bb.xlsxpm
*!*    17.09.2015  10:35                 0              aabb.xl
*!*    17.09.2015  10:35                 0              aabb.xls
*!*    17.09.2015  10:35                 0 AABB~2.XLS   aabb.xlsx
*!*    17.09.2015  10:35                 0 AABB~4.XLS   aabb.xlsxp
*!*    17.09.2015  10:35                 0 AA84DD~1.XLS aabb.xlsxpm

?ADIR(la,"*.xl") && 2
?ADIR(la,"*.xls") && 8
?ADIR(la,"*.xlsx") && 2
?ADIR(la,"*.xlsxp") && 2
?ADIR(la,"*.xl?") && 10
?ADIR(la,"*.xl*") && 10

WAIT
?ADIR(la,"a*.xl") && 2
?ADIR(la,"a*.xls") && 8
?ADIR(la,"a*.xlsx") && 2
?ADIR(la,"a*.xlsxp") && 2
?ADIR(la,"a*.xl?") && 10
?ADIR(la,"a*.xl*") && 10

WAIT
?ADIR(la,"*b*.xl") && 2
?ADIR(la,"*b*.xls") && 5
* DIR "*b*.xls" /x
* aabb.xls
* aa bb.xls
* aabb.xlsx
* aa bb.xlsx
* aabb.xlsxp
?ADIR(la,"*b*.xlsx") && 2
?ADIR(la,"*b*.xlsxp") && 2
?ADIR(la,"*b*.xl?") && 7
* DIR "*b*.xl?" /x
* aabb.xl
* aa bb.xl
* aabb.xls
* aa bb.xls
* aabb.xlsx
* aa bb.xlsx
* aabb.xlsxp
?ADIR(la,"*b*.xl*") && 10

WAIT
?ADIR(la,"*b.xl") && 2
?ADIR(la,"*b.xls") && 2
?ADIR(la,"*b.xlsx") && 2
?ADIR(la,"*b.xlsxp") && 2
?ADIR(la,"*b.xl?") && 4
?ADIR(la,"*b.xl*") && 10

WAIT
?ADIR(la,"*1.xl") && 1
?ADIR(la,"*1.xls") && 4
?ADIR(la,"*1.xlsx") && 0
?ADIR(la,"*1.xlsxp") && 0
?ADIR(la,"*1.xl?") && 5
?ADIR(la,"*1.xl*") && 5

WAIT
?ADIR(la,"*~?.xl") && 1
?ADIR(la,"*~?.xls") && 7
?ADIR(la,"*~?.xlsx") && 0
?ADIR(la,"*~?.xlsxp") && 0
?ADIR(la,"*~?.xl?") && 8
?ADIR(la,"*~?.xl*") && 8

WAIT
?ADIR(la,"*D*.xls") && 2
* DIR "*D*.xls" /x
* aa bb.xlsxpm aka AA96D4~1.XLS
* aabb.xlsxpm aka AA84DD~1.XLS
?ADIR(la,"????.xls") && 1
?ADIR(la,"?????.xls") && 2
?ADIR(la,"??????.xls") && 5
* DIR "
??????.xls" /x
* aabb.xls
* aa bb.xls aka AABB~1.XLS
* aabb.xlsx aka AABB~2.XLS
* aa bb.xlsx aka AABB~3.XLS
* aabb.xlsxp aka AABB~4.XLS
?ADIR(la,"????????.xls") && 8
* all except the one with xl as extension

 ******************
* End ADIR() example 
******************



2) Example for SYS(2000)
******************
* Begin SYS(2000) example 
******************

STRTOFILE("","aabb.xl")
STRTOFILE("","aa bb.xl")
STRTOFILE("","aabb.xls")
STRTOFILE("","aa bb.xls")
STRTOFILE("","aabb.xlsx")
STRTOFILE("","aa bb.xlsx")
STRTOFILE("","aabb.xlsxp")
STRTOFILE("","aa bb.xlsxp")
STRTOFILE("","aabb.xlsxpm")
STRTOFILE("","aa bb.xlsxpm")

*!*    On my PC, this is the result of
*!*    DIR a*.* /x
*!*    17.09.2015  10:35                 0 AABB~1.XL    aa bb.xl
*!*    17.09.2015  10:35                 0 AABB~1.XLS   aa bb.xls
*!*    17.09.2015  10:35                 0 AABB~3.XLS   aa bb.xlsx
*!*    17.09.2015  10:35                 0 AA3C12~1.XLS aa bb.xlsxp
*!*    17.09.2015  10:35                 0 AA96D4~1.XLS aa bb.xlsxpm
*!*    17.09.2015  10:35                 0              aabb.xl
*!*    17.09.2015  10:35                 0              aabb.xls
*!*    17.09.2015  10:35                 0 AABB~2.XLS   aabb.xlsx
*!*    17.09.2015  10:35                 0 AABB~4.XLS   aabb.xlsxp
*!*    17.09.2015  10:35                 0 AA84DD~1.XLS aabb.xlsxpm

? MyAdir("*.xl") && 2
?MyAdir("*.xls") && 8
?MyAdir("*.xlsx") && 2
?MyAdir("*.xlsxp") && 2
?MyAdir("*.xl?") && 10
?MyAdir("*.xl*") && 10

WAIT
?MyAdir("a*.xl") && 2
?MyAdir("a*.xls") && 8
?MyAdir("a*.xlsx") && 2
?MyAdir("a*.xlsxp") && 2
?MyAdir("a*.xl?") && 10
?MyAdir("a*.xl*") && 10

WAIT
?MyAdir("*b*.xl") && 2
?MyAdir("*b*.xls") && 5
* DIR "*b*.xls" /x
* aabb.xls
* aa bb.xls
* aabb.xlsx
* aa bb.xlsx
* aabb.xlsxp
?MyAdir("*b*.xlsx") && 2
?MyAdir("*b*.xlsxp") && 2
?MyAdir("*b*.xl?") && 7
* DIR "*b*.xl?" /x
* aabb.xl
* aa bb.xl
* aabb.xls
* aa bb.xls
* aabb.xlsx
* aa bb.xlsx
* aabb.xlsxp
?MyAdir("*b*.xl*") && 10

WAIT
?MyAdir("*b.xl") && 2
?MyAdir("*b.xls") && 2
?MyAdir("*b.xlsx") && 2
?MyAdir("*b.xlsxp") && 2
?MyAdir("*b.xl?") && 4
?MyAdir("*b.xl*") && 10

WAIT
?MyAdir("*1.xl") && 1
?MyAdir("*1.xls") && 4
?MyAdir("*1.xlsx") && 0
?MyAdir("*1.xlsxp") && 0
?MyAdir("*1.xl?") && 5
?MyAdir("*1.xl*") && 5

WAIT
?MyAdir("*~?.xl") && 1
?MyAdir("*~?.xls") && 7
?MyAdir("*~?.xlsx") && 0
?MyAdir("*~?.xlsxp") && 0
?MyAdir("*~?.xl?") && 8
?MyAdir("*~?.xl*") && 8

WAIT
?MyAdir("*D*.xls") && 2
* DIR "*D*.xls" /x
* aa bb.xlsxpm aka AA96D4~1.XLS
* aabb.xlsxpm aka AA84DD~1.XLS
?MyAdir("????.xls") && 1
?MyAdir("?????.xls") && 2
?MyAdir("??????.xls") && 5
* DIR "
??????.xls" /x
* aabb.xls
* aa bb.xls aka AABB~1.XLS
* aabb.xlsx aka AABB~2.XLS
* aa bb.xlsx aka AABB~3.XLS
* aabb.xlsxp aka AABB~4.XLS
?MyAdir("????????.xls") && 8
* all except the ones with xl as extension

FUNCTION MyAdir
    LPARAMETERS lcMask
    LOCAL lnCount
    lnCount = 0
    IF !EMPTY(SYS(2000,m.lcMask))
        lnCount = 1
        DO WHILE !EMPTY(SYS(2000,m.lcMask,1))
            lnCount = m.lnCount + 1
        ENDDO
    ENDIF
    RETURN m.lnCount
ENDIF

 ******************
* End SYS(2000) example 
******************

Paul Gibson's thread about it

luni, 28 septembrie 2015

ImportFromXlsx 1.2

New version with small correction and the possibility to extract the XML files using Winrar.

ImportFromXlsx 1.2 appends data from MSExcel 2007+ Workbooks and creates a new table or cursor.
MSExcel is not used, thus not required.
ImportFromXlsx 1.2 simply extract and parse the corresponding XMLs, read the data stored into them and populate a new table / cursor.

Beginning with version 1.2, the XMLs can alternatively be extracted with Winrar.

Parameters :
- lcFileName (rquired)     Name of the xlsx file
- lnStartRows (optional) starting row (the first lnStartRows - 1 rows are skipped)  default 1 (all rows)
- lcSheet (optional)         sheet name | number                                                           default first sheet
- llCursor (optional)       .T. result is cursor instead of table                                      default .F.


The number of columns and the data type are taken from the first imported row.
The result depends on the parameter lnStartRows and can differ very much from the point of view of number of columns and data type. Skip all the rows that contain the MSExcel sheet header

Import from XLSX 1.2

Related posts
http://praisachion.blogspot.com/2016/06/inspectpptx-10.html
http://praisachion.blogspot.com/2016/06/inspectdocx-10.html

MSOffice -> DBF
http://praisachion.blogspot.com/2017/08/importfromxlsx-40.html
http://praisachion.blogspot.com/2017/06/append-from-xlsx-30.html
http://praisachion.blogspot.com/2016/08/importfromxlsx-34.html
http://praisachion.blogspot.com/2016/08/importfromxlsx-33.html
http://praisachion.blogspot.com/2016/06/importfromxlsx-32-appendfromxlsx-21.html
http://praisachion.blogspot.com/2016/06/appendfrompptx-10.html
http://praisachion.blogspot.com/2016/06/appendfromdocx-21.html
http://praisachion.blogspot.com/2016/06/importfromdocx-31.html
http://praisachion.blogspot.com/2016/06/importfrompptx-11.html
http://praisachion.blogspot.com/2016/06/importfromxlsx-31.html
http://praisachion.blogspot.com/2016/06/importfrompptx-10.html
http://praisachion.blogspot.com/2016/06/importfromdocx-30.html
http://praisachion.blogspot.com/2016/05/importfromxlsx-22.html
http://praisachion.blogspot.com/2016/02/import-dbf-from-msoffice-2007-xlsx-docx.html
http://praisachion.blogspot.com/2016/01/importfromdocx-20.html
http://praisachion.blogspot.com/2016/01/appendfromdocx-20.html
http://praisachion.blogspot.com/2016/01/importfromxlsx-13.html
http://praisachion.blogspot.com/2016/01/appendfromxlsx-20.html
http://praisachion.blogspot.com/2015/12/appendfromxlsx-15.html
http://praisachion.blogspot.com/2015/11/importfromxlsx-13.html
http://praisachion.blogspot.com/2015/09/importfromxlsx-12.html
http://praisachion.blogspot.com/2015/09/appendfromxlsx-14.html
http://praisachion.blogspot.com/2015/09/appendfromnxlsx-13.html
http://praisachion.blogspot.com/2015/08/importfromxlsx-11.html
http://praisachion.blogspot.com/2015/07/import-from-xlsx.html
http://praisachion.blogspot.com/2015/07/insert-from-focx.html
http://praisachion.blogspot.com/2015/06/append-from-docx.html

DBF -> MSOffice
Dbf2Xlsx6 4.2 (VFP6) 
http://praisachion.blogspot.com/2017/04/export-dbf-to-excel-2007.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-msexcel-xlsx.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-mspowerpoin-pptx.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-msword-docx.html
http://praisachion.blogspot.com/2016/11/export-to-xlsx.html
http://praisachion.blogspot.com/2016/11/export-to-pptx.html
http://praisachion.blogspot.com/2016/11/export-to-docx.html
http://praisachion.blogspot.com/2016/11/export-from-vfp6-to-msoffice-docx-pptx.html
http://praisachion.blogspot.com/2016/09/copytoxlsx6-10.html
http://praisachion.blogspot.com/2016/01/export-dbf-to-msoffice-2007-xlsx-docx_24.html
http://praisachion.blogspot.com/2016/01/export-dbf-to-msoffice-2007-xlsx-docx.html
http://praisachion.blogspot.com/2016/01/exporttopptx-20.html
http://praisachion.blogspot.com/2016/01/exporttodocx-20.html
http://praisachion.blogspot.com/2016/01/copytopptx-20.html
http://praisachion.blogspot.com/2016/01/exporttoxlsx-20.html
http://praisachion.blogspot.com/2016/01/copytoxlsx-30.html
http://praisachion.blogspot.com/2015/12/exporttoxlsx-19-class.html
http://praisachion.blogspot.com/2015/12/copytoxlsx-210-procedure.html
http://praisachion.blogspot.com/2015/12/exporttoxlsx-18-class.html
http://praisachion.blogspot.com/2015/12/copytoxlsx-29.html
http://praisachion.blogspot.com/2015/02/export-pptx-13.html
http://praisachion.blogspot.com/2015/01/copytodocx-12.html
http://praisachion.blogspot.com/2015/01/exportdocx-1.html

OOffice -> DBF
http://praisachion.blogspot.com/2016/11/import-from-openoffice-libreoffice-for.html
http://praisachion.blogspot.com/2016/09/importfromoowrtext-10.html
http://praisachion.blogspot.com/2016/09/importfromooffice-1o.html
http://praisachion.blogspot.com/2016/08/importfromoocalc.html

DBF -> OOffice
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice_52.html
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice_16.html
http://praisachion.blogspot.com/2016/09/copy-to-ods-10-openoffice-calc.html
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice.html
http://praisachion.blogspot.com/2016/09/copy-to-odt-10.html