Announcing DrXlsx 1.0 by Charles Kwon

Re: Announcing DrXlsx 1.0 by Charles Kwon

Postby Jimmy » Mon Aug 28, 2023 1:16 pm

hi Chalres,

your LIB work GREAT, thx

it is a "normal" that RAM is "limited" for 32 Bit App
i have "hope" it does "write" when have "read" but all seems to go to RAM

when it "crash" there is no XLSx, you need to "close" to "write" Excel Sheet

Question : is it possible to use a Thread to "write" what have been "read" before :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Announcing DrXlsx 1.0 by Charles Kwon

Postby Jimmy » Mon Sep 04, 2023 9:27 pm

hi,

do you have a Sample how to "insert" Image into Excel Sheet using DrXlsx LIB :?:

Code: Select all  Expand view
  /* Insert an image. */
   worksheet_insert_image( worksheet, 1, 2, "hb_logo.png" )

   /* Insert an image with options. */
   options := {"x_scale" => .5, "y_scale" => .5 }
   worksheet_insert_image_opt( worksheet, CELL("B15"), "hb_logo.png", options )

   options := {"x_offset"=> 10 , "y_offset" => 5 }
   worksheet_insert_image_opt( worksheet, CELL("G2"), "hb_logo.png", options )

these Function seems also be in DrXlsx LIB but how to use it ... :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Announcing DrXlsx 1.0 by Charles Kwon

Postby Horizon » Thu Sep 21, 2023 3:48 pm

Hi

When will it be released?

Thank you to those who contributed.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: Announcing DrXlsx 1.0 by Charles Kwon

Postby Eroni » Thu Oct 12, 2023 6:01 pm

Hello everybody.
I'm trying to use the DrXlsx lib, but I can't generate the executable for a small example, could anyone tell me what's missing or am I doing it wrong?
is DrXlsx32x_bcc.lib is correct to my case, ok?
Thank you all.
Code: Select all  Expand view

#include "fivewin.ch"
FUNCTION Main()
    LOCAL oXlsx := TDrXlsx():New()

    SET DATE FORMAT "YYYY-MM-DD"

    oXlsx:CreateFile("d:\test.xlsx")
    oXlsx:WriteString(0,0,"Sample Head")
    oXlsx:WriteString(1,0,"Hello World!")
    oXlsx:Close()

RETURN NIL
 


Code: Select all  Expand view
FiveWin for xHarbour 23.04 - Apr. 2023          Harbour development power
(c) FiveTech 1993-2023 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8/10
Compiling...
xHarbour 1.2.3 Intl. (SimpLex) (Build 20221118)
Copyright 1999-2022, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'drxlsx.prg' and generating preprocessed output to 'drxlsx.ppo'...
Generating C source output to 'drxlsx.c'...
Done.
Lines 19, Functions/Procedures 1, pCodes 52
Embarcadero C++ 7.40 for Win32 Copyright (c) 1993-2018 Embarcadero Technologies, Inc.
drxlsx.c:
Turbo Incremental Link 6.90 Copyright (c) 1997-2017 Embarcadero Technologies, Inc.
Error: Unresolved external '_fill_fopen64_filefunc' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|zip
Error: Unresolved external '_call_zopen64' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|zip
Error: Unresolved external '_fill_zlib_filefunc64_32_def_from_filefunc32' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|zip
Error: Unresolved external '_call_zseek64' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|zip
Error: Unresolved external '_call_ztell64' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|zip
Error: Unresolved external '_fill_fopen_filefunc' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|packager
Error: Unresolved external '_HB_FUN_HASTIMEPART' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|TDrXlsx
Error: Unresolved external '_HB_FUN_HB_HEVAL' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|TDrXlsx
Error: Unresolved external '_HB_FUN_HB_TTOS' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|TDrXlsx
 
FWH 1709 BCC72 MySql MariaDB
Visual Studio 2019 / Xamarin / C#
User avatar
Eroni
 
Posts: 98
Joined: Fri Jul 21, 2006 7:15 pm
Location: Criciuma/SC Brazil

Re: Announcing DrXlsx 1.0 by Charles Kwon

