|
Hi list,
is there a way to display some picture from a location on the hard drive (or from the web, for that sake) in the SPSS output? I'd need that since i have a webservice that produces charts from my initial analysis in SPSS. It would be great to have the results in Viewer window on demand. thanks -blaz |
|
Hi,
Basically,
it's not a problem (with scripts), but solution depends on the SPSS
version you're using. Which version it is?
Regards,
Mariusz
|
|
15 and 17 - currently in migration process.
On Fri, Mar 27, 2009 at 16:44, Trejtowicz, Mariusz <[hidden email]> wrote:
|
|
In reply to this post by Blaz B
One possible solution for SPSS 17 + installed Python Plug-in is to use
HTML text field: *** html insert script: lines 2-4 contain script parameters *** . begin program python. strText = "<html><img src=\"http://www.math.yorku.ca/SCS/Gallery/minard/minard-odt.jpg\" /></html>" strHeader = "Minard Chart" intTextHeight = 800 import SpssClient SpssClient.StartClient() objOutputDoc = SpssClient.GetDesignatedOutputDoc() objOutputItems = objOutputDoc.GetOutputItems() objOutputItem = objOutputItems.GetItemAt(0) for i in range(objOutputItems.Size()): objOutputItem = objOutputItems.GetItemAt(i) if objOutputItem.GetType() == SpssClient.OutputItemType.HEAD: objHeaderItem = objOutputItem.GetSpecificType() rangeMin = i objNewHeader = objOutputDoc.CreateHeaderItem(strHeader) index = objHeaderItem.GetChildCount() objHeaderItem.InsertChildItem(objNewHeader,index) objNewItem = objHeaderItem.GetChildItem(index) objOutputDoc.ClearSelection() objNewItem.SetSelected(True) objOutputDoc.Promote() objNewItem.SetSelected(False) for i in range(rangeMin,objOutputItems.Size()): objOutputItem = objOutputItems.GetItemAt(i) if objOutputItem.GetType() == SpssClient.OutputItemType.HEAD: objHeaderItem = objOutputItem.GetSpecificType() objNewText = objOutputDoc.CreateTextItem(strText) objHeaderItem.InsertChildItem(objNewText,0) objTextItem = objHeaderItem.GetChildItem(0) objTextItem.SetHeight(intTextHeight) SpssClient.StopClient() end program. ********* end . To execute this script you need: - Python plug-in - any output window opened Pros: - graphs nicely exportable to HTML Cons: - objects resize when reopening a saved output - output window must be refreshed after script execution - printing, export to other formats (??) It is also possible to paste an object from clipboard into SPSS output. This leads to other possibility, unfortunately, capturing an image from file/web to clipboard might be quite complicated. BTW, why are you using web service for producing charts? Best regards, Mariusz Trejtowicz -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Blaz B Sent: Friday, March 27, 2009 3:39 PM To: [hidden email] Subject: import a picture into SPSS output - viewer Hi list, is there a way to display some picture from a location on the hard drive (or from the web, for that sake) in the SPSS output? I'd need that since i have a webservice that produces charts from my initial analysis in SPSS. It would be great to have the results in Viewer window on demand. thanks -blaz ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
| Free forum by Nabble | Edit this page |
