BookmarkSubscribe
Choose Language Hide Translation Bar
CS13
Community Trekker

Sizing Data Table in Display Box

I have searched ad nauseum and cannot not find a solution to my problem.  I'm trying to set up a window for my users that dynamically updates some summary data and two plots based on their selection.  I'm working with display boxes, but when I append my summary data table, no matter what I've tried, the data table is always smaller in width such that the last column is cut off, leaving me with what amounts to a horizontal scroll box.  I cannot seem to figure out how to widen the data table in my script.  I've tried a number of different display boxes with ample pixel widths but it is as if there's some hidden default size of the data table that's slightly smaller than the actual size.  Nothing external to the data table seems to be limiting its size.  Here is an example of the code:


pb1 = Panel Box ( );
my_report = summarydt << Get As Report;
pb1 << Append(my_report);
sb << Append(pb1);

 

nw1=New Window( "New Window",
 H List Box(Text Box("ABC")),
 Lineup Box( N Col( 2 ),
  H List Box( ),
 ),
 Lineup Box( N Col( 2 ),
  lb1_v = V List Box(
   lb1 = List Box(lot_list, 
     width( boxwidth ),
     max selected( maxsel ),
     nlines( boxlines ),
     button_press)
  ),
  V List Box(
   pb = Scroll Box( Size(1200,650) )
  )
 )
)

0 Kudos
2 REPLIES 2
Highlighted
cwillden
Super User

Re: Sizing Data Table in Display Box

Hi @CS13

I've never had much luck with << Set Width for display boxes for some reason.  They never seem to respond to that, even though the log doesn't display an errors.

You could try << New Data Box() instead of << Get As Report, which seems to be more amenable to auto-stretching.  Instead of converting the data table to a display box table, it actually inserts the table as an object right into your report.  I tried the following and found the PanelBox will grow as large as your window.

bigClass = Data Table( "Big Class" );
summarydt = bigClass << Summary(
	Group( :sex ),
	N( :height ),
	N( :weight ),
	Mean( :height ),
	Mean( :weight ),
	Std Dev( :height ),
	Std Dev( :weight ),
	Min( :height ),
	Min( :weight ),
	Max( :height ),
	Max( :weight ),
	Freq( "None" ),
	Weight( "None" )
);

sb = New Window("Testing");
pb1 = Panel Box("Summary Data Table");
my_report = summarydt << New Data Box();
//my_report = summarydt << Get As Report;
pb1 << Append( my_report );
sb << Append( pb1 );

I don't know if this is compatible with what you want to do, but thought it might help.

-- Cameron Willden
CS13
Community Trekker

Re: Sizing Data Table in Display Box

cwilden - Thanks for the response and the suggestion.  I tried it out and your method requires that the source data table to be open or it closes the entire window.  My intent was to write the display boxes for all objects to the window and close the objects.  I also noticed that it's relatively unformatted and displays the working data table framework.  Not as elegant, but not a total deal breaker.

 

I'm continuing to test this and it appears that with fewer columns, eventually the data table will display in full and the display box will auto-size as it gets smaller.  It's as if there's a maximum width somewhere out there associated with reporting out a data table where if your table exceeds this value, it reverts to a scroll box.

0 Kudos