Postby Antonio Linares » Fri Oct 13, 2023 6:41 am

Tienes que enlazar las librerias hbzip and zlib
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Announcing DrXlsx 1.0 by Charles Kwon

Postby nageswaragunupudi » Fri Oct 13, 2023 9:03 am

for these errors:
Code: Select all  Expand view
Error: Unresolved external '_HB_FUN_HASTIMEPART' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|TDrXlsx
Error: Unresolved external '_HB_FUN_HB_HEVAL' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|TDrXlsx
Error: Unresolved external '_HB_FUN_HB_TTOS' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|TDrXlsx
 


Add this code somewhere in your application program:
Code: Select all  Expand view
#ifdef __XHARBOUR__

function HB_HEVAL (h); return HEVAL(h)
function HB_TTOS(t);return TTOS(t)

function HasTimePart( tDate )

   static lBug

   if lBug == nil
      lBug  := HB_IsDateTime( Date() )
   endif

   if lBug
      return ( tDate - Int( tDate ) ) > 0
   endif

return HB_IsDateTime( tDate )
#endif
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10640
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Announcing DrXlsx 1.0 by Charles Kwon

Postby Eroni » Fri Oct 13, 2023 12:10 pm

Thanks Mr Antonio e Mr Nages.

nageswaragunupudi wrote:for these errors:
Code: Select all  Expand view
Error: Unresolved external '_HB_FUN_HASTIMEPART' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|TDrXlsx
Error: Unresolved external '_HB_FUN_HB_HEVAL' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|TDrXlsx
Error: Unresolved external '_HB_FUN_HB_TTOS' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|TDrXlsx
 


Add this code somewhere in your application program:
Code: Select all  Expand view
#ifdef __XHARBOUR__

function HB_HEVAL (h); return HEVAL(h)
function HB_TTOS(t);return TTOS(t)

function HasTimePart( tDate )

   static lBug

   if lBug == nil
      lBug  := HB_IsDateTime( Date() )
   endif

   if lBug
      return ( tDate - Int( tDate ) ) > 0
   endif

return HB_IsDateTime( tDate )
#endif
 


It works, thank you.

Mr Antonio, these libs already contains in the script, I am using buildx.bat from the samples folder.
Code: Select all  Expand view

echo %hdirl%\zlib.lib + >> b32.bc
echo %hdirl%\hbzip.lib + >> b32.bc
 

Now, show this errors:
Code: Select all  Expand view

Error: Unresolved external '_fill_fopen64_filefunc' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|zip
Error: Unresolved external '_call_zopen64' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|zip
Error: Unresolved external '_fill_zlib_filefunc64_32_def_from_filefunc32' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|zip
Error: Unresolved external '_call_zseek64' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|zip
Error: Unresolved external '_call_ztell64' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|zip
Error: Unresolved external '_fill_fopen_filefunc' referenced from D:\TOOLS\DRXLSX\DRXLSX32X_BCC.LIB|packager
 
FWH 1709 BCC72 MySql MariaDB
Visual Studio 2019 / Xamarin / C#
User avatar
Eroni
 
Posts: 98
Joined: Fri Jul 21, 2006 7:15 pm
Location: Criciuma/SC Brazil

Re: Announcing DrXlsx 1.0 by Charles Kwon

Postby nageswaragunupudi » Fri Oct 13, 2023 3:02 pm

please try adding this lib also to your link-script
\xharbour\lib\hbmzip.lib
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10640
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Announcing DrXlsx 1.0 by Charles Kwon

Postby Eroni » Fri Oct 13, 2023 9:56 pm

nageswaragunupudi wrote:please try adding this lib also to your link-script
\xharbour\lib\hbmzip.lib


It works fine now!
Thank you Mr. Nages
FWH 1709 BCC72 MySql MariaDB
Visual Studio 2019 / Xamarin / C#
User avatar
Eroni
 
Posts: 98
Joined: Fri Jul 21, 2006 7:15 pm
Location: Criciuma/SC Brazil

Re: Announcing DrXlsx 1.0 by Charles Kwon

Postby leandro » Sat Oct 14, 2023 4:34 pm

