Giter Site home page Giter Site logo

rabanti-github / picoxlsx Goto Github PK

View Code? Open in Web Editor NEW
52.0 52.0 13.0 67.8 MB

PicoXLSX is a small .NET / C# library to create XLSX files (Microsoft Excel 2007 or newer) in an easy and native way

License: MIT License

C# 100.00%
c-sharp excel excelwriter microsoft-office ooxml spreadsheet xlsx

picoxlsx's People

Contributors

actions-user avatar fossabot avatar rabanti-github avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

picoxlsx's Issues

Bug SetWoorkbookProtection

Hi, i think there is a bug here :
image
a white space is missing in workkbook.xml file before workBookPassword property.
this bug corrupts the xlsx file when user try to set workbookProtection.

What about basic read access?

Hey,

I'm entertaining using this. Based on the documentation it seems like this tool is intended to write to disk only. Can I use this to simply iterate and read spreadsheet rows?

I'm avoiding the interlop assemblies for such a simple task.

Cells' style are not retain when merging cells

Hi, when merging several cells, for which the first has an applied style, the merged cell doesn't have any style applied.
The method «ResolveMergedCells» always replace the style of ALL CELLS by the MergeCellStyle (which is empty).

if (pos != 0)
   {
      cell.DataType = Cell.CellType.EMPTY;
   }
   cell.SetStyle(mergeStyle);

To preserve the style of the first cell, it should be:

if (pos != 0)
   {
      cell.DataType = Cell.CellType.EMPTY;
      cell.SetStyle(mergeStyle);
   }

Merged cells style border lost?

Hello,

It looks like merged cell style keeps borders only for top-left cell, does not matter in which order value, style and merge happened:

           var style = new Style();
           style.CurrentBorder.RightStyle = Style.Border.StyleValue.medium;

           var wb = new Workbook(true);
           var sh = wb.CurrentWorksheet;

           int xy = 1;
           // Value, Merge, Style
           sh.AddCell("V,M,S", xy, xy);
           sh.MergeCells(new Cell.Address(xy, xy), new Cell.Address(xy, xy + 1));
           sh.SetStyle(new Cell.Address(xy, xy), new Cell.Address(xy, xy + 1), style);

           xy = 3;
           // Value, Style, Merge
           sh.AddCell("V,S,M", xy, xy);
           sh.SetStyle(new Cell.Address(xy, xy), new Cell.Address(xy, xy + 1), style);
           sh.MergeCells(new Cell.Address(xy, xy), new Cell.Address(xy, xy + 1));

           xy = 5;
           // no Value, Style, Merge
           sh.SetStyle(new Cell.Address(xy, xy), new Cell.Address(xy, xy + 1), style);
           sh.MergeCells(new Cell.Address(xy, xy), new Cell.Address(xy, xy + 1));

           xy = 7;
           // no Value, Merge, Style
           sh.MergeCells(new Cell.Address(xy, xy), new Cell.Address(xy, xy + 1));
           sh.SetStyle(new Cell.Address(xy, xy), new Cell.Address(xy, xy + 1), style);

           wb.SaveAs("c:\\temp\\merge.xlsx");`

изображение

I was also trying to assign style only to left-top corder before merge in hope that it will be applied to the whole merged cell - no luck as well.

Is it a bug or this needs to be written in some other way?

Individual Cell Styles

Hello,

Appreciate the library. I'm having an issue and I'm not sure if its just my lack of understanding or if its perhaps a bug.

When I run the following code (hand typed here, so ignore syntactical errors) I would have expected that my row of data to have a gray background except for the cell in column 2 having a red background.

workbook.CurrentWorksheet.AddCellRange(data, new Cell.Address(0, idx), new Cell.Address(data.Count - 1, idx), Style.BasicStyles.ColorizedBackground("a6a1a1"));
workbook.CurrentWorksheet.GetCell(2, idx).SetStyle(Style.BasicStyles.ColorizedBackground("bf6262"));

It currently changes the style for the whole row to have the red background.
I though perhaps it was the fact that I was adding a range of data instead of a single cell at a time so I tried this as well, with the same result:

data.ForEach(p=> workbook.CurrentWorksheet.AddNextCell(p, Style.BasicStyles.ColorizedBackground("a6a1a1")));
workbook.CurrentWorksheet.GetCell(2, 0).SetStyle(Style.BasicStyles.ColorizedBackground("bf6262"));

Would you expect it to change the style of the whole row or am I doing something wrong?

custom cell style for dates

Hi,

How do you define a cell style custom format for a date ? I wanted to make the cell style for a date as yyyy.mm.dd

Regards,

SaveAsStream closes the Stream

When using the SaveAsStream Method the Stream is closed. This is mostly ok with a FileStream, but with a MemoryStream you can't read the Stream into something else that accepts a Stream. The Demo's say you can use a MemoryStream, but I'm not sure how you could ever do that. I am using this to create an XLSX from a DataTable and then archive it into a document repo via its API. Since the MemoryStream is closed I can't archive it directly from the Stream. I have to use a FileStream or Save the file which does the same thing. Then read the saved file to archive it. It works with the work around so it isn't critical, but figured I was log it as an issue since the Demo says MemoryStreams are supported. Thanks.

MemoryStream.CanWrite evaluates to false after calling the SaveAsStream method.

good job

good job !!

new version, get it ,thanks.

Tab Color

Is it possible to change tab color? I was looking for something like this worksheet.TabColor but didn't found.

--

Please delete me. I created it wrongly here where it belongs to NanoXLSX

RichTextString

When generating files, RichTextString is not supported, similar to Excel's Cell.Characters

Features request

Hi,
I'm missing some features.

  • Write RichText to cells
  • Add conditional formattings to cells
  • Some more overloads for convenience like to make the switch to library more easy:
    Cell.Range(startColumn, startRow, endColumn, endRow)).
    Workbooks.Add("name") which return a new workbook

Perhaps you can put them on the roadmap.

Thanks

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.