Digital Developer Conference: a FREE half-day online conference focused on AI & Cloud – North America: Nov 2 – India: Nov 9 – Europe: Nov 14 – Asia Nov 23 Register now

Close outline
  • United States
IBM?
  • Site map
IBM?
  • Marketplace

  • Close
    Search
  • Sign in
    • Sign in
    • Register
  • IBM Navigation
IBM Developer Answers
  • Spaces
    • Blockchain
    • IBM Cloud platform
    • Internet of Things
    • Predictive Analytics
    • Watson
    • See all spaces
  • Tags
  • Users
  • Badges
  • FAQ
  • Help
Close

Name

Community

  • Learn
  • Develop
  • Connect

Discover IBM

  • ConnectMarketplace
  • Products
  • Services
  • Industries
  • Careers
  • Partners
  • Support
10.190.13.195

Refine your search by using the following advanced search options.

Criteria Usage
Questions with keyword1 or keyword2 keyword1 keyword2
Questions with a mandatory word, e.g. keyword2 keyword1 +keyword2
Questions excluding a word, e.g. keyword2 keyword1 -keyword2
Questions with keyword(s) and a specific tag keyword1 [tag1]
Questions with keyword(s) and either of two or more specific tags keyword1 [tag1] [tag2]
To search for all posts by a user or all posts with a specific tag, start typing and choose from the suggestion list. Do not use a plus or minus sign with a tag, e.g., +[tag1].
  • Ask a question

Row label height

06000295WQ gravatar image
Question by JOgawa  (0) | May 01, 2014 at 08:18 PM spssstatisticsextensibilitypython

Hi there.

Is there still no way within the Python programming interface to set the height of a row label row (and the data cells in that row too), or barring that, to trigger a reformatting of a row label height?

I ask because I have several Python customfunctions, which I access through MODIFY TABLES run on Frequency tables, that change row label column widths. After I have run MODIFY TABLES, there are several pivot tables that have row labels that are too TALL. They should be only one line high that are 2 or 3 lines high.

I also have dimension labels, for which I have changed the width of the cell through a different customfunction, that are too SHORT. They should be 3-4 lines high but are only 2 lines high.

I am on SPSS Client 21.0.0.2, with the latest version of MODIFY TABLES.

Here is the code for one of the customfunctions:

   def ResizeCornerLabel(obj, i, j, numrows, numcols, section, more, custom):
 

       """ Show corner (dimension) label, and then resize the column based
 

           on the length of the contents. Custom parameter 1 is maximum dimension
 

           label column width in characters, default is 60. Custom parameter 2 is
 

           character width in points, default is 5. """
 



       if section != 'labels':
 

           tkMessageBox.showinfo("","Only works for labels!")
 

           return
 



       max_width = custom.get("maxwidth", 60)
 

       char_width = custom.get("charwidth", 6)
 



       obj.ShowHiddenDimensionLabelAt(1,obj.GetNumColumns()-1)
 



       label_len = len(obj.GetValueAt(1,0))
 



       if label_len <= max_width:
 

           label_points = label_len * char_width
 

       else:
 

           label_points = max_width * char_width
 



       obj.SetRowLabelWidthAt(1,obj.GetNumColumns()-1,label_points)
 


Thanks for any help that you can give!

J

People who like this

  0
Comment
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

1 reply

  • Sort: 
270002VCWN gravatar image

Answer by JonPeck (4671) | May 01, 2014 at 10:47 PM

This isn't a MODIFY TABLES issue. When the apis are applied, the table should automatically resize the other dimension. I am surprised that it doesn't. (Remember, though that the sizes in MODIFY TABLES are always in points.)

CTABLES provides for direct control of label widths, but more generally a way around this would be to create a tablelook with the desired widths and set this as your default or apply it afterwards using MODIFY TABLES.

Comment

People who like this

  0   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

Follow this question

46 people are following this question.

Answers

Answers & comments

Related questions

NOMREG, the SPSS syntax for multinominal logistic regression, referant 1 Answer

Modifying tables a bit more 3 Answers

SPSS Python Dummy Variable Module 1 Answer

PyScripter as Python IDE 4 Answers

Adding footnote to table 4 Answers

  • Contact
  • Privacy
  • IBM Developer Terms of use
  • Accessibility
  • Report Abuse
  • Cookie Preferences

Powered by AnswerHub

Authentication check. Please ignore.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • API Connect
  • Analytic Hybrid Cloud Core
  • Application Performance Management
  • Appsecdev
  • BPM
  • Blockchain
  • Business Transaction Intelligence
  • CAPI
  • CAPI SNAP
  • CICS
  • Cloud Analytics
  • Cloud Automation
  • Cloud Object Storage
  • Cloud marketplace
  • Collaboration
  • Content Services (ECM)
  • Continuous Testing
  • Courses
  • Customer Experience Analytics
  • DB2 LUW
  • Data and AI
  • DataPower
  • Decision Optimization
  • DevOps Build
  • DevOps Services
  • Developers IBM MX
  • Digital Commerce
  • Digital Experience
  • Finance
  • Global Entrepreneur Program
  • Hadoop
  • Hybrid Cloud Core
  • Hyper Protect
  • IBM Cloud platform
  • IBM Design
  • IBM Forms Experience Builder
  • IBM Maximo Developer
  • IBM StoredIQ
  • IBM StoredIQ-Cartridges
  • IIDR
  • ITOA
  • InformationServer
  • Integration Bus
  • Internet of Things
  • Kenexa
  • Linux on Power
  • LinuxONE
  • MDM
  • Mainframe
  • Messaging
  • Node.js
  • ODM
  • Open
  • PartnerWorld Developer Support
  • PowerAI
  • PowerVC
  • Predictive Analytics
  • Product Insights
  • PureData for Analytics
  • Push
  • QRadar App Development
  • Run Book Automation
  • Search Insights
  • Security Core
  • Storage
  • Storage Core
  • Streamsdev
  • Supply Chain Business Network
  • Supply Chain Insights
  • Swift
  • UBX Capture
  • Universal Behavior Exchange
  • UrbanCode
  • WASdev
  • WSRR
  • Watson
  • Watson Campaign Automation
  • Watson Content Hub
  • Watson Marketing Insights
  • dW Answers Help
  • dW Premium
  • developerWorks Sandbox
  • developerWorks Team
  • Watson Health
  • More
  • Tags
  • Questions
  • Users
  • Badges