Hola buenos días para todos

Estamos terminando de implementar la clase del maestro Charles en algunos de nuestros informes, ya logramos crear los archivos de Excel, ahora requerimos poder cambiar los colores de las fuentes y el color de fondo de la celda, estuvimos revisando en la documentación que publico el maestro Charles, pero no encontramos como se debe hacer.

Tambien nos gustaría saber como podemos hacer para leer un archivo de Excel y recuperar los datos, incluyendo una imagen.

Si alguien tiene un ejemplo seria de mucha utilidad.

De antemano gracias.
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
User avatar
leandro
 
Posts: 1676
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia

Re: Announcing DrXlsx 1.0 by Charles Kwon

Postby karinha » Sun Oct 15, 2023 12:56 am

Master Nages, is this correct? If so, how do I trigger Excel to open the: testsayx.xlsx

Maestro Nages, ¿es esto correcto? Si es así, ¿cómo hago para que Excel abra: testsayx.xlsx

Code: Select all  Expand view

// C:\FWH..\SAMPLES\TESTDRXL.PRG - Master Nages,

#include "FiveWin.ch"
#include "DrXlsx.ch"

#ifdef __XHARBOUR__

   #xtranslate hb_DateTime( [<x,...>] )        => DateTime( <x> )

#endif

REQUEST DBFCDX

FUNCTION Main()

   SET DATE FORMAT "YYYY-MM-DD"

   HelloSayX()

RETURN NIL

// Mister Nages:

#ifdef __XHARBOUR__

FUNCTION HB_HEVAL(h) ; RETURN HEVAL(h)

FUNCTION HB_TTOS(t) ; RETURN TTOS(t)

FUNCTION HasTimePart( tDate )

   static lBug

   if lBug == nil
      lBug  := HB_IsDateTime( Date() )
   endif

   if lBug
      RETURN ( tDate - Int( tDate ) ) > 0
   endif

RETURN HB_IsDateTime( tDate )

#endif

FUNCTION HelloSayX()

   LOCAL oXlsx := TDrXlsx():New()
   LOCAL dDate := Date()
   LOCAL nValue := 2023
   LOCAL nValue2 := 19450815
   LOCAL nUSD    := 3000

   IF oXlsx:CreateFile( "testsayx.xlsx" ) <> 0

      ?" The file is already open."

      RETURN NIL

   ENDIF

   oXlsx:SetColumnSize( 0, 0, 20 )

   @ 0, 0 SAYX "Hello World!" OF oXlsx

   @ 1, 0 SAYX "CENTER Text" OF oXlsx ALIGN DRXLSX_ALIGN_CENTER

   @ 2, 0 SAYX "RIGHT  Text" OF oXlsx ALIGN DRXLSX_ALIGN_RIGHT

   @ 3, 0 SAYX  dDate   OF  oXlsx ALIGN DRXLSX_ALIGN_CENTER

   @ 4, 0 SAYX  nValue  OF  oXlsx PICTUREX "#,###"

   @ 5, 0 SAYX  nValue2 OF  oXlsx PICTUREX "#,###"

   @ 6, 0 SAYX  nUSD    OF  oXlsx PICTUREX "$#,###"

   oXlsx:Close()

RETURN NIL

FUNCTION Hello()

   LOCAL oXlsx := TDrXlsx():New()

   oXlsx:CreateFile( "test.xlsx" )
   oXlsx:WriteString( 0, 0, "안녕하세요" )
   oXlsx:WriteString( 1, 0, "Hello World!" )
   oXlsx:Close()

RETURN NIL

FUNCTION Hello2()

   LOCAL oXlsx := TDrXlsx():New()

   oXlsx:CreateFile( "testlogic.xlsx" )
   oXlsx:SetColumnSize( 0, 0, 12 )

   oXlsx:WriteString( 0, 0, "안녕하세요" )
   oXlsx:WriteString( 1, 0, "Hello World!" )
   oXlsx:WriteLogical( 2, 0, .T. )
   oXlsx:WriteDate( 3, 0, Date(), DRXLSX_ALIGN_CENTER, "dd-mm-yyyy" )
   oXlsx:Close()

