I have a excel file, which is created in Excel 2013 MS package.
It contains Numeric values and charts. I had do open the file and added new rows and then while saving the file , got this error in C#.net
This property or method is not supported for a Chartsheet
Could anyone tell me that the limitation on epplus,upto what version of excel epplus will support?
Thanks,
Chartsheet is a special type of sheet which contains a chart only, EPPlus does not support Chartsheet, instead of Chartsheet you can just add the your chart to the normal sheet.
Related
I am trying to export my MS chart from my Windows from exported out to Excel. Are there any ways to go about doing it or any website that I should look into for help? I have searched with Google but it only shows ASP .NET which is not applicable to me.
My project
What I expect
Instead of chart, Try to export the values or data of chart in Excel (table(s)) and create the chart in the excel so it can be auto populated in there.
Does ClosedXML have any function that can be used to save an excel file as PDF?
Currently i am using ClosedXML to create and populate the excel file and then using Interop to save as PDF.
But since Interop depends on the MS Office installed on the syatem the formatting changes on every version of MS Office. And since ClosedXML doesnt require having MS office installed it would be nice to be able to export or save as PDF directly from it without using Interops.
Does ClosedXML have any function that can be used to save an excel file as PDF?
No.
Instead you can use the free version of GemBox.Spreadsheet.
Also look at the top 10 libraries which allows us to manipulate excel.
However GemBox was the only free and featured one that I found with the purpose of creating an invoice report for a website, by converting excel to pdf.
you can use the ClosedXML.Excel and iTextSharp to convert Excel to PDF file.
Here a link with example:
Convert Excel file to Pdf in ASP.Net
In my application I already have functionality to export into 2003 format. Where I am constructing a string out of the template and write using System.IO.File.WriteAllText.
But it does not work with excel 2007/2010, that's why I wanted to convert it to Openxml in order to support 2007 and 2010.
I have string ready with creation of cells and rows from template.
I want advice on how to achieve or any body has reference link.
Please let me know.
Regards
WriteAllText class will save you a text file. You are saving an html(text) based file with xls extension. This is not a real xls file (that is actually a binary file), but MS Excel recognize and interpret the html format.
An xlsx file is a binary file. You can use OpenXML Office library ( Excel.XlFileFormat.xlOpenXMLWorkbook ) or another .NET Excel library like EasyXLS. Check this sample of code for more details.
I am working on an ASP project where I need to Change the color of the cells based on some validation Checks and return it to user.
Currently I have successfully Implemented this functionality using Excel 12.0 Object Library.
But the problem is that I need to improve performance. InterOp library is very slower than what I expected.
Is there any way that I can Format the cells on an Excel sheet without using InterOp library.
(Something like connecting using OleDb connection and formatting) ??
Please Share Your Knowledge
Try using ExcelPlusPlus library from codeplex. It is not using OleDB
EPPlus link
From codeplex:
Create advanced Excel 2007/2010 spreadsheets on the server
EPPlus is a .net library that reads and writes Excel 2007/2010 files using the Open Office Xml format (xlsx).
EPPlus supports:
Cell Ranges
Cell styling (Border, Color, Fill, Font, Number, Alignments)
Charts
Pictures
Shapes
Comments
Tables
Protection
Encryption
Pivot tables
Data validation
Conditional formatting
VBA
Many more...
I've been using Microsoft COM model to prepare reports but it is slow and fails if server does not have excel installed. So I am moving to using OpenXML for creating reports from a server process that does a ton of other things as well.
I've a template that contains named ranges for data that I need to change or extend, named charts, named chart series, named worksheets, etc. All my formatting is contained in excel file and all I do in my server side process is populate the file with data.
These are the steps that I need to replicate using Excel OpenXML:
Open an existing sheet and create a new sheet based on it.
Get the worksheet by worksheet name
Get the Named Ranges in that worksheet.
Populate the Named Ranges from data and extend the ranges if required based on data set.
Get Chart by Chart Name
Get Chart Series by Series Title
Set Chart series to the new range
Export Chart to jpeg to be used in html.
Save new File.
Is it possible to do these steps in OpenXML cleanly? Any examples will help me a lot. Or a light weight library that does this. Some of these 3rd party libraries are too big and are more useful in creating new sheets from scratch.
Any help appreciated.
AFAIK, with OpenXml you can do anything.
I recommend a ClosedXml lib, it wraps OpenXML SDK and makes it easier to do your job. Link contains samples and stuff. Hope that helps.