OUTPUT MARGIN SETTING using the SPSS CLIENT

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

OUTPUT MARGIN SETTING using the SPSS CLIENT

Timothy Hennigar-2

Curious issue

 

I use python to run Ctables and call a script to format output prior to exporting to PDF.

The other day SPSS (V23) crashed the computer (since the only thing I was doing was

trying to open SPSS – I will assume it was the culprit)

It forced a power off shut down.

When I re-started the computer and ultimately SPSS V23 – I had lost all my SPSS settings

Ok – I believe I got that all corrected but I am back to an issue that was correctable before but does

not seem to be now. (I say correctable because for some reason once if you went in and changed manually

the margins – the script ran fine forever after – it is no longer doing this – it has maintained the orientation

change from portrait to landscape – but it wont change the margins which are set at 25… pts. – I can change them

manually and print to a PS file and create the PDF from the Adobe distiller – but this is a huge time waster when

I am running this many times a day)

 

Generally,

I call a routine (the entirety of which runs and does everything – EXCEPT set margins – which it did and continues

to do elsewhere) part of which is below -- This continues to run normally on a secondary laptop – without issue –

ITS NOT THE PYTHON SCRIPT

 

 

 

 

def MergeRoutine(InitialCln = False, \

                 Formatting = False, \

                 myor = '2', \

                 mytm = '18', \

                 mylm = '9', \

                 myrm = '9', \

                 mybm = '18', \

                 mypn = '1', \

                 StatTestCP = False, \

                 StatTestP = False, \

                 StatTested = False, \

                 UseTableNumbering = False, \

                 UseTableOfContents = False, \

                 UseHTMLMarks = False, \

                 CleanUp = False, \

                 OutputSPV = False, \

                 OutputPDF = False, \

                 OutputHTML= False, \

                 OutputXLS = False, \

                 OutputPPT = False):

 

 

    import spss  #; help (spss)

 

    import SpssClient

    SpssClient.StartClient()

 

    MySyntaxDocLists = SpssClient.GetSyntaxDocuments()

    MySyntaxDoc = SpssClient.GetDesignatedSyntaxDoc()

 

    MyOutputDocLists = SpssClient.GetOutputDocuments()

    MyOutputDoc = SpssClient.GetDesignatedOutputDoc()

 

    MyCurrentPath = MySyntaxDoc.GetDocumentPath() ; print MyCurrentPath

 

 

 

    # TASK 1 - CLEAN THE OUTPUT LEAVING ONLY THE TABLES

    # TASK 1 - CLEAN THE OUTPUT LEAVING ONLY THE TABLES

    # TASK 1 - CLEAN THE OUTPUT LEAVING ONLY THE TABLES

 

    try:    

 

        if InitialCln:

            MyOutputDoc.ClearSelection()

            MyOutputDoc.SelectAllCharts()

            MyOutputDoc.Delete()

            MyOutputDoc.SelectAllLogs()

            MyOutputDoc.Delete()

            MyOutputDoc.SelectAllNotes()

            MyOutputDoc.Delete()

            MyOutputDoc.SelectAllText()

            MyOutputDoc.Delete()

            MyOutputDoc.SelectAllTitles()

            MyOutputDoc.Delete()

            MyOutputDoc.SelectAllWarnings()

            MyOutputDoc.Delete()

 

            #MyOutputDoc.SaveAs(MyCurrentPath + "_T1_" + ".spv")

       

    except:

        raise

 

 

 

    # TASK 3 - FORMATING OUTPUT

    # TASK 3 - FORMATING OUTPUT

    # TASK 3 - FORMATING OUTPUT

   

    try:

 

        if Formatting:

            #myor = MyOutputDoc.GetPrintOptions(SpssClient.PrintOptions.Orientation)

            #print "myor: ", myor

            MyOutputDoc.SetPrintOptions(SpssClient.PrintOptions.Orientation,myor)

            print "myor: ", myor

   

            #mytm = MyOutputDoc.GetPrintOptions(SpssClient.PrintOptions.TopMargin)

            #print "mytm: ", mytm

            MyOutputDoc.SetPrintOptions(SpssClient.PrintOptions.TopMargin,mytm)

            print "mytm: ", mytm

   

            #mylm = MyOutputDoc.GetPrintOptions(SpssClient.PrintOptions.LeftMargin)

            #print "mylm: ", mylm

            MyOutputDoc.SetPrintOptions(SpssClient.PrintOptions.LeftMargin,mylm)

            print "mylm: ", mylm

   

            #myrm = MyOutputDoc.GetPrintOptions(SpssClient.PrintOptions.RightMargin)

            #print "myrm: ", myrm

            MyOutputDoc.SetPrintOptions(SpssClient.PrintOptions.RightMargin,myrm)

            print "myrm: ", myrm

   

            #mybm = MyOutputDoc.GetPrintOptions(SpssClient.PrintOptions.BottomMargin)

            #print "mybm: ", mybm

            MyOutputDoc.SetPrintOptions(SpssClient.PrintOptions.BottomMargin,mybm)

            print "mybm: ", mybm

   

            #mypn = MyOutputDoc.GetPrintOptions(SpssClient.PrintOptions.StartingPageNumber)

            #print "mypn: ", mypn

            MyOutputDoc.SetPrintOptions(SpssClient.PrintOptions.StartingPageNumber,mypn)

            print "mypn: ", mypn

   

            #MyOutputDoc.SetPrintOptions(SpssClient.PrintOptions.SpaceBetweenItems,)

            #MyOutputDoc.SetPrintOptions(SpssClient.PrintOptions.PrintedChartSize,)

 

            #MyOutputDoc.SaveAs(MyCurrentPath + "_T3A_" + ".spv")

   

    except:

        raise

 

 

