{"id":12,"date":"2022-03-14T09:08:07","date_gmt":"2022-03-14T09:08:07","guid":{"rendered":"https:\/\/kadence.pixel-show.com\/blog-affiliate\/?p=12"},"modified":"2023-08-21T01:16:55","modified_gmt":"2023-08-20T16:16:55","slug":"habits-how-to-form-better-habits-and-break-bad-ones","status":"publish","type":"post","link":"http:\/\/www.charleskwon.com\/?p=12","title":{"rendered":"How to make XLSX File with Harbour"},"content":{"rendered":"\n<p class=\"has-drop-cap wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-left\">How was the above issue resolved?<\/h2>\n\n\n\n<div style=\"height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<ol class=\"wp-block-list\">\n<li>I hardforked the source of libxlsxwriter. <\/li>\n\n\n\n<li>libxlsxwriter is under the FreeBSD license, allowing freedom to modify, adapt, and distribute without the need to disclose the modified source code. <\/li>\n\n\n\n<li>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 )<\/li>\n\n\n\n<li>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.<\/li>\n\n\n\n<li>To make it user-friendly, I created the TDrXlsx CLASS.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-left\">Hello world!<\/h2>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:7.703125px;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"FUNCTION Main()\n    LOCAL oXlsx := TDrXlsx():New()\n    \n    oXlsx:CreateFile(&quot;test.xlsx&quot;)\n    oXlsx:WriteString(0,0,&quot;\uc548\ub155\ud558\uc138\uc694&quot;)\n    oXlsx:WriteString(1,0,&quot;Hello World!&quot;)\n    oXlsx:Close()\n    \nRETURN NIL  \" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9FF\">FUNCTION <\/span><span style=\"color: #88C0D0\">Main<\/span><span style=\"color: #ECEFF4\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    LOCAL oXlsx :<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">TDrXlsx<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #D8DEE9FF\">:<\/span><span style=\"color: #88C0D0\">New<\/span><span style=\"color: #ECEFF4\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    oXlsx:<\/span><span style=\"color: #88C0D0\">CreateFile<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">test.xlsx<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    oXlsx:<\/span><span style=\"color: #88C0D0\">WriteString<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">\uc548\ub155\ud558\uc138\uc694<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    oXlsx:<\/span><span style=\"color: #88C0D0\">WriteString<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">Hello World!<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    oXlsx:<\/span><span style=\"color: #88C0D0\">Close<\/span><span style=\"color: #ECEFF4\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">RETURN NIL  <\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<blockquote class=\"wp-block-quote has-text-align-left is-style-default is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><\/p>\n<cite><strong><span style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-theme-palette-1-color\">by Charles KWON<\/span><\/strong><\/cite><\/blockquote>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"496\" height=\"465\" src=\"http:\/\/www.charleskwon.com\/wp-content\/uploads\/2023\/08\/image-5.png\" alt=\"\" class=\"wp-image-906\" srcset=\"http:\/\/www.charleskwon.com\/wp-content\/uploads\/2023\/08\/image-5.png 496w, http:\/\/www.charleskwon.com\/wp-content\/uploads\/2023\/08\/image-5-300x281.png 300w\" sizes=\"auto, (max-width: 496px) 100vw, 496px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>There are various ways to create xlsx files using tools like Harbour or Fivewin. However, some methods require&#8230;<\/p>\n","protected":false},"author":1,"featured_media":906,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kadence_starter_templates_imported_post":true,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-12","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technique-productivity"],"taxonomy_info":{"category":[{"value":4,"label":"Technique"}]},"featured_image_src_large":["http:\/\/www.charleskwon.com\/wp-content\/uploads\/2023\/08\/image-5.png",496,465,false],"author_info":{"display_name":"CharlesKWON","author_link":"http:\/\/www.charleskwon.com\/?author=1"},"comment_info":0,"category_info":[{"term_id":4,"name":"Technique","slug":"technique-productivity","term_group":0,"term_taxonomy_id":4,"taxonomy":"category","description":"","parent":0,"count":8,"filter":"raw","cat_ID":4,"category_count":8,"category_description":"","cat_name":"Technique","category_nicename":"technique-productivity","category_parent":0}],"tag_info":false,"_links":{"self":[{"href":"http:\/\/www.charleskwon.com\/index.php?rest_route=\/wp\/v2\/posts\/12","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.charleskwon.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.charleskwon.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.charleskwon.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.charleskwon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12"}],"version-history":[{"count":18,"href":"http:\/\/www.charleskwon.com\/index.php?rest_route=\/wp\/v2\/posts\/12\/revisions"}],"predecessor-version":[{"id":953,"href":"http:\/\/www.charleskwon.com\/index.php?rest_route=\/wp\/v2\/posts\/12\/revisions\/953"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.charleskwon.com\/index.php?rest_route=\/wp\/v2\/media\/906"}],"wp:attachment":[{"href":"http:\/\/www.charleskwon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.charleskwon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.charleskwon.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}