RETURN NIL

FUNCTION Hello3()

   LOCAL oXlsx := TDrXlsx():New()

   oXlsx:CreateFile( "align.xlsx" )
   oXlsx:SetColumnSize( 0, 0, 12 )

   oXlsx:WriteString( 0, 0, "안녕하세요", DRXLSX_ALIGN_CENTER )

   oXlsx:WriteString( 1, 0, "Hello World!" )
   oXlsx:WriteLogical( 2, 0, .T. )
   oXlsx:WriteDate( 3, 0, Date(),, "dd-mm-yyyy" )

   oXlsx:Close()

RETURN NIL

FUNCTION Hello4()

   LOCAL oXlsx  := TDrXlsx():New()
   LOCAL dtTest := hb_DateTime( 2023, 8, 23, 20, 04, 30 )

   oXlsx:CreateFile( "merge.xlsx" )

   oXlsx:SetColumnSize( 0, 0, 30 )
   oXlsx:SetColumnSize( 0, 1, 30 )

   oXlsx:MergeRange( 0, 0, 0, 1, "Title", DRXLSX_ALIGN_CENTER )

   oXlsx:WriteString( 1, 0, "Product 1" )
   oXlsx:WriteDate( 1, 1, Date(), DRXLSX_ALIGN_CENTER, "yyyy-mm-dd" )

   oXlsx:WriteString( 2, 0, "Is Stock" )
   oXlsx:WriteLogical( 2, 1, .T., DRXLSX_ALIGN_CENTER )

   oXlsx:WriteString( 3, 0, "Stock Price" )
   oXlsx:WriteNumber( 3, 1, 9999,, "$#,##0.00" )

   oXlsx:WriteString( 4, 0, "Timestamp" )
   oXlsx:WriteDateTime( 4, 1, dtTest,, "yyyy-mm-dd hh:mm:dd" )

   oXlsx:Close()

RETURN NIL

FUNCTION Saytest()

   LOCAL oXlsx  := TDrXlsx():New()
   LOCAL dtTest := hb_DateTime( 2023, 8, 23, 20, 04, 30 )

   oXlsx:CreateFile( "say.xlsx" )

   oXlsx:SetColumnSize( 0, 0, 30 )
   oXlsx:SetColumnSize( 0, 1, 30 )
   oXlsx:Say( 0, 0, "Valtype" )
   oXlsx:Say( 0, 1, "Value" )

   oXlsx:Say( 1, 0, "Character" )
   oXlsx:Say( 2, 0, "Numeric" )
   oXlsx:Say( 3, 0, "Date" )
   oXlsx:Say( 4, 0, "Logic" )
   oXlsx:Say( 5, 0, "Datetime format" )
   oXlsx:Say( 6, 0, "Datetime" )

   oXlsx:Say( 1, 1, "Hello" )
   oXlsx:Say( 2, 1, 1234.0000,, "#,##0.000" )
   oXlsx:Say( 3, 1, Date() )
   oXlsx:Say( 4, 1, .T. )
   oXlsx:Say( 5, 1, dtTest,, "yyyy-mm-dd hh:mm:ss" )
   oXlsx:Say( 6, 1, dtTest )

   oXlsx:Close()

RETURN NIL

