0

Is there a way to use SPSS syntax or r/python to export custom tables to jpg or some other file format? I often like to use ctables in PPT decks but find it extremely cumbersome to run syntax and 1x1 right-click-copy the custom tables output to PPT slides.

In short, I am looking for SPSS-centric ways to "reproduce" my research.

2 Answers 2

1

There are several ways to do this.

You can use the OUTPUT EXPORT command.

You can use OMS to captures selected tables, charts, etc.

You can use a custom Python or Basic script.

The output formats include Ppt, Word, Excel, PDF, HTML, XML, plain text, and tabbed text, among others. A variety of image formats are available for graphcs.

1
  • Thanks, but could you provide an example of using syntax (or any method) to only the custom table as an image?
    – Btibert3
    Jan 11, 2012 at 15:09
0

If you really want the table as an image rather than any of the other formats, it is a little more complicated. OUTPUT EXPORT and OMS only support images for graphics, not tables.

You can use CopySpecial to put a table on the clipboard as a emf, jpg, png. This would require a script.

Use the SetSelected api to select the table you want to copy. Use the CopySpecial api to copy the table to the clipboard in your preferred image format. Use COM automation to paste special the image into your target app.

But it generally works better for tables not to use an image format. OMS or OUTPUT EXPORT, of course, support many formats. With OUTPUT EXPORT, you would choose to export selected, and you could either select manually or use a script with SetSelected and appropriate criteria. That could be simplified with the SPSSINC MODIFY OUTPUT extension command and a small scriptlet just to make the selections.

HTH, Jon

2
  • Thx Jon, where can I find documention or examples of using the SetSelected and CopySpecial API?
    – Btibert3
    Jan 31, 2012 at 17:12
  • These are documented in the Python scripting reference that is added to the help menu when you install the Python Essentials.
    – JKP
    Feb 8, 2012 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.