How to export datagrid to Excel

I want to export data from a datagrid to Excel. I heard about
the use of Clipboard, but can't figure out how to use it.
Can anyone give me a nice solution, how to do this?
Thx

Hi michael,
I'm trying to do this: in my application I have a datagrid
and I have a button to export the datagrid in Excel. When the user
click on the button, I need to open a new html window where the
data are showed in the excel format (may be also csv).
I read that you have a solution to show the excel document.
Are you available to share an example of the code or provide me a
link on the web where I can find it?
Any suggestion will be appreciated.
Thank you very much.
Regards

Similar Messages

  • Unexplained Error while Exporting Datagrid to Excel

    Everything else seems to work ok (e.g. paging, master/detail functions, etc.) but the Export Datagrid to Excel isn't. I get the following:
    ErrorWe Recommend:Refreshing the page.Contacting your Portal administrator if problems persist.Accessing this Portlet at a later time.
    I am exporting it out as an attachment so Excel opens for the user. It works fine outside of the portal. Anyone know what I'm doing wrong?
    Paul

    I'm using the standard Microsoft ASP.NET 1.1 Datagrid control. Here is my routine that gets launched from a LinkButton Control...
    privatevoidExportDataGrid(){Response.Clear();Response.Buffer= true;Response.ContentType = "application/vnd.ms-excel"; Response.AppendHeader("Content-Disposition", "attachment;filename=Lead_FeedBack.xls");Response.Charset = "";
    this.EnableViewState = false; System.IO.StringWriter oStringWriter = newSystem.IO.StringWriter(); System.Web.UI.HtmlTextWriter oHtmlTextWriter = newSystem.Web.UI.HtmlTextWriter(oStringWriter);
    // Create a DataGrid control and Pass content from first DataGrid to itDataGrid DataGrid2 = newDataGrid();DataGrid2 = DataGrid1;this.RemoveControls(DataGrid2);
    //Lets make it a generic looking spreadsheetDataGrid2.HeaderStyle.BackColor = Color.LightGray;DataGrid2.AlternatingItemStyle.BackColor = Color.White;DataGrid2.PagerStyle.BackColor = Color.LightGray;DataGrid2.HeaderStyle.Font.Bold = true;DataGrid2.RenderControl(oHtmlTextWriter);
    Response.Write(oStringWriter.ToString()); Response.End(); }
    Paul

  • How to export report to excel and to text file in previewer

    How to export report to excel?
    And, it takes long time for generate report to rtf or pdf file in previewer.
    How to speed up the process? or, it's better generate report to text file directly by Run_product?
    Please help!

    You can generate report to tab delimite format that can be imported to excel.
    As for the performance question, because reports can't specify what format when you run against previewer, so I don't know what previewer you are talking about. Generate to file is always faster than to your application previewer (assume) because you have one more step after output generated in the file: read from file and render it. Depends on the render and size of the output, it may have significant performance difference.
    Thanks,
    -Shaun

  • Export DataGrid to Excel

    Hello,
    I populated a datagrid using a query. Now I want to export
    the content of the datagrid to Excel.
    Is this possible?
    I don't want to use the query to Export to Excel.
    I want to Export from the datagrid itself.
    Anyone has an idea how to export my datagrid to Excel in
    flex?
    Thx

    Code is below. I simplified it a bit for this post, I hope it
    still works ;-)
    Couple of assumptions
    1) My dataproviders are XMLListCollections - you have to
    adapt that if you are using something else
    2) I set a dataField on the datagrid columns for the XML
    attribute I want to read
    I am sure there are better / more generic ways of doing this,
    but this works for me right now and I blew a lot of time on this
    when I first came across the problem. If you find a better solution
    let me know ;-)
    public static function
    copyGridData(srcDataGrid:DataGrid):void {
    var outputA:Array = new Array();
    // header
    var headerA:Array = new Array();
    var columns:Array = srcDataGrid.columns;
    for each (var col:DataGridColumn in columns ) {
    headerA.push(col.headerText);
    outputA.push(headerA.join("\t"));
    // data
    var data:XMLListCollection =
    XMLListCollection(srcDataGrid.dataProvider);
    for each (var r:XML in data) {
    var rowA:Array = new Array();
    for each (var col2:DataGridColumn in columns) {
    if (col2.dataField != null) {
    rowA.push(r.attribute(col2.dataField.substr(1,col2.dataField.length-1)));
    } else {
    rowA.push("");
    outputA.push(rowA.join("\t"));
    // copy onto the clipboard
    System.setClipboard(outputA.join("\n"));
    Alert.show("Data copied to the clipboard.\nOpen target
    application (e.g. Excel) and paste data.", "Data Copy");

  • How to export metadata to Excel or txt?

    Somebody knows how to export all the metadata from Lightroom to excel or to txt?????
    thanks!!!!

    And I did say it depends how geeky you are! With the SQL approach, you have access to everything in the catalogue rather than the subset available to the SDK. No pain, no gain?

  • PTWC 2.2 and Export Datagrid to Excel

    I have a portlet with an Image Button control that will export a Datagrid to Excel. Using the PT Web controls 2.2 I get a JavaScript Error (Object is Null or Nothing). It works fine outside of the portal. My current work-around is to use an IFrame. Has anyone else encountered this?
    Paul

    Have a look at this.
    http://www.cristalab.com/tips/exportar-datos-de-flex-a-excel-c70300l/

  • Export DataGrid into Excel

    Hi All,
       Can anybody share the code to export datagrid into an excel ?
    Thanks,
    Ravisha

    you can send the datagrid rows/values to server side and use some serverside script to create excel.

  • How to export alv into excel sheet without using toolbar button

    hi,
    i have developed ALV using FM methord on that i have created one button when user will click on that button
    hole ALV should export in to excel as it is and that ALV is Heaving top of page contain also i want that shuld
    also copy please help me for that please send me the sample code for that
    Edited by: ankita khare on Nov 3, 2008 9:42 AM

    Check this:
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = 'C:/test.xls'
          filetype                = 'ASC'
          write_field_separator   = 'X'
        TABLES
          data_tab                = t_output
    Regards.

  • Flex 4: Exporting DataGrid to Excel qs

    Howdy,
    I already read the "Feature Specs" for Flex 4.
    And I don't think there's any feature that's going to export DG to Excel but I might be wrong.
    But I would like to hear someone from Adobe to confirm it before I try using as3xls library.
    Appreciate the help.
    Thank you.

    You will be able to do that in AIR2, see this example from Christophe Coenraets:
    http://coenraets.org/blog/2009/11/open-in-excel-another-air-2-mini-sample/
    Cheers,
    Oleg.

  • How to export Data to excel in wp8

    Hi,
    I have a requirement like export data to excel. I have googled and find OpenXML.Silverlight.Spreadsheet.WP8.dll . Its working good. I want to know is there any Other way to create an excel file and export data to Excel sheet in WP8..?
    I googled and find EPPlus.dll but it is throwing an exception. The exception is "A reference to a higher version or incompatible assembly cannot be added to a project."  
    Is there any another way to export data to excel sheet.? Please support me with answers.
    Thanks in Advance.

    Syncfusion controls for windows phone has a library for creating spreadsheets xlsio.  It i free if you qualify for community license
    https://www.syncfusion.com/products/communitylicense
    https://www.syncfusion.com/products/file-formats/xlsio

  • How to export page to excel

    Hi all,
    I want to export complete page to excel and pdf format.
    Can anybody give me the step by step procedure to export the page to excel and pdf format.
    thnks in advance
    mani

    Hi Mani,
    Printing to PDFs: [http://download.oracle.com/docs/cd/E14373_01/appdev.32/e13363/pdf_report.htm#BABFAJII]
    You can export reports to Excel (there's a option to do this on the report's attributes - export as CSV). Exporting an entire page to Excel probably wouldn't work - you'd need the equivalent of File/Save As from the browser menu as save the entire page as HTML. But, then, HTML pages are generally opened in either a browser or Word anyway
    Andy

  • How to export Outline to Excel in Essbase

    Hi,
    Could anyone can tell me how can i export essbase outline to excel.
    thanks

    Hi,
    Please do the below to get all dimension members as in hierarchy in excel.
    Select "All levels" in Hierarchy excel in Options.
    Select "Navigate without data"
    Select appropriate indentation
    Select "Allow double click operations" in mouse operations
    Put the dimension that you need all members, in row.
    double click the dfimension name and you will see you full dimension hierarchy [obviously without data].
    Cheers
    RS

  • Export DataGrid to Excel. (Need Help @_@)

    Hi Guys..
         im newbie flex developer, i just want to ask how im going to export may data to excel??

    http://code.google.com/p/as3xls/

  • How to Export Report to Excel

    Post Author: ram323
    CA Forum: Exporting
    I am using Visual Studio 2005 and Crystal Reports XI. I tried to export my report to Excel in Crystal Reports XI, File - Export - Export Report and I can see my reports in Excel (Data Only) the way I want to see them. My problem is when I call my report from my Web Application using VS 2005 and SQL 2005 database, and export my report to excel using the report viewer, it looks different....Is there any way I can use the Excel set up in Crystal Reports...meaning same look what I saw when I tried to export in Crystal reports???...or is there any functions that I forgot to enable??..if this should be done in a code, can you show me or send me a code????..Please.. need your help!  Thank you much!!!!

    You have that button where you need to click and the select the output format:
    -Vaibhav Chaudhari

  • How to export output to Excel (or file that can be opened by excel).

    Hi,
    Have just installed SQL Developer.
    Have entered an SQL statement and Executed the Statement. Now I want to save the result in Excel. But I cannot find a way to save the result. When I choose to save I only save the SQL statement.
    Please advise.
    Thanks,
    Anja

    Found it!
    Just do a right click somewhere on the statement or output and export as csv.
    Anja

Maybe you are looking for