I would like to be able to export an EViews Table object to Excel and retain the original formatting and data. Also, it would be great if multiple tables in a single workfile page could be exported as separate worksheets in a single workbook. Are there any plans to include this in a future EViews release?
I could probably implement a not-so-elegant version using EViews user objects and an open source Excel API like Apache POI (https://poi.apache.org/spreadsheet/index.html), but was hoping to avoid doing so. It seems like it would be straightforward for you since you already export table objects to other file formats.
Export EViews Table Object to Excel
Moderators: EViews Gareth, EViews Moderator
-
- EViews Developer
- Posts: 795
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Export EViews Table Object to Excel
This isn't automated, but you can export the table to an RTF:
[tablename].save(t=rtf) "output file path"
Then open the file in Word. Once open, copy the entire table to the clipboard, then go to your Excel spreadsheet and Paste. Worked for me.
[tablename].save(t=rtf) "output file path"
Then open the file in Word. Once open, copy the entire table to the clipboard, then go to your Excel spreadsheet and Paste. Worked for me.
Re: Export EViews Table Object to Excel
Thanks, EViews Steve. That kind of works for me, but I lose much of the formatting (like column widths and indentation) after the paste into Excel. Also, the whole point of using EViews table objects is to avoid having to cut-and-paste into Excel and the "fix" the formatting. That of course is both error prone and time consuming. Even if you could just provide accessor procs to all of the attributes (i.e., width, font, indent, etc.) for each cell in the finished table, it would be easy to iterate cell-by-cell and make an Excel version using an API.
-
- EViews Developer
- Posts: 795
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Export EViews Table Object to Excel
I agree it would be nice to have an Excel output format for tables - but to keep all the formatting the same we'd have to understand how all of that formatting is stored in an Excel layout and recreate it correctly. And even then there would probably still be issues with fonts, column widths not being exact, and then the problem with Excel changing the formatting of numbers after the spreadsheet gets loaded, etc. Not impossible, but not easy either.
Have you tried our OLE object support yet? If you want to keep the table layout formatting exactly the same, you could copy the EViews table into the clipboard, then switch to Excel and then right-click a cell and select Paste Special, then select either the "EViews Object" or "Picture (Enhanced Metafile)". This preserves the look of the table - though the individual values will not be editable. If you want to keep the values editable, re-do the Paste Special, but this time select the "Paste as link" option, then select the "EViews Object". This still preserves the formatting but now you can double-click the table in Excel to re-open it in EViews so you can edit the values. This is part of our OLE object support in EViews 9.
Steve
Have you tried our OLE object support yet? If you want to keep the table layout formatting exactly the same, you could copy the EViews table into the clipboard, then switch to Excel and then right-click a cell and select Paste Special, then select either the "EViews Object" or "Picture (Enhanced Metafile)". This preserves the look of the table - though the individual values will not be editable. If you want to keep the values editable, re-do the Paste Special, but this time select the "Paste as link" option, then select the "EViews Object". This still preserves the formatting but now you can double-click the table in Excel to re-open it in EViews so you can edit the values. This is part of our OLE object support in EViews 9.
Steve
Return to “Suggestions and Requests”
Who is online
Users browsing this forum: No registered users and 16 guests