export-to-excel

Excel export without Interop

不打扰是莪最后的温柔 提交于 2019-12-23 09:49:13
问题 I'm trying to accomplish export to Excel from a VB.NET (Windows Forms) application. Unfortunately, I can't use Office Interops because the application should work on every machine - even if there is no Excel installed. I found the following sample on the Net: Public Sub ExportDatasetToExcel(ByVal ds As DataSet, Optional ByVal strHeader As String = "Save As") 'Proudly copied from: 'http://www.daniweb.com/software-development/vbnet/threads/368400/write-into-excel-using-oledb-connection

Set text align to center in an Excel document using OpenXML with C#

二次信任 提交于 2019-12-23 09:30:38
问题 I have a document that my asp.net page is creating and I need to align the text of certain columns to center. I have opened the document after manually center the columns in openXML SDK but the code that is reflected does not achieve the desired outcome. This is how I am setting the custom widths of these columns and I would like to add to this function (method, whatevs) the capability to center the text: private static Column CreateColumnData(UInt32 StartColumnIndex, UInt32 EndColumnIndex,

Set lock true for group of cells

℡╲_俬逩灬. 提交于 2019-12-23 07:57:36
问题 I'm using closedxml to export excel.. Now i can protect (Lock cell) cell using the following function, workSheet.Cell(rowIndex,column).Style.Protection.SetLocked(true); I want to set group of cells.. Is that Possible in closedxml ? 回答1: You can use Range like so workSheet.Range(startRow, startColumn, endRow, endColumn).Style.Protection.SetLocked(true); 回答2: @Raidri, thanks for the answer that you provided here, but I want to add my own answer. I found that when you want to lock a cell, the

Exporting displayed columns in dataGridView to Excel

不羁岁月 提交于 2019-12-23 05:37:06
问题 I may be blind, but this is a little different than the normal export-to-excel. I've created a solution and would like to know if this is the best way. Or even if there is another way to do it. Background: WinForms, VisualBasic, VS2012, N-Tier (backend is DB2). My DTOs are set up in order of the DB2 tables. My users want to see the fields in a certain order within the DGV AND be able to export the fields in the same order. Users can also rearrange and hide columns. Hidden columns should not

.NET Component for Excel 2003 spreadsheet generation using templates for formatting

醉酒当歌 提交于 2019-12-23 05:29:26
问题 The problem my application is trying to solve is this: Currently, several stored procedures are run, the data is manually copied out of the SQL results into a blank spreadsheet, and reporting analysts format the data. This process has been deemed too long and costly. The ideal solution (in my mind) is a .NET application with a component that can take a stored procedure result and write it to a specific cell range in a worksheet template (maintaining template formatting) and then I can just

How to dump the data into ExcelWorkBook?

混江龙づ霸主 提交于 2019-12-23 05:14:24
问题 I have a task to dump the dataset data into Excel WorkBook.Suppose if have more than one table then i have to Create More WorkSheets dynamically.For that i did a small application.But i was stuckup with creating no of WorkSheets.Could anyone help me ?Below is the Code private void btn_export2excel_Click(object sender, EventArgs e) { DataSet ds = new DataSet(); ds.Tables.Add("Categories"); ds.Tables.Add("Employee"); try { Excel.Application xlApp; Excel.Workbook xlWorkBook; Excel.Worksheet[]

JSF -Set global font type for the excel sheet in JSF using HSSFFont in Apache POI

孤者浪人 提交于 2019-12-23 04:22:28
问题 I have an option to export the datatable to an excel sheet. I am tryin to set the font type as "Calibri" for all the cell in the sheet. But the below code is assigning only the font type for the header not for the rest of the cells How can I able to set the font type globally for all the cell in the sheet ? public void exportToXLS(Object document) { HSSFWorkbook wb = (HSSFWorkbook) document; HSSFSheet sheet = wb.getSheetAt(0); wb.setSheetName(0, "report_lists"); // set sheet name sheet

How to bring ftable to excel in R without a lot of formatting (merge, unquote)

核能气质少年 提交于 2019-12-23 03:16:06
问题 What I miss about Pandas(Python) working on R is the way a DataFrame is exported to excel. In R, ftable shows tables similar as pandas multiindex DataFrame. When I use to_excel in pandas every row and column is ok in every cell even merge cells in column names if necesary. In R I tried write.ftable with write.table df = data.frame(a = c(1:6), b = rep(c('G1','G2'),3), c = rep(c('A','D','F'),2), d = c('F','F','F','F','M','M')) df2 = ftable(xtabs(a~b+c+d, df), row.vars = 1) write.table(write

How to bring ftable to excel in R without a lot of formatting (merge, unquote)

微笑、不失礼 提交于 2019-12-23 03:16:00
问题 What I miss about Pandas(Python) working on R is the way a DataFrame is exported to excel. In R, ftable shows tables similar as pandas multiindex DataFrame. When I use to_excel in pandas every row and column is ok in every cell even merge cells in column names if necesary. In R I tried write.ftable with write.table df = data.frame(a = c(1:6), b = rep(c('G1','G2'),3), c = rep(c('A','D','F'),2), d = c('F','F','F','F','M','M')) df2 = ftable(xtabs(a~b+c+d, df), row.vars = 1) write.table(write

Pandas Excel Export - Columns Out of Order

元气小坏坏 提交于 2019-12-23 02:53:29
问题 I'm using Output.to_excel('output.xls', index=True, header = False) However when I open the excel sheet the columns or out of order. When I use Output.to_csv('output.csv', index=True, header = False) , the columns are in the appropraite order. Any thoughts or suggestions? Thanks 来源: https://stackoverflow.com/questions/30404791/pandas-excel-export-columns-out-of-order