What is the easiest way to save content to excel from .net pages?
I know there are a few packages on NUget but which is the easiest/best to work with?
I only need simple text so I know I can do .csv no problem but I need extra control over formatting such as make the text bold, italic, underlined, change cell colour which I do not believe it is possible to do via CSV.
Try EPPlus open source .net library that reads and writes Excel 2007/2010 files using the Open Office Xml format (xlsx).
NPOI is good for adding formatting. Open source
http://npoi.codeplex.com/
Related
I have an excel file located on SharePoint. I am reading the excel file in C# using OpenXML. While reading the data, I also need the information of any styles that are been added to the cells.
If there is any cell that has been added a background color to, How can I read it in C# ?
Have a look at this you will find some references about foreground color and background color of cell
https://social.msdn.microsoft.com/Forums/vstudio/en-US/c46f8610-0394-4eb9-a0f4-3d9a569817f0/other-properties-of-cell?forum=oxmlsdk
I don't know how you can do that with OpenXML, in the past i have always used Microsoft.Office.Interop.Excel. It's a nuget package that allow you to manipulate your excel style.
I hope it can help you!
I have PDF document data with table structure format and I would like to convert that PDF file into a text file with the same structure with margin and spaces between text in pdf
You need to write your own PDF tool then. Which is not exactly an easy task. Honestly, 3rd party tools make your job much easier, why don't you want to use one?
If you change your mind, I can suggest iTextSharp. I've used it in the past with great success. Here are some example to get you going:
http://www.codeproject.com/Articles/12445/Converting-PDF-to-Text-in-C
ps. there are 3 tools used in there.
I am generating my Report using DevExpress third party tool. my requirement is i have to print report in editable word document that end user can edit text and print.
DevExpress has a sample on how to export to doc/docx: http://devexpress.com/Support/Center/Example/Details/E4530
Needs DevExpress version 2012.2.6 to work though. If you don't have that version I think you need to check for other solutions.
You can use XtraReport.ExportToRtf(). See here for the documentation
Microsoft Word will open and save an .rtf document without any problems. If you really need the output in .doc or .docx format, have a look at this answer.
I have an Excel file which is generated by a machine. I need to create an application using WPF and C# which can import the excel to see its contents, do some calculations and create some new columns and save back as new excel file. Which is the way to go?
I recommend using Microsoft's Open XML library (as it doesn't require Excel to be installed).
There are various 3rd party libraries that sit on top of it to make it easier to use; such as ClosedXML or Simple OOXML.
Consider ODBC Excel drivers. If your input file is built by machine AND you do not want anything fancy as output, this should work just fine.
You can try Spreadsheet control to open excel http://www.syncfusion.com/products/user-interface-edition/wpf/spreadsheet
Sample location: http://silverlight.syncfusion.com/samples/WPF/Samples/WPFSampleBrowser/UI/Spreadsheet/Spreadsheet.htm
I am Exporting a jquery grid data to Excel, for this i am preparing a table at run time with data from grid and inserting html elements with inline styles to get colored text.
this is working for word and PDF but not for excel cell.
I want to show color for some particular characters in a cell. how to do that?
Any help would be appreciable.
Try to put multiple <Data> with different ss:Color attributes inside one <Cell> although I am not sure that "Excel-HTML" even supports what you want.
For some in-depth information regarding the HTML approach to creating Excel files with sample code see http://www.c-sharpcorner.com/UploadFile/kaushikborah28/79Nick08302007171404PM/79Nick.aspx
Also checkout the official documentation at http://msdn.microsoft.com/en-us/library/Aa155477%28office.10%29.aspx
Other options to create Excel files (which AFAIK support what you want):
MS provides the OpenXML SDK V 2.0 - see http://msdn.microsoft.com/en-us/library/bb448854%28office.14%29.aspx
This can read+write MS Office files (including Excel).
Another option see http://www.codeproject.com/KB/office/OpenXML.aspx
IF you need more like rendering, formulas etc. then there are different free and commercial libraries like ClosedXML, EPPlus, Aspose.Cells, SpreadsheetGear, LibXL and Flexcel etc.