FUNCTION Hello5()

   LOCAL oXlsx  := TDrXlsx():New()
   LOCAL dtTest := hb_DateTime( 2023, 8, 23, 20, 04, 30 )
   LOCAL oFormat

   IF oXlsx:CreateFile( "merge2.xlsx" ) <> 0

      ?"The file is already open."
      RETURN NIL
   ENDIF

   /*
   oFormat := TDrXlsxFormat():New( oXlsx )

   oFormat:AddAlign( DRXLSX_ALIGN_CENTER )
   oFormat:AddAlign( DRXLSX_ALIGN_VERTICAL_CENTER )
   */


   DEFINE XLSXFORMAT oFormat OF oXlsx

   ADD XLSXALIGN DRXLSX_ALIGN_CENTER TO oFormat
   ADD XLSXALIGN DRXLSX_ALIGN_VERTICAL_CENTER TO oFormat

   oXlsx:SetColumnSize( 0, 0, 30 )
   oXlsx:SetColumnSize( 0, 1, 30 )

   oXlsx:MergeRange( 0, 0, 1, 1, "Title", oFormat )

   oXlsx:WriteString( 2, 0, "Product 1" )
   oXlsx:WriteDate( 2, 1, Date(), DRXLSX_ALIGN_CENTER, "yyyy-mm-dd" )

   oXlsx:WriteString( 3, 0, "Is Stock" )
   oXlsx:WriteLogical( 3, 1, .T., DRXLSX_ALIGN_CENTER )

   oXlsx:WriteString( 4, 0, "Stock Price" )
   oXlsx:WriteNumber( 4, 1, 9999,, "$#,##0.00" )

   oXlsx:WriteString( 5, 0, "Timestamp" )
   oXlsx:WriteDateTime( 5, 1, dtTest,, "yyyy-mm-dd hh:mm:dd" )

   oXlsx:WriteString( 6, 0, "Timestamp2" )
   oXlsx:WriteDateTime( 6, 1, dtTest )

   oXlsx:Close()

RETURN NIL

FUNCTION HelloFormula()

   LOCAL oXlsx := TDrXlsx():New()
   LOCAL dtTest := hb_DateTime()
   LOCAL oFormat

   IF oXlsx:CreateFile( "formula_format.xlsx" ) <> 0

      ?"The file is already open."

   ENDIF

   DEFINE XLSXFORMAT oFormat OF oXlsx

   ADD XLSX ALIGN          DRXLSX_ALIGN_CENTER      TO oFormat
   ADD XLSX NUMBER_FORMAT "yyyy-mm-dd hh.mm.ss.000" TO oFormat

   ADD XLSX BOLD TO oFormat
   ADD XLSX ITALIC TO oFormat

   ADD XLSX BOTTOM STYLE DRXLSX_BORDER_DOUBLE TO oFormat

   oXlsx:SetColumnSize( 0, 1, 30 )

   oXlsx:WriteString( 0, 0, "Timestamp" )
   oXlsx:WriteDateTime( 0, 1, dtTest )

   oXlsx:WriteString( 1, 0, "Timestamp + 30" )
   oXlsx:WriteFormula( 1, 1, "=B1+30",  oFormat )

   oXlsx:Close()

RETURN NIL

FUNCTION MakeDbf2Xls()

   rddSetDefault( "DBFCDX" )

   USE INVOICES NEW

   Dr_Dbf2Xlsx( "invoices.xlsx", .T. )

RETURN NIL

// FIN / END
 


Gracias, thanks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7823
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Announcing DrXlsx 1.0 by Charles Kwon

Postby nageswaragunupudi » Sun Oct 15, 2023 4:33 am

If so, how do I trigger Excel to open the: testsayx.xlsx

Code: Select all  Expand view
ShellExectute( 0, "Open", cXlsxFile )
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10640
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Announcing DrXlsx 1.0 by Charles Kwon

Postby karinha » Sun Oct 15, 2023 6:38 pm

Thanks mister Rao. Perfect!

Code: Select all  Expand view

// C:\FWH..\SAMPLES\TESTDRXL.PRG - Master Nages, Moidified: 15/10/2023 Joao.

#include "FiveWin.ch"
#include "DrXlsx.ch"

#ifdef __XHARBOUR__

   #xtranslate hb_DateTime( [<x,...>] )        => DateTime( <x> )

#endif

REQUEST DBFCDX

FUNCTION Main()

   // SET DATE FORMAT "YYYY-MM-DD"
   SET CENTURY ON
   SET DATE BRITISH
   SET TIME FORMAT TO "HH:MM:SS"
   SET EPOCH TO YEAR( DATE() ) - 30
   SET SOFTSEEK OFF
   SET WRAP ON
   SETCANCEL( .F. )
   SET CONFIRM OFF
   SET DELETED ON
   SET _3DLOOK ON
   SET UNIQUE OFF
   SET ESCAPE OFF
   SET EXACT ON
   SET EXCLUSIVE OFF
   SET MULTIPLE OFF
   SET OPTIMIZE ON

   HelloSayX()

