Saving tables as images Eviews 13, graphics issue

For notifying us of what you believe are bugs or errors in EViews.
Please ensure your copy of EViews is up-to-date before posting.

Moderators: EViews Gareth, EViews Moderator

ErikG
Posts: 78
Joined: Wed Jan 23, 2013 1:18 am

Saving tables as images Eviews 13, graphics issue

Postby ErikG » Thu Nov 03, 2022 4:30 am

Hi,

When saving an Eviews table as emf/png/ or similar I am getting a white area in the upper right hand corner that is not present in the table in the Eviews workfile. This was not the case prior to my Eviews 13 update.

I simplified my code as an example for you:

Code: Select all

WfCreate(page=a) C:\temp\temp.wf1 a 2007 2010

Series year = 1999
Series vX = 3
Series vY = 4
Series vZ = 5

Group g1 Year vx vy vz
Stomna(g1, m1)
m1 = @Transpose(m1)
Freeze(t1) m1.table
Call FormatlandscapeTable(t1)
t1(1,1) = "Title"
t1(2,1) = "Percent"
t1(3,1) = "X"
t1(4,1) = "Y"
t1(5,1) = "Z"



t1.save(t=emf, n="-") C:\temp\Test

Subroutine FormatLandscapeTable(Table TAB)
   tab.deleterow(1) 2
   !kr = tab.@rows
  !kc = tab.@cols

   tab.setformat(2) f.0
   tab.setformat(3:!kr) f.1
  tab.insertrow(!kr+1) 2
  tab(!kr+2,1) = "Date and time"
  tab.setlines(@All) -a

  For !i = 3 To !kr Step 2
    tab.setfillcolor(!i) @rgb(196, 226, 255)
  Next

  For !i = 1 To 2
   tab.setfillcolor(!i) @rgb(54, 100, 139)
   tab.settextcolor(!i) White
  Next

  tab.setfillcolor(!kr+2) White
EndSub

Shell C:\temp\Test.emf



Enterprise edition october 11 build

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: Saving tables as images Eviews 13, graphics issue

Postby EViews Jason » Thu Nov 03, 2022 12:47 pm

In the spreadsheet views of matrices, groups, and series, EViews places just below the column labels meta information about the object. This normally includes any history information (i.e. 'last updated') and remarks. The rows that contain this information, has special row centering formatting. When saving tables to file which have this formatting, preserving the onscreen appearance is not trivial.

In your program, you removed one of the rows which has this formatting and left the line after to modify. The first line of subroutine FormatLandscapeTable reads

Code: Select all

tab.deleterow(1) 2

This removes the column labels and the history information. The line after the history information is blank but has the row centering formatting. I suggest also removing that line and then inserting a new blank which will not have the centering formatting.

Code: Select all

tab.deleterow(1) 3
tab.insertrow(1) 1


The resultant emf should now appear as expected.

Note: the issue also appears in versions prior to 13 as well.

ErikG
Posts: 78
Joined: Wed Jan 23, 2013 1:18 am

Re: Saving tables as images Eviews 13, graphics issue

Postby ErikG » Fri Nov 04, 2022 6:56 am

Excellent, thanks!


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 19 guests