Tag: export to excel

codeigniter导出到excel在localhost上运行良好,服务器上出现错误

这是我的export_to_excel助手的代码: function export_to_excel($query, $filename='exceloutput') { $headers = ''; // just creating the var for field headers to append to below $data = ''; // just creating the var for field data to append to below $obj =& get_instance(); $fields = $query->list_fields(); if ($query->num_rows() == 0) { echo '<p>The table appears to have no data.</p>'; } […]

CSV中的Excelmacros

有没有办法以CSV文件格式运行Excelmacros? 我正在使用csv模板将文件导出为CSV,是否可以在CSV格式的模板上编写macros。 我不能用XLS格式。 谁可以帮我这个事?

如何将2个查询导出到Excel中的单个工作表中

我正在使用TransferSpreadsheet将访问的查询导出到Excel,它工作正常。 DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qryName", "test1.xls", True 现在我有另一个查询,我想要从这个查询中的数据添加到同一个工作表。 我怎样才能做到这一点?

使用openxml sdk将图像添加到excel中

我试图添加一个图像到excel文档,该文档是在生成电子表格之后使用openxml生成的(因为closedxml当前无法插入图像)。 我可以正确生成excel文件,但打开罚款,但是当我尝试插入图像,并尝试在Excel中打开它会给出一个错误。 我使用了一个小的控制台应用程序,发现错误是 Error 1 Description: The element has unexpected child element 'http://schemas.openxmlfor mats.org/spreadsheetml/2006/main:drawing'. Path: /x:worksheet[1] Part: /xl/worksheets/sheet.xml ——————————————- 电子表格如下所示: <?xml version="1.0" encoding="utf-8"?> <x:worksheet xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main"> <x:sheetPr> <x:outlinePr summaryBelow="1" summaryRight="1" /> </x:sheetPr> <x:dimension ref="A1:M4" /> <x:sheetViews> <x:sheetView tabSelected="0" workbookViewId="0" /> </x:sheetViews> <x:sheetFormatPr defaultRowHeight="15" /> <x:cols> … </x:cols> <x:sheetData> … </x:sheetData> <x:printOptions horizontalCentered="0" verticalCentered="0" headings="0" gridLines="0" […]

在wpf应用程序中读取excel文件内容

我想在我的C#,WPF应用程序中读取excel文件。 它运行在具有不同版本的Excel的不同版本的机器上(有些版本是excel-2003,有些版本是excel-2007版本,有些机器根本没有安装任何办公软件)。 我希望读取excel文件内容,而不pipe目标机器上是否安装有任何excel版本/软件包。 我目前使用Microsoft.Office.Interop.Excel从Excel文件中读取数据,但是在没有安装任何办公软件的目标计算机上运行我的应用程序,我的应用程序不起作用。 我该怎么做? 我正在做下面的方式,添加命名空间 using Excel = Microsoft.Office.Interop.Excel; 这里是方法的主体: Excel.Application xlApp = new Excel.Application(); Excel.Workbook xlWorkBook; Excel.Worksheet xlWorkSheet; Excel.Range range; xlWorkBook = xlApp.Workbooks.Open(_filePath); List<string> Folders = new List<string>(); try { xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1); range = xlWorkSheet.UsedRange; for (int cCnt = 1; cCnt <= range.Columns.Count; cCnt++) { Folders.Add(((range.Cells[1, cCnt] as Excel.Range).Value).ToString()); } } catch […]

在2007年打开Excel时出错

我有一个C#WPF应用程序,它使用Excel互操作库来生成和打开Excel表。 这工作很好,直到现在在一台XP的机器与Office 2003.但我最近迁移到Windows 2007机器上运行的Excel 2007中运行。 现在我的excel出口不再工作了。 它抛出一个错误,如下所示: System.Runtime.InteropServices.COMException (0x800A03EC): The document is corrupt and cannot be opened. To try and repair it, use the Open and Repair command in the Open dialog box and select Extract Data when prompted. at Microsoft.Office.Interop.Excel.Workbooks.Open(String Filename, Object UpdateLinks, Object ReadOnly, Object Format, Object Password, Object WriteResPassword, Object IgnoreReadOnlyRecommended, Object […]

在C#中将字典写入Excel

我有一个string作为关键字和string列表作为值的字典。 我想将值写入Excel,以便键位于最上面一行,并且它们的值位于相应的列中。 我已经有一些代码将写入到顶部行的键,但我不知道如何做的价值观。 提前致谢! Excel.Application oXL = new Excel.Application(); Excel._Workbook oWB = (Excel._Workbook)(oXL.Workbooks.Add(Missing.Value)); Excel._Worksheet oSheet = (Excel._Worksheet)oWB.ActiveSheet; Excel.Range oRng; string[] saNames = dict.Keys.ToArray(); oRng = oSheet.get_Range("A1", Missing.Value).get_Resize(1, dict.Keys.Count); oRng.Value = saNames; oXL.Visible = true; oXL.UserControl = true;

如何格式化gridview列?

以下是我的代码: var grid = new GridView(); grid.DataSource = myDataset; grid.DataBind(); 我想格式的一些列我的网格货币千位分隔符和小数点'$ 9,999,999.99'。 我出口的网格excel,我想看到的货币格式的值。 我正在运行时创buildgridview。 我没有我的GridView的HTML代码。 我只是将数据集绑定到gridview并导出到excel。 我不会看到HTML格式的gridview。 怎么做?

在SSRS中禁用行组中的单元合并

我在SSRS中创build了几个报告。 例如,有报告显示按性别分组的人数。 如果我将此报告导出到Excel中,则城市列会合并到整个组中。 —————————————————————- | City | Sex | Population | | ============================================================ | | | men | 5582 | | | ————————————– | | The Big City | women | 5468 | | | ————————————– | | | total | 11350 | | ———————————————————— | | | men | 1609 | | | ————————————– […]

将SQL Server 2008 R2数据库导出到Excel 2007时出错

我试图将SQL Server 2008 R2数据库导出到Excel 2007.我在SQL Server Management Studio中使用了导出向导。 我用一个查询来导出表的一些列。 我检查了查询(看到了parsing结果),这很好。 但在REVIEW DATA TYPE MAPPING它显示错误通知。 它正在将varchar转换为LongText 。 但是当我执行这个包的时候,运行fail显示fail状态,比如prepare for execute , pre-execute , execute 。 错误信息是这样的 错误0xc002f210:准备SQL任务1:执行查询“CREATE TABLE Query ( id Long, sku LongText …”失败,出现以下错误:“来自外部数据库驱动程序(1309)的意外的错误。”。可能的失败原因:查询,“ResultSet”属性设置不正确,参数设置不正确或连接未正确build立。 (SQL Server导入和导出向导) 有人有线索最新的错误?