export-to-excel

Exporting Django Objects model in CSV

会有一股神秘感。 提交于 2019-12-25 04:57:12
问题 I want to create an extra action for the admin in django-admin. I want to be able to export the data as CSV format. I have written the following code in my admin.py : from django.contrib import admin from .models import News, ResourceTopic, Resource, PracticeTopic, Practice, Contacts, Visualization import csv from django.utils.encoding import smart_str from django.http import HttpResponse admin.site.register(News) admin.site.register(ResourceTopic) admin.site.register(Resource) admin.site

MVC 4 Export to Excel Failing

≡放荡痞女 提交于 2019-12-25 02:06:30
问题 I have the following code in a controller in and MVC 4 application Response.AddHeader("Content-Disposition", "attachment; filename=export.xml"); Response.AddHeader("Content-type", "vnd.openxmlformats-officedocument.spreadsheetml.sheet"); var rows = data.Split('\n'); var sheet = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine; sheet += "<?mso-application progid=\"Excel.Sheet\"?>" + Environment.NewLine; sheet += "<ss:Workbook xmlns:ss=\"urn:schemas-microsoft-com:office

exporting a multidimensional array from R to a spreadsheet

老子叫甜甜 提交于 2019-12-24 22:44:34
问题 So I am trying to export a multidimensional array from R into excel, google sheets, or some similar spreadsheet program. I would also be okay with exporting into a text file as long as it is in the format I need. I have done some web-surfing but haven't progressed too much. Note: I have some programming experience (about 4 semesters) but am relatively new to R. I am working in group with 3 others who have almost no prior programming experience. Our array is 7x100x100 (though I may have to

Filter Excel Output using MVC 3

♀尐吖头ヾ 提交于 2019-12-24 21:22:15
问题 I am trying to filter the rows that are sent to a excel file. I have been able to figure out how to export row data to excel, but now I need to send filtered data to an excel sheet since I added a version dropdown. What happens is I select the version I want to see from the dropdown. Ex. the version is 12.1. The view will only bring back data that has a version number 12.1 associated with it. Now when I want to download the filtered rows in an excel file. I press the download to excel file

Trying to strip html from Datatables during export

纵然是瞬间 提交于 2019-12-24 15:21:39
问题 I'm using datatables exactly as the example here. So to export data I used a function that allows me to change <br> with newlines in excel. I used this: return column === 5 ? data.replace( /<br\s*\/?>/ig, "\n"): data; However when I try to add a second change I want to make to a different column it doesn't work... I tried adding this right below the first working replacement: return column === 1 ? data.replace( /<.*?>/ig, ""): data; I want to basically strip all html tags after first changing

SQL Server stored procedure to export Select Result to CSV

大城市里の小女人 提交于 2019-12-24 13:26:28
问题 In my stored procedure, I want to export select result to a .CSV file. I need to write a stored procedure which selects some data from different tables and saves it to a .CSV file. Selecting part is ready SELECT DISTINCT PER.NREGNUMBER_PERNUM AS [Registration Number], PER.CFAMNAME_PER AS [Family Name], PER.CGIVNAME_PER AS [Given Name], CONVERT(varchar(10), CONVERT(date, PER.DBIRTHDATE_PER, 106), 103) AS [Birth Date], PER.CGENDER_PERGEN as [Gender], PHONE.MOBILE_NUMBER FROM PERSON AS PER LEFT

Suppressing page breaks upon exporting a Reporting Services report to Excel

假装没事ソ 提交于 2019-12-24 10:53:05
问题 When exporting a multi-page report from SQL Server 2008 Reporting Services to Excel, by default, pages in the report created by a page break are sent to separate worksheets in the Excel file. While this is fine most of the time - sometimes it's not. Right now, I'd like to be able to prevent those page breaks from causing additional worksheets to be created - I really would like to export all my pages into a single Excel worksheet and basically just ignore the page breaks (or replace them with

Export multidimensional array in excel or csv in laravel

℡╲_俬逩灬. 提交于 2019-12-24 08:23:34
问题 Really it's complicated situation for me right now. Here I have to export multidimensional array data into excel which is looks like below image, but I'm unable to make it possible. Please help me to export the multidimensional array data to export in excel. I have an array from relational query like: $array = [ 0 => [ 'name' => 'Devat Karetha', ], 1 => [ 'name' => 'John Doe', 'schools' => [ 0 => [ 'school_name' => 'ABC School', 'school_address' => 'ABC Address', ], 1 => [ 'school_name' =>

Export hidden fields to Excel using KendoGrid throw error

拥有回忆 提交于 2019-12-24 08:23:17
问题 I have a button Export Excel: <script type="text/x-kendo-template" id="template"> <div class="toolbar"> <button id="ExportExcel" class="btn btn-default " onclick="ExportExcel(); return false;"><i class="fa fa-file-excel-o"></i> Exportar</button> </div> </script> Normally I have a function to Export Excel like this: function ExportExcel() { $("#lstEmployees").data("kendoGrid").saveAsExcel(); // export grid to excel } And below I populate grid like this: function onPageOperationsSuccess

Uploading Excel files to dropbox?

吃可爱长大的小学妹 提交于 2019-12-24 07:29:32
问题 I am trying to upload a file I am creating using ExcelWriter via pandas. Here is what I have so far: output = BytesIO() writer = pd.ExcelWriter(output, engine='xlsxwriter') df1.to_excel(writer, sheet_name='raw_data', index=False) df_totals.to_excel(writer, sheet_name='totals', index=False) writer.save() output.seek(0) dbx.files_upload(output, 'my_path/test.xlsx') It is throwing the error: TypeError: expected request_binary as binary type, got <class '_io.BytesIO'> The file_upload method takes