Code Monkey home page Code Monkey logo

ieit.reports.export.helpers's Introduction

IEIT.Reports.Export.Helpers

Read english version

Эта библиотека является расширением библиотеки DocumentFormat.OpenXml. И предназначена для формирования отчетов в формате Microsoft Excel 2007 и выше (.xlsx). Не поддерживает формат Microsoft Excel ниже версии 2007 (файлы формата.xls) Эта библиотека создана для того, чтобы упростить работу с Excel файлами используя только DocumentFormat.OpenXml.

Установка с помощью NuGet

PM> Install-Package IEIT.Reports.Export.Helpers

Зачем мне это?

С данной библиотекой вы работаете напрямую с драйвером DocumentFormat.OpenXml. Остальные методы являются лишь расширением для существующих классов. Например, для того чтобы открыть документ:

var filePath = "myFolder/excelFile.xlsx";
var editable = true;
var excelDoc = SpreadsheetDocument.Open(filePath, editable);

Как видите, тут мы используем DocumentFormat.OpenXml, и ничего больше.

С данным расширениеми операции становятся проще.

Запись в файл:

var worksheet = excelDoc.GetWorksheet("Лист 1");
worksheet.Write("Привет мир!").To("B2");
excelDoc.SaveAndClose();

Получение и присваивание стилей:

var style = worksheet.GetCell("A1").StyleIndex;
var cell = worksheet.GetCell("A4");
cell.StyleIndex = style;

Или можно присвоить стили при записи в ячейку:

worksheet.Write("Привет мир!").To("B2").WithStyle(style);

Объединение ячеек:

worksheet.MergeCells("A2:B4");

ieit.reports.export.helpers's People

Contributors

sultanimbayev avatar yerlanyr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ieit.reports.export.helpers's Issues

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.