ETC..

 

 

 

 

 

 

 

 

Thanks!

 

*********************************

Notice: This e-mail and any attachments may contain confidential and privileged information.  If you are not the intended recipient, please notify the sender immediately by return e-mail, do not use the information, delete this e-mail and destroy any copies.  Any dissemination or use of this information by a person other than the intended recipient is unauthorized and may be illegal.  Email transmissions cannot be guaranteed to be secure or error free. The sender therefore does not accept any liability for errors or omissions in the contents of this message that arise as a result of email transmissions.

 

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: OUTPUT MARGIN SETTING using the SPSS CLIENT

Jon Peck
It is very unlikely that Statistics would actually crash the os.  Most likely the os or hardware failed in some way, and that brought Statistics down.  Even with no user apps running, Windows is actually running hundreds of processes.  On Win 10 and some earlier versions, the Reliability Monitor (search Control Panel/system for it) often gives you useful details on system failure.  It's often better than the Event Viewer logs in my experience, although both can be useful.  (Due to major non-SPSS-related problems with my system, I have become overly familiar with these tools. :-( )

As for the margins issue, you might see whether the STATS OUTPUT ATTRS (File > Set Viewer Output Options (Syntax)) extension command can get this going again.  However, the problem is most likely due to some corruption in the Registry, and deleting the relevant keys has a good change of fixing the problem.

For V23, using regedit, look at
HKEY_CURRENT_USER\Software\JavaSoft\Prefs\com\ibm\/S/P/S/S\/Statistics\23.0
 and all the related keys that look like 23.0 nnnnn.  This will, of course, remove all your preference settings.

Good luck.


On Wed, Oct 4, 2017 at 8:25 AM, Timothy Hennigar <[hidden email]> wrote:

Curious issue

 

I use python to run Ctables and call a script to format output prior to exporting to PDF.

The other day SPSS (V23) crashed the computer (since the only thing I was doing was

trying to open SPSS – I will assume it was the culprit)

It forced a power off shut down.

When I re-started the computer and ultimately SPSS V23 – I had lost all my SPSS settings

Ok – I believe I got that all corrected but I am back to an issue that was correctable before but does

not seem to be now. (I say correctable because for some reason once if you went in and changed manually

the margins – the script ran fine forever after – it is no longer doing this – it has maintained the orientation

change from portrait to landscape – but it wont change the margins which are set at 25… pts. – I can change them

manually and print to a PS file and create the PDF from the Adobe distiller – but this is a huge time waster when

I am running this many times a day)

 

Generally,

I call a routine (the entirety of which runs and does everything – EXCEPT set margins – which it did and continues

to do elsewhere) part of which is below -- This continues to run normally on a secondary laptop – without issue –

ITS NOT THE PYTHON SCRIPT

 

 

 

 

def MergeRoutine(InitialCln = False, \

                 Formatting = False, \

                 myor = '2', \

                 mytm = '18', \

                 mylm = '9', \

                 myrm = '9', \

                 mybm = '18', \

                 mypn = '1', \

                 StatTestCP = False, \

                 StatTestP = False, \

                 StatTested = False, \

                 UseTableNumbering = False, \

                 UseTableOfContents = False, \

                 UseHTMLMarks = False, \

                 CleanUp = False, \

                 OutputSPV = False, \

                 OutputPDF = False, \

                 OutputHTML= False, \

                 OutputXLS = False, \

                 OutputPPT = False):

 

 

    import spss  #; help (spss)

 

    import SpssClient

    SpssClient.StartClient()

 

    MySyntaxDocLists = SpssClient.GetSyntaxDocuments()

    MySyntaxDoc = SpssClient.GetDesignatedSyntaxDoc()

 

    MyOutputDocLists = SpssClient.GetOutputDocuments()

    MyOutputDoc = SpssClient.GetDesignatedOutputDoc()

 

    MyCurrentPath = MySyntaxDoc.GetDocumentPath() ; print MyCurrentPath

 

 

 

    # TASK 1 - CLEAN THE OUTPUT LEAVING ONLY THE TABLES

    # TASK 1 - CLEAN THE OUTPUT LEAVING ONLY THE TABLES

    # TASK 1 - CLEAN THE OUTPUT LEAVING ONLY THE TABLES

 

    try:    

 

        if InitialCln:

            MyOutputDoc.ClearSelection()

            MyOutputDoc.SelectAllCharts()

            MyOutputDoc.Delete()

            MyOutputDoc.SelectAllLogs()

            MyOutputDoc.Delete()

            MyOutputDoc.SelectAllNotes()

            MyOutputDoc.Delete()

            MyOutputDoc.SelectAllText()

            MyOutputDoc.Delete()

            MyOutputDoc.SelectAllTitles()

            MyOutputDoc.Delete()

            MyOutputDoc.SelectAllWarnings()

            MyOutputDoc.Delete()

 

            #MyOutputDoc.SaveAs(MyCurrentPath + "_T1_" + ".spv")

       

    except:

        raise

 

 

 

    # TASK 3 - FORMATING OUTPUT

    # TASK 3 - FORMATING OUTPUT

    # TASK 3 - FORMATING OUTPUT

   

    try:

 

        if Formatting:

            #myor = MyOutputDoc.GetPrintOptions(SpssClient.PrintOptions.Orientation)

            #print "myor: ", myor

            MyOutputDoc.SetPrintOptions(SpssClient.PrintOptions.Orientation,myor)

            print "myor: ", myor

   

            #mytm = MyOutputDoc.GetPrintOptions(SpssClient.PrintOptions.TopMargin)

            #print "mytm: ", mytm

            MyOutputDoc.SetPrintOptions(SpssClient.PrintOptions.TopMargin,mytm)

            print "mytm: ", mytm

   

            #mylm = MyOutputDoc.GetPrintOptions(SpssClient.PrintOptions.LeftMargin)

            #print "mylm: ", mylm

            MyOutputDoc.SetPrintOptions(SpssClient.PrintOptions.LeftMargin,mylm)

            print "mylm: ", mylm

   

            #myrm = MyOutputDoc.GetPrintOptions(SpssClient.PrintOptions.RightMargin)

            #print "myrm: ", myrm

            MyOutputDoc.SetPrintOptions(SpssClient.PrintOptions.RightMargin,myrm)

            print "myrm: ", myrm

   

            #mybm = MyOutputDoc.GetPrintOptions(SpssClient.PrintOptions.BottomMargin)

            #print "mybm: ", mybm

            MyOutputDoc.SetPrintOptions(SpssClient.PrintOptions.BottomMargin,mybm)

            print "mybm: ", mybm

   

            #mypn = MyOutputDoc.GetPrintOptions(SpssClient.PrintOptions.StartingPageNumber)

            #print "mypn: ", mypn

            MyOutputDoc.SetPrintOptions(SpssClient.PrintOptions.StartingPageNumber,mypn)

            print "mypn: ", mypn

   

            #MyOutputDoc.SetPrintOptions(SpssClient.PrintOptions.SpaceBetweenItems,)

            #MyOutputDoc.SetPrintOptions(SpssClient.PrintOptions.PrintedChartSize,)

 

            #MyOutputDoc.SaveAs(MyCurrentPath + "_T3A_" + ".spv")

   

    except:

        raise

 

 

ETC..

 

 

 

 

 

 

 

 

Thanks!

 

*********************************

Notice: This e-mail and any attachments may contain confidential and privileged information.  If you are not the intended recipient, please notify the sender immediately by return e-mail, do not use the information, delete this e-mail and destroy any copies.  Any dissemination or use of this information by a person other than the intended recipient is unauthorized and may be illegal.  Email transmissions cannot be guaranteed to be secure or error free. The sender therefore does not accept any liability for errors or omissions in the contents of this message that arise as a result of email transmissions.

 

===================== 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



--
Jon K Peck
[hidden email]

===================== 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