xls

VS Code C# - System.NotSupportedException: No data is available for encoding 1252

。_饼干妹妹 提交于 2019-11-28 09:40:51
I am trying to use ExcelDataReader to read an .xls file on Ubuntu. I am using VS Code with C#. Here is the code: var stream = File.Open(filePath, mode: FileMode.Open, access: FileAccess.Read); var reader = ExcelReaderFactory.CreateReader(stream); I also tried this: var reader = ExcelDataReader.ExcelReaderFactory.CreateBinaryReader(stream); When I run, I am getting the following exception: Unhandled Exception: System.NotSupportedException: No data is available for encoding 1252. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. at

Convert XLS to XLSB Programmatically?

回眸只為那壹抹淺笑 提交于 2019-11-28 09:14:56
I have a customer that needs to convert XLS files to XLSB. Has anyone done this programmatically, (with or without an add-on --- doesn't matter --- just need to be able to automate it)? I'm looking for a way to automate this. As a side note, the customer is asking about this because they use Sharepoint, and it seems it has a way to analyze XLSB files quicker and easier than XLS? I'm working to improve my Sharepoint knowledge, but in the meantime, I'm trying to find an answer to this XLSB issue. Petr Abdulin Well, then there is a short format verison: using Microsoft.Office.Interop.Excel; //

One page per sheet property in JasperReports

老子叫甜甜 提交于 2019-11-28 08:41:15
问题 I have a requirement where I have to design a report in JasperReports. The report has 4 sheets. The first sheet has 5 pages and similarly other sheets has one or two pages.The problem that I am facing is if I use the net.sf.jasperreports.export.xls.one.page.per.sheet property and set it to true , then all the pages comes in different sheets. I need to design the report in such a manner that some pages will come in a same sheet and some pages in a different sheet. Is it possible to do this?

Convert .csv to .xls in Java

匆匆过客 提交于 2019-11-28 08:36:20
Does anyone here know of any quick, clean way to convert csv files to xls or xlsx files in java? I have something to manage csv files already in place and I need the extra compatibility for other programs. Sample code in addition to package names is always well appreciated. Many thanks, Justian Here's my code thus far. I need to remove the returns ("\n") from the lines. Some of my cells contain multiple lines of information (a list), so I can use "\n" in csv to indicate multiple lines within a cell , but xls treats these as if I mean to put them on a new line . The code is modified from the

Open an Excel 2003 spreadsheet with C#. Could not find installable ISAM. Exception

自古美人都是妖i 提交于 2019-11-28 07:26:09
问题 I need to pull data from an xls, I also need have the user be able to change the location of the file it will. So an OleDbConnection seemed like a good start, and it was until the first merged cell. This works for all but the merged cells: OleDbCommand cmd = new OleDbCommand(); cmd.Connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\test.xls;Extended Properties=Excel 8.0;"); cmd.CommandText = "SELECT * FROM [Sheet$]"; cmd.Connection.Open(); I found that this

CSV Import Library for CodeIgniter [closed]

瘦欲@ 提交于 2019-11-28 06:38:49
Need to implement csv or xls import into Application created using CodeIgniter. Is there any library for this? Any suggestion appreciated. Muhammad Raheel Here is an easy way to do this. I don't know what people do but i use this This is my csv reader library <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class CSVReader { var $fields; /** columns names retrieved after parsing */ var $separator = ';'; /** separator used to explode each line */ var $enclosure = '"'; /** enclosure used to decorate each field */ var $max_row_size = 4096; /** maximum row size to be used

How do I convert an XLS document to XML in C#?

淺唱寂寞╮ 提交于 2019-11-28 06:13:32
问题 I have an Excel spreadsheet that looks like: spreadsheet http://img186.imageshack.us/img186/6495/exelf.jpg I'd like to convert this to some XML that looks like: <UserName> bla1 </UserName> <Mail> bla1[at]bla2.com </Mail> <Address> World </Address> can anyone help me do this in C#? 回答1: Take a look at this Google result: http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/b6e8a28c-6760-4e86-a1aa-e2ce9ec36380 Read the Excel file into a DataTable and use DataTable.WriteXml(). 回答2: try File

Create xls file using PL/SQL without going through xml

假如想象 提交于 2019-11-28 05:25:43
问题 My system is developed in APEX/Oracle 11g, and I want to create an xls file directly without having to create an xml file. The system currently creates an xml file which can then be saved to xls format, but the user, who is very picky, does not like the Windows 7 warning when one tries to open the xml file (Excel warning that the format of the file does not match its extension). Is there any way to use Oracle PL/SQL from within APEX to accomplish this? 回答1: Morten Braten has put together a

Reading from src/main/resources gives NullPointerException

此生再无相见时 提交于 2019-11-28 05:17:39
In my Maven project, I have a xls file in src/main/resources. When I read it like this: InputStream in = new FileInputStream("src/main/resources/WBU_template.xls"); everything is ok. However I want to read it as InputStream with getResourceAsStream. When I do this, with or without the slash I always get a NPE. private static final String TEMPLATEFILE = "/WBU_template.xls"; InputStream in = this.getClass.getResourceAsStream(TEMPLATEFILE); No matter if the slash is there or not, or if I make use of the getClassLoader() method, I still get a NullPointer. I also have tried this : URL u = this

Export data to XLS (not via CSV) on iOS

旧街凉风 提交于 2019-11-28 04:36:03
问题 I need to export some data to an .XLS file, pdf, and print. I already tried the simple solution: exporting it to .CSV with CHCSVWriter. It works for printing and saving it to pdf (I open the CSV in a UIWebView and get the PDF or print from there). However, to use the CSV to be open in excel has two main problems: 1 - First, as the name says, in the CSV the values are separated by commas, and in some versions of Excel, it requires the user to separate 'manually' in cells. 2 - I have hebrew