Git Product home page Git Product logo

msvclibxlsxwriter's Introduction

Note: this method is deprecated in favour of using VCPKG. See the libxlswriter docs: https://libxlsxwriter.github.io/getting_started.html#gsg_vcpkg

MSVCLibXlsxWriter

MSVCLibXlsxWriter is a MSVC project to build a Windows DLL for libxlsxwriter a C library for creating Excel XLSX files.

demo image

Libxlsxwriter is a C library that can be used to write text, numbers, formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file.

It supports features such as:

  • 100% compatible Excel XLSX files.
  • Full Excel formatting.
  • Merged cells.
  • Defined names.
  • Autofilters.
  • Charts.
  • Worksheet PNG/JPEG images.
  • Memory optimization mode for writing large files.
  • Source code available on GitHub.
  • FreeBSD ref license.
  • ANSI C.
  • Works with GCC 4.x, GCC 5.x, Clang, Xcode, MSVC 2015, ICC and TCC.
  • Works on Linux, FreeBSD, OS X, iOS and Windows.
  • The only dependency is on zlib.

See the full libxlsxwriter documentation for a getting started guide, a tutorial, the main API documentation and examples. Or browse the source code on GitHub.

Building a Windows DLL of libxlsxwriter

The MSVCLibXlsxWriter repository contains 3 directories:

  • LibXlsxWriterProj: A MSVC project to build a LibXlsxWriter.dll from the libxlsxwriter source code. The directory also contains a pre-built Zlib.dll file.

  • ExampleExe: A libxlsxwriter sample application built as a console application that requires the LibXlsxWriter.dll and Zlib.dll files.

  • libxlsxwriter: The libxlsxwriter source code in a git submodule, see below.

The libxlsxwriter directory is a Git submodule. This means that it isn't included when you do a standard Git clone of MSVCLibXlsxWriter. In order to get the submodule as well as the project code you must clone the project recursively as follows:

git clone --recursive https://github.com/jmcnamara/MSVCLibXlsxWriter.git

Or update it explicitly as follows:

git clone https://github.com/jmcnamara/MSVCLibXlsxWriter.git
cd MSVCLibXlsxWriter/
git submodule init
git submodule update

This version of MSVCLibXlsxWriter contains libxlsxwriter version 0.3.8.

To build the DLL of the library open the LibXlsxWriterProj/LibXlsxWriter.sln project in MS Visual Studio and build the solution using the "Build -> Build Solution" menu item.

In the default configuration this will build an x64 debug LibXlsxWriter .lib and .dll in:

MSVCLibXlsxWriter\LibXlsxWriterProj\x64\Debug

Building a console application using the LibXlsxWriter.lib

Ensure that LibXlsxWriter.lib was built correctly in the previous steps.

To build the example executable open the ExampleExe/ExampleExe.sln project in MS Visual Studio and build the solution using the "Build -> Build Solution" menu item.

In the default configuration this will build the following x64 exe file:

MSVCLibXlsxWriter\ExampleExe\x64\Debug\ExampleExe.exe

To run the application copy the LibXlsxWriter.dll and Zlib.dll files from the MSVCLibXlsxWriter\LibXlsxWriterProj sub-directories to the same directory as the executable. You can then run the application by double clicking on it in File Explorer or by opening a CMD console and running it from the directory.

Once the program has run it will create a chart_column.xlsx file based on the default sample application in ExampleExe.cpp. You can run other libxlsxwriter example programs by copying the code from one of the libxlsxwriter\example\*.c programs.

msvclibxlsxwriter's People

Contributors

jmcnamara avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

msvclibxlsxwriter's Issues

outline_collapsed.c fails on Visual Studio 2017

I have a python script that processes histories from another program which range in size from small to huge. It works great but is slow of course when building very large spreadsheets (It takes several minutes).

I am in the process of making a much faster c++ windows 64 bit exe version. It has gone well so far but I cannot get the outlines I need working, but I have a couple of issues.

In the end I have compiled the the "outline_collapsed.c" test and that fails to work too.

  1. I have to comment out the initialisers e.g.
    lxw_row_col_options options1 = { /*.hidden =*/ 0, /*.level = */ 2, /*.collapsed =*/ 0 };

This may well be just me not able to get Visual studio configured properly.
2) The outlines however are not working.
outline_collapsed.xlsx

Any ideas why I am failing to make this do as it should?

Doesn't compile fine for any configuration

I selected "Release/x86" configuration then click "Build", I got compiling errors.

It is clear that those visual studio project files were never tested against all configurations (at least it wasn't for win32).

Github is plagued with such half-working projects and so less compelling to embrace.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.