RETURN NIL

// Mister Nages:

#ifdef __XHARBOUR__

FUNCTION HB_HEVAL(h) ; RETURN HEVAL(h)

FUNCTION HB_TTOS(t) ; RETURN TTOS(t)

FUNCTION HasTimePart( tDate )

   static lBug

   if lBug == nil
      lBug  := HB_IsDateTime( Date() )
   endif

   if lBug
      RETURN ( tDate - Int( tDate ) ) > 0
   endif

RETURN HB_IsDateTime( tDate )

#endif

FUNCTION HelloSayX()

   LOCAL oXlsx     := TDrXlsx():New()
   LOCAL dDate     := Date()
   LOCAL nValue    := 2023
   LOCAL nValue2   := 19450815
   LOCAL nUSD      := 3000
   LOCAL cXlsxFile := "Testsayx.xlsx"

   IF oXlsx:CreateFile( "Testsayx.xlsx" ) <> 0

      ? " The file is already open."

      RETURN NIL

   ENDIF

   oXlsx:SetColumnSize( 0, 0, 20 )

   @ 0, 0 SAYX "Hello World!" OF oXlsx

   @ 1, 0 SAYX "CENTER Texto" OF oXlsx ALIGN DRXLSX_ALIGN_CENTER

   @ 2, 0 SAYX "RIGHT  Texto" OF oXlsx ALIGN DRXLSX_ALIGN_RIGHT

   @ 3, 0 SAYX  "Date: "      OF oXlsx ALIGN DRXLSX_ALIGN_CENTER

   @ 4, 0 SAYX  dDate         OF oXlsx ALIGN DRXLSX_ALIGN_CENTER

   @ 5, 0 SAYX  nValue        OF oXlsx PICTUREX "#,###"

   @ 6, 0 SAYX  nValue2       OF oXlsx PICTUREX "#,###"

   @ 7, 0 SAYX  "US$: "       OF oXlsx ALIGN DRXLSX_ALIGN_RIGHT

   @ 8, 0 SAYX  nUSD          OF oXlsx PICTUREX "$#,###"

   oXlsx:Close()

   // ShellExecute( 0, "Open", cXlsxFile )  // Mister Rao
   MsgRun( "AGUARDE... ABRINDO O PROGRAMA DO EXCEL...",                      ;
           "Por Favor, Espere Abertura. Pode Demorar.",                      ;
           { || WinExec( ShellExecute( 0, "Open", cXlsxFile ) ), 3 } )

RETURN NIL

FUNCTION Hello()

   LOCAL oXlsx := TDrXlsx():New()

   oXlsx:CreateFile( "test.xlsx" )
   oXlsx:WriteString( 0, 0, "안녕하세요" )
   oXlsx:WriteString( 1, 0, "Hello World!" )
   oXlsx:Close()

RETURN NIL

FUNCTION Hello2()

   LOCAL oXlsx := TDrXlsx():New()

   oXlsx:CreateFile( "testlogic.xlsx" )
   oXlsx:SetColumnSize( 0, 0, 12 )

   oXlsx:WriteString( 0, 0, "안녕하세요" )
   oXlsx:WriteString( 1, 0, "Hello World!" )
   oXlsx:WriteLogical( 2, 0, .T. )
   oXlsx:WriteDate( 3, 0, Date(), DRXLSX_ALIGN_CENTER, "dd-mm-yyyy" )
   oXlsx:Close()

RETURN NIL

FUNCTION Hello3()

   LOCAL oXlsx := TDrXlsx():New()

   oXlsx:CreateFile( "align.xlsx" )
   oXlsx:SetColumnSize( 0, 0, 12 )

   oXlsx:WriteString( 0, 0, "안녕하세요", DRXLSX_ALIGN_CENTER )

   oXlsx:WriteString( 1, 0, "Hello World!" )
   oXlsx:WriteLogical( 2, 0, .T. )
   oXlsx:WriteDate( 3, 0, Date(),, "dd-mm-yyyy" )

   oXlsx:Close()

