Loading ...
Sorry, an error occurred while loading the content.
 

Re: Import YUI Datatable into Excel

Expand Messages
  • razer2176
    ... Thanks for the information Satyam, but changing the way employees retrieve the data is not an option. There are already very complex excel sheets in use
    Message 1 of 5 , Apr 28, 2009
      --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
      >
      > The DataTable, specially the scrolling one, has many added elements
      > beyond the plain HTML table, to support many advanced features. Each
      > cell has a div which contains the values displayed, the header cell is
      > split and is actually a separate table which is aligned to the main body
      > by code. The cells there also have divs inside to allow to tell the
      > edges from the center of the heading to make column resizing and
      > reordering possible. All these extra HTML elements would certainly
      > confuse an external application.
      >
      > It might be better, if possible, to avoid all this by providing a link
      > to a server application which could provide the same information in CSV
      > format, straight from the server. Excel usually associates itself to
      > this extension so the dialog to authorize the download will offer
      > opening it with Excel, simplifying the process of selection, copy and
      > paste. Moreover, it would make the whole process immune to any changes
      > that the DataTable might show in the future. If the user customizes the
      > DataTable by reordering columns, hiding and showing them or whatever,
      > the link to the CSV download could be changed, adding and modifying its
      > arguments so that the CSV downloaded reflects these changes.
      >
      > If you are certain your users all have IE, such as within a corporate
      > network, IE supports copying into the clipboard directly:
      >
      > http://msdn.microsoft.com/en-us/library/ms535220(VS.85).aspx
      >
      > Other browsers need add-ons. Googling for "browser clipboard" has
      > provided several references.
      >
      > To use this option, you would access the RecordSet via getRecordSet and
      > loop through it, reading each Record (getRecord) and from each Record,
      > the values stored in them (getData).
      >
      > Satyam
      >
      >
      > ddtechberlin escribió:
      > > The YUI Datatable, especially the scrollable paginated one, is a complicated construct. I think, You can't simply import that in a usefull mannar. But why to take the detour via the HTML-Table? You might make the same request the datatble does and use the raw data returned to create something like CSV from the JSON or XML it returns.
      > >
      > > When You create the the datatable from Markup, You might still have it in the DOM but I am not sure about that. You might inspect Your HTML with Firebug and see if it's still there. I'm sure Satjam knows better about this.
      > >
      > >
      > >
      > >> as the headline says I want to import YUI dataTables into Excel.I converted some of our old tables on our websites to YUI dataTables. Previously we could import the old tables into Excel and work with the data provided by the tables (creating diagrams etc). After converting the HTML tables to YUI dataTables the import does not work anymore. I am trying to import the tables into Excel via a web request. Normaly Excel marks all tables on a website that can be imported and you just need to click on the specific table. Now I dont see any mark for the YUI datatable tho, making it impossible to import it into Excel. Any idea why this is not working?
      > >>
      > >
      > >
      > > HTH,
      > >
      > > Frank
      > >
      > >
      > >
      > > ------------------------------------
      > >
      > > Yahoo! Groups Links
      > >
      > >
      > >
      > > ------------------------------------------------------------------------
      > >
      > >
      > > No virus found in this incoming message.
      > > Checked by AVG - www.avg.com
      > > Version: 8.5.287 / Virus Database: 270.12.6/2084 - Release Date: 04/28/09 06:15:00
      > >
      > >
      >


      Thanks for the information Satyam, but changing the way employees retrieve the data is not an option. There are already very complex excel sheets in use which are built from data provided by the tables that are built by markup. I cant say how the change of retrieval of information would impact these excel sheets. Anyways, as I said above,I wrapped the div in where the yui table is rendered in, into another table. This kinda fixed the import into excel. At last I can select the outer table now and excel pulls in all information. Even these that are inside the fields of the yui datatable.

      Unfortunatly the wrapping into the table brought up another problem. IE freezes when I request the page, it works excellent in FF tho. I have seen on the YUI page that there is a problem in IE with yui tables nested into other tables and the fix for it. I will give that a try tomorrow.

      I used a scrollabe datatable because I need a fixed header part. There are so many rows and columns in the table that, when scrolling to the bottom, you often get confused where the cells belongs to.

      Another option I have implemented is that employees can show and hide columns via checkboxes. Each checkbox belongs to one column of the datatable. On check or uncheck it simply calls .showColumn() or .hideColumn() of the datatable. This way employees can pick a set of columns and then import them into excel.

      cheers again for the reply,

      raz
    Your message has been successfully submitted and would be delivered to recipients shortly.