XLSX

How convert stream excel file to datatable C#?

Deadly 提交于 2019-11-30 09:36:31
I use Epplus to reading xlsx files from stream. It has a bug , it cant read some columns in my workbook.How can read xlsx files from stream to datatable without epplus ? my older code: public static DataSet ReadExcelFile(Stream stream) { try { //2. Reading from a OpenXml Excel file (2007 format; *.xlsx) IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream); //... DataSet result = excelReader.AsDataSet(); return result; } catch (Exception x) { throw x; } } I didnt report it, but i tried so much combinations.If there are empty columns in worksheet ,epplus reader cant read

Django: openpyxl saving workbook as attachment

六眼飞鱼酱① 提交于 2019-11-30 08:21:06
Hi I have a quick question. I didn't find answer in internet maybe someone of you can help me. So i want to save workbook as attachment but I don't know how lets see an example : from openpyxl import Workbook from openpyxl.cell import get_column_letter wb = Workbook(encoding='utf-8') dest_filename = 'file.xlsx' ws = wb.worksheets[0] ws.title = "range names" for col_idx in xrange(1, 40): col = get_column_letter(col_idx) for row in xrange(1, 600): ws.cell('%s%s'%(col, row)).value = '%s%s' % (col, row) ws = wb.create_sheet() ws.title = 'Pi' ws.cell('F5').value = 3.14 Then I tried : response =

Reading an Excel File From C#

妖精的绣舞 提交于 2019-11-30 07:39:40
问题 I have a connection string to read an excel file from my C# project that looks like this.. String ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + VariableFile + ";" + "Extended Properties=Excel 8.0;"; and I also have objConn.Open(); to open the file.. The problem is the only time my program will open the file is if I open the Excel file manually and run my program. Can anyone help me to open the file from my C# code instead of having to open it first manually. I get

Read multiple xlsx files with multiple sheets into one R data frame

怎甘沉沦 提交于 2019-11-30 07:23:17
I have been reading up on how to read and combine multiple xlsx. files into one R data frame and have come across some very good suggestions like, How to read multiple xlsx file in R using loop with specific rows and columns , but non fits my data set so far. I would like R to read in multiple xlsx files with that have multiple sheets. All sheets and files have the same columns but not the same length and NA's should be excluded. I want to skip the first 3 rows and only take in columns 1:6, 8:10, 12:17, 19. So far I tried: file.list <- list.files(recursive=T,pattern='*.xlsx') dat = lapply(file

Code to read xlsx sheet into a table in a SQL Server database

淺唱寂寞╮ 提交于 2019-11-30 06:26:21
I am trying to read data from an Excel sheet ( .xlsx file) into a table in SQL Server 2008. I want this to be run everyday as a batch job and hence want to write SQL code in a stored procedure to do so. Could someone help me? I have admin rights. ~TIA kiri This should do... SELECT * FROM OPENROWSET( 'Microsoft.ACE.OLEDB.12.0', 'Excel 8.0;HDR=NO;Database=T:\temp\Test.xlsx', 'select * from [sheet1$]') But we aware, sometimes this just wont work. I had this working for local admins only. There is a way to do this using SSIS as well. To, Import/Export data To/From Excel ( .xls ) need Microsoft.Jet

how to use SheetJS (js-xlsx) in angular 2

我只是一个虾纸丫 提交于 2019-11-30 05:46:30
I'm learning angular2 and i wanted to use js-xlsx library in my project. I installed xlsx npm install xlsx and jszip npm install jszip and added them in my index.html <script src="node_modules/xlsx/dist/xlsx.core.min.js"></script> <script src="node_modules/jszip/dist/jszip.min.js"></script> and added the typescript defitions tsd install xlsx and I'm using webpack but when I used it in import * as xlsx from 'xlsx'; but i get error module build failed: error: cannot resolve module 'xlsx' An easier method would be not using typings at all: Add xlsx.core.min.js to your index.html file as you did.

Parsing an Excel file in C#, the cells seem to get cut off at 255 characters… how do I stop that?

吃可爱长大的小学妹 提交于 2019-11-30 05:04:58
I am parsing through an uploaded excel files (xlsx) in asp.net with c#. I am using the following code (simplified): string connString = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + fileLocation + ";Extended Properties=\"Excel 12.0 Xml;HDR=YES\";"); OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", connString); DataSet ds = new DataSet(); adapter.Fill(ds); adapter.Dispose(); DataTable dt = ds.Tables[0]; var rows = from p in dt.AsEnumerable() select new { desc = p[2] }; This works perfectly, but if there is anything longer than 255 characters in the

微服务之间调用控制器注解类型的差异

丶灬走出姿态 提交于 2019-11-30 04:40:12
今天在一个业务服务通过Feign调用文件服务上传文件时遇到了几个问题: 1. 提示http请求头过大的问题; 此时需要修改bootstrap.yml,加入 server: max-http-header-size: 10000000 用以放大尺寸 2. 调用方法时提示404,无返回结果; 解决方法:把控制器的注解由@Controller变为@RestController,就可以 被调用方具体代码如下: @Slf4j @RestController @RequestMapping("/image") public class ImageController { private static List<String> allowUploadSuffixes = new ArrayList<>(Arrays.asList("png", "jpg", "jpeg", "zip", "pdf", "xls", "xlsx", "rar", "doc", "docx")); @Autowired private UploadFileEntityMapper uploadFileEntityMapper; @RequestMapping(value = "/uploadBase64", method = RequestMethod.POST) @ApiOperation(value =

Which gem support Import/Export to xlsx file in ruby [closed]

自闭症网瘾萝莉.ら 提交于 2019-11-30 03:17:55
I need to read and write to Excelx file with ruby code, Tried with spreadsheet it does not support xlsx format, Roo is also to read the file and not write to xlsx. Is there any gem/plugin which will write to Excelx? For the task of writing/exporting xlsx files, Axlsx is the most feature complete library I've found. It does not support reading/importing xlsx files, though. https://github.com/randym/axlsx Here's the author's description: xlsx generation with charts, images, automated column width, customizable styles and full schema validation. Axlsx excels at helping you generate beautiful

What does the “s” attribute signify in a cell tag in XLSX

穿精又带淫゛_ 提交于 2019-11-30 01:58:01
问题 In the XML of a worksheet in an XLSX file (Excel 2007) cell tags that have a "t" attribute equal to "s" are string types. The value tag inside the c needs to be looked up and converted via the sharedStrings document. But, some cells have s="237" and no t attribute at all. The value tag has an integer like 39448 which does not relate to the sharedStrings document. The value as it appears in Excel is a date 1/1/2008. What does the s attribute signify in a c tag in XLSX? Unknown value <c r="B47"