Subscribe Bookmark RSS Feed

How can I send a TableBox() to PowerPoint with an associated title?

Highlighted
DQR

New Contributor

Joined:

Nov 18, 2016

Hi,

 

I can create a chart in the Graph Builder and then send a copy of that chart, together with its title, to PowerPoint within a JSL script by doing essentially this:

 

   gb = Graph Builder( etc etc );
   gbb = report(gb)[GraphBuilderBox(1)];
   gbb << save presentation("MyFile.pptx")

 

This sends the title of the chart to the title bar of a PowerPoint slide, and puts the chart itself underneath it - which is exactly what I want. I can see from the tree structure of GraphBuilderBox(1) that the title itself is actually located in a TextEditBox within about five nested display boxes - so presumably when GraphBuilderBox(1) is sent to PowerPoint, the "<< save presentation()" property allows PowerPoint to recognise that it is supposed to be interpreted as the title of the slide.


I now want to do essentially the same thing with a TableBox (which obviously wasn't created within the Graph Builder), and an arbitrary title that I want to assign to that TableBox. What is the structure of display boxes that I need to assemble to make this work?

 

Many thanks for any suggestions

1 ACCEPTED SOLUTION

Accepted Solutions
ian_jmp

Staff

Joined:

Jun 23, 2011

Solution

Something like:

 

Names Default To Here( 1 );

New Window( "Example",

    ob = Outline Box( "Table",

                Table Box(

                        String Col Box( "names", {"x", "y", "z"} ),

                        Number Col Box( "values", {11, 22, 33} ),

                       Plot Col Box( "values", {11, 22, 33} )

             ) ) );

ob << save presentation("$DESKTOP/MyFile.pptx");

 

2 REPLIES
ian_jmp

Staff

Joined:

Jun 23, 2011

Solution

Something like:

 

Names Default To Here( 1 );

New Window( "Example",

    ob = Outline Box( "Table",

                Table Box(

                        String Col Box( "names", {"x", "y", "z"} ),

                        Number Col Box( "values", {11, 22, 33} ),

                       Plot Col Box( "values", {11, 22, 33} )

             ) ) );

ob << save presentation("$DESKTOP/MyFile.pptx");

 

DQR

New Contributor

Joined:

Nov 18, 2016

Ha!  It's as simple as that - and I infer that I could replace that TableBox by any other structure I wanted to export, with the title of the slide being taken from the title of the OutlineBox.  So in a nutshell, just put it in an OutlineBox and title it accordingly.

 

Many thanks again, Ian!