export-to-excel

Give background color to excel sheet in asp.net

China☆狼群 提交于 2020-01-13 18:56:10
问题 I am performing export to excel in asp.net without using any third party controls. How can i give background color to my exported excel sheet? The background color may (not sure) be different according to some cells range. Say from Cell 0- 5 (Cell A-E in excel) is red color, 6-12 is green and so on and so forth. How can i achieve the same? public static void DataSetToExcel(System.Data.DataSet dtExport, System.Web.HttpResponse response, string strFileName) { //Clean up the response Object

Alternative to Excel as ASP.Net Report Generator

喜夏-厌秋 提交于 2020-01-13 05:08:27
问题 I use excel through vb.net/asp.net to generate reports from a web page and then send the file down to the user. We've had some issues with Excel being super slow/inefficient/not closing (even when we keep track of the process id and try to kill it in code...). So I'm looking for some flexible alternatives. We need a replacement that can: Allow for inidivdual cell formatting including borders (different settings on each side), background colors, font styles/coloring, etc... Allow for cell

ClosedXML - Creating multiple pivot tables

99封情书 提交于 2020-01-12 12:48:48
问题 I am trying to export some data to an excel sheet S1 whose data would be shown as Pivoted views in the next two sheets S2 and S3 . I am able to create a single pivot and it works perfect. But when I create two pivots, the consequent Excel file renders as corrupt. By corrupt I mean, On clicking yes, I get this - Here is the code I am using to create the pivots - using XL = ClosedXML.Excel; ... XL.XLWorkbook wb = new XL.XLWorkbook(); dsData = Session["ExportData"] as DataSet; var sheet1 = wb

ClosedXML - Creating multiple pivot tables

烈酒焚心 提交于 2020-01-12 12:45:47
问题 I am trying to export some data to an excel sheet S1 whose data would be shown as Pivoted views in the next two sheets S2 and S3 . I am able to create a single pivot and it works perfect. But when I create two pivots, the consequent Excel file renders as corrupt. By corrupt I mean, On clicking yes, I get this - Here is the code I am using to create the pivots - using XL = ClosedXML.Excel; ... XL.XLWorkbook wb = new XL.XLWorkbook(); dsData = Session["ExportData"] as DataSet; var sheet1 = wb

Exporting a ListView to Excel format

邮差的信 提交于 2020-01-12 05:17:04
问题 I have a ListView wich after populating it, will look like this: I already can export it to a CSV formatted file using the following code: StringBuilder sb = new StringBuilder(); //Making columns! foreach (ColumnHeader ch in lvCnt.Columns) { sb.Append(ch.Text + ","); } sb.AppendLine(); //Looping through items and subitems foreach (ListViewItem lvi in lvCnt.Items) { foreach (ListViewItem.ListViewSubItem lvs in lvi.SubItems) { if (lvs.Text.Trim() == string.Empty) sb.Append(" ,"); else sb.Append

How to remove illegal characters so a dataframe can write to Excel

前提是你 提交于 2020-01-10 08:53:20
问题 I am trying to write a dataframe to an Excel spreadsheet using ExcelWriter, but it keeps returning an error: openpyxl.utils.exceptions.IllegalCharacterError I'm guessing there's some character in the dataframe that ExcelWriter doesn't like. It seems odd, because the dataframe is formed from three Excel spreadsheets, so I can't see how there could be a character that Excel doesn't like! Is there any way to iterate through a dataframe and replace characters that ExcelWriter doesn't like? I don

Datatables / TableTools: format data as text when exporting to Excel

半腔热情 提交于 2020-01-10 02:59:28
问题 I am using the Datatables TableTools plugin in order to provide an Export to Excel option for a table on my page. In general everything works as intended. My only issue is that I would need all the data resp. the columns in the resulting Excel table being formatted as text as otherwise I am losing data in some columns. Examples: - I have a column that has leading zeros (e.g. 0022 ) which only appears with the leading zeros cut off (e.g. 22 ) in the Excel file if this is not formatted as text.

Excel unable to insert more than 255 chars?

情到浓时终转凉″ 提交于 2020-01-09 08:11:10
问题 I am using OLE DB driver to insert more than 255 characters into an Excel sheet, but I get the error: Exception Details: System.Data.OleDb.OleDbException: The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data. Seems from this thread that it's an Excel limitation. Even the Microsoft site seems to say so here. So does this mean I can't programmatically, but I can manually? Because I can enter more than 255 characters when I manually type

Read php file using php file and excel export

女生的网名这么多〃 提交于 2020-01-06 21:52:52
问题 I have two files like below. What I'm trying to do is, I want to fetch the second file content in first file, and then export it to xls. What is the problem with the below code. My intension is to - read a second php file using first php file, and then excel export that content into .xls in C:/myfiles/test.xls index.php <?php $read_file = readfile("my_export_file.php"); $file = 'test.xls'; header("Content-type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=

Use Kivy app while excel file is being built

╄→尐↘猪︶ㄣ 提交于 2020-01-06 19:58:46
问题 So I am trying to create a Kivy app that allows a user to control and monitor various hardware components. Part of the code builds and continuously updates an Excel worksheet that imports temperature readings from the hardware's comm port, along with a time-stamp. I have been able to implement all of this so far, but I am unable to interact with the Kivy app while the Excel worksheet is being built/updated (i.e. while my hardware test is underway), and leaves me unable to use the app's