RETURN NIL

FUNCTION Hello4()

   LOCAL oXlsx  := TDrXlsx():New()
   LOCAL dtTest := hb_DateTime( 2023, 8, 23, 20, 04, 30 )

   oXlsx:CreateFile( "merge.xlsx" )

   oXlsx:SetColumnSize( 0, 0, 30 )
   oXlsx:SetColumnSize( 0, 1, 30 )

   oXlsx:MergeRange( 0, 0, 0, 1, "Title", DRXLSX_ALIGN_CENTER )

   oXlsx:WriteString( 1, 0, "Product 1" )
   oXlsx:WriteDate( 1, 1, Date(), DRXLSX_ALIGN_CENTER, "yyyy-mm-dd" )

   oXlsx:WriteString( 2, 0, "Is Stock" )
   oXlsx:WriteLogical( 2, 1, .T., DRXLSX_ALIGN_CENTER )

   oXlsx:WriteString( 3, 0, "Stock Price" )
   oXlsx:WriteNumber( 3, 1, 9999,, "$#,##0.00" )

   oXlsx:WriteString( 4, 0, "Timestamp" )
   oXlsx:WriteDateTime( 4, 1, dtTest,, "yyyy-mm-dd hh:mm:dd" )

   oXlsx:Close()

RETURN NIL

FUNCTION Saytest()

   LOCAL oXlsx  := TDrXlsx():New()
   LOCAL dtTest := hb_DateTime( 2023, 8, 23, 20, 04, 30 )

   oXlsx:CreateFile( "say.xlsx" )

   oXlsx:SetColumnSize( 0, 0, 30 )
   oXlsx:SetColumnSize( 0, 1, 30 )
   oXlsx:Say( 0, 0, "Valtype" )
   oXlsx:Say( 0, 1, "Value" )

   oXlsx:Say( 1, 0, "Character" )
   oXlsx:Say( 2, 0, "Numeric" )
   oXlsx:Say( 3, 0, "Date" )
   oXlsx:Say( 4, 0, "Logic" )
   oXlsx:Say( 5, 0, "Datetime format" )
   oXlsx:Say( 6, 0, "Datetime" )

   oXlsx:Say( 1, 1, "Hello" )
   oXlsx:Say( 2, 1, 1234.0000,, "#,##0.000" )
   oXlsx:Say( 3, 1, Date() )
   oXlsx:Say( 4, 1, .T. )
   oXlsx:Say( 5, 1, dtTest,, "yyyy-mm-dd hh:mm:ss" )
   oXlsx:Say( 6, 1, dtTest )

   oXlsx:Close()

RETURN NIL

FUNCTION Hello5()

   LOCAL oXlsx  := TDrXlsx():New()
   LOCAL dtTest := hb_DateTime( 2023, 8, 23, 20, 04, 30 )
   LOCAL oFormat

   IF oXlsx:CreateFile( "merge2.xlsx" ) <> 0

      ?"The file is already open."
      RETURN NIL
   ENDIF

   /*
   oFormat := TDrXlsxFormat():New( oXlsx )

   oFormat:AddAlign( DRXLSX_ALIGN_CENTER )
   oFormat:AddAlign( DRXLSX_ALIGN_VERTICAL_CENTER )
   */


   DEFINE XLSXFORMAT oFormat OF oXlsx

   ADD XLSXALIGN DRXLSX_ALIGN_CENTER TO oFormat
   ADD XLSXALIGN DRXLSX_ALIGN_VERTICAL_CENTER TO oFormat

   oXlsx:SetColumnSize( 0, 0, 30 )
   oXlsx:SetColumnSize( 0, 1, 30 )

   oXlsx:MergeRange( 0, 0, 1, 1, "Title", oFormat )

   oXlsx:WriteString( 2, 0, "Product 1" )
   oXlsx:WriteDate( 2, 1, Date(), DRXLSX_ALIGN_CENTER, "yyyy-mm-dd" )

   oXlsx:WriteString( 3, 0, "Is Stock" )
   oXlsx:WriteLogical( 3, 1, .T., DRXLSX_ALIGN_CENTER )

   oXlsx:WriteString( 4, 0, "Stock Price" )
   oXlsx:WriteNumber( 4, 1, 9999,, "$#,##0.00" )

   oXlsx:WriteString( 5, 0, "Timestamp" )
   oXlsx:WriteDateTime( 5, 1, dtTest,, "yyyy-mm-dd hh:mm:dd" )

   oXlsx:WriteString( 6, 0, "Timestamp2" )
   oXlsx:WriteDateTime( 6, 1, dtTest )

   oXlsx:Close()

RETURN NIL

FUNCTION HelloFormula()

   LOCAL oXlsx := TDrXlsx():New()
   LOCAL dtTest := hb_DateTime()
   LOCAL oFormat

   IF oXlsx:CreateFile( "formula_format.xlsx" ) <> 0

      ? "The file is already open."

   ENDIF

   DEFINE XLSXFORMAT oFormat OF oXlsx

   ADD XLSX ALIGN          DRXLSX_ALIGN_CENTER      TO oFormat
   ADD XLSX NUMBER_FORMAT "yyyy-mm-dd hh.mm.ss.000" TO oFormat

   ADD XLSX BOLD TO oFormat
   ADD XLSX ITALIC TO oFormat

   ADD XLSX BOTTOM STYLE DRXLSX_BORDER_DOUBLE TO oFormat

   oXlsx:SetColumnSize( 0, 1, 30 )

   oXlsx:WriteString( 0, 0, "Timestamp" )
   oXlsx:WriteDateTime( 0, 1, dtTest )

   oXlsx:WriteString( 1, 0, "Timestamp + 30" )
   oXlsx:WriteFormula( 1, 1, "=B1+30",  oFormat )

   oXlsx:Close()

RETURN NIL

FUNCTION MakeDbf2Xls()

   rddSetDefault( "DBFCDX" )

   USE INVOICES NEW

   Dr_Dbf2Xlsx( "invoices.xlsx", .T. )

RETURN NIL

// FIN / END - Thanks Mister Rao. - kapiabafwh@gmail.com
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7823
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Announcing DrXlsx 1.0 by Charles Kwon

Postby karinha » Mon Oct 16, 2023 1:56 pm

FONT no funciona?

Code: Select all  Expand view

FUNCTION Hello()

   LOCAL cXlsxFile := "Test.xlsx"
   LOCAL oXlsx := TDrXlsx():New()

   DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 00, -28 BOLD // no funciona?

   oXlsx:CreateFile( "test.xlsx" )

   oXlsx:WriteString( 0, 0, "안녕하세요",, oFont )
   oXlsx:WriteString( 1, 0, "Hello World!",, oFont )

   oXlsx:Close()

   MsgRun( "AGUARDE... ABRINDO O PROGRAMA DO EXCEL...",                      ;
           "Por Favor, Espere Abertura. Pode Demorar.",                      ;
           { || WinExec( ShellExecute( 0, "Open", cXlsxFile ) ), 3 } )

RETURN NIL
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7823
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Announcing DrXlsx 1.0 by Charles Kwon

Postby leandro » Sun Nov 19, 2023 10:51 am

Hola buenos días para todos

Acabamos de descargar la nueva distribución de xharbour para Borland 770 y tambien la distribución de borland 770. Al intentar compilar la aplicación, nos sale el siguiente error:

Code: Select all  Expand view

Embarcadero C++ 7.70 for Win32 Copyright (c) 1993-2023 Embarcadero Technologies, Inc.
C:\Fivedit\R32_menu.c:
xHarbour 1.3.0 Intl. (SimpLex) (Build 20231104)
Copyright 1999-2023, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'z:\prg\R32_perm.prg'...

100

200

100

100

100

100

100

200

300

400

500

60
Turbo Incremental Link 6.97 Copyright (c) 1997-2022 Embarcadero Technologies, Inc.
Error: Unresolved external '__streams' referenced from C:\DLYMA\DRXLSX\DRXLSX32X_BCC.LIB|drawing
Error: Unable to perform link
Link Error
 
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
User avatar
leandro
 
Posts: 1676
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 28 guests