How to make XLSX File with Harbour

There are various ways to create xlsx files using tools like Harbour or Fivewin. However, some methods require the use of specific DLLs or ADO.

In my case, I prefer not to distribute many auxiliary files. Moreover, when using ADO, there are numerous unknown issues depending on the client environment. This can lead to unforeseen compatibility problems when dealing with a wide range of users.

How was the above issue resolved?

  1. I hardforked the source of libxlsxwriter.
  2. libxlsxwriter is under the FreeBSD license, allowing freedom to modify, adapt, and distribute without the need to disclose the modified source code.
  3. I adapted libxlsxwriter for both Harbour 32-bit and 64-bit environments and bound it as a library. ( DrXlsx32.lib and DrXlsx64.lib, no need libxlsxwriter.dll )
  4. I removed all external dependencies of libxlsxwriter and replaced them with substitute code, eliminating the need for any DLLs.I removed all external dependencies of libxlsxwriter and replaced them with substitute code, eliminating the need for any DLLs.
  5. To make it user-friendly, I created the TDrXlsx CLASS.

Hello world!

FUNCTION Main()
    LOCAL oXlsx := TDrXlsx():New()
    
    oXlsx:CreateFile("test.xlsx")
    oXlsx:WriteString(0,0,"안녕하세요")
    oXlsx:WriteString(1,0,"Hello World!")
    oXlsx:Close()
    
RETURN NIL  

by Charles KWON

Similar Posts

One Comment

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다