4D Blog

Home Product 4D View Pro: Manage Rows and Columns

4D View Pro: Manage Rows and Columns

February 4, 2020

Product

More features continue to be added to 4D View Pro’s ever-growing list of capabilities and this R-release is no exception. 4D v18 R2 includes new commands allowing you to add and remove columns or rows, as well as define their size, visibility, and header labels. This blog post shows you how!

HDI Manage columns and rows

remove rows and columns

The VP DELETE ROWS or VP DELETE COLUMNS commands have been created to remove rows or columns. For example, if you need to remove the columns selected by your user, you could use:

VP DELETE COLUMNS (VP Get selection ("ViewProArea"))

Insert rows and columns

The VP INSERT ROWS or VP INSERT COLUMNS commands have been created to add rows or columns. Simply pass a range with the first column or row as a parameter, plus the number of rows or columns to add. For example, to insert three columns before column B:

VP INSERT COLUMNS (VP Column ("ViewProArea";1;3))

Modify the number of rows or columns

By default, a 4D View Pro sheet contains 100 columns and 1,000 rows. If you need to change this in order to adapt your document to your needs, you can use the VP SET COLUMN COUNT and VP SET ROW COUNT commands. For example, if you want to resize your sheet to 10 columns and 20 rows:

VP SET COLUMN COUNT ("ViewProArea";10)
VP SET ROW COUNT ("ViewProArea";20)

Modify attributes of rows and columns

The new VP SET COLUMN ATTRIBUTES and VP SET ROW ATTRIBUTES commands enable you to:

  • Specify the column width or row height
  • Add a page break for printing
  • Hide or show columns or rows
  • Allow or deny users the ability to resize columns or rows
  • Change column or row header labels 

For example, if you want to change the size of column B and prohibit users from changing it:

$ColumnProperties:=New object
$ColumnProperties.width:=100
$ColumnProperties.resizable:=False
VP SET COLUMN ATTRIBUTES (VP Column ("ViewProarea";1);$ColumnProperties)

Resize AUTOMATICALLY rows or columns

You can automatically adjust the row or column size according to their content with the VP ROW AUTOFIT or VP COLUMN AUTOFIT commands. For example, if you want to adjust the rows and columns selected by your user:

VP COLUMN AUTOFIT (VP Get selection ("ViewProarea"))
VP ROW AUTOFIT (VP Get selection ("ViewProarea"))

You can test all of these commands in the HDI above.

 

Discuss

Tags 4D View Pro, Data table, Spreadsheet, v18 R2, v19, Workbook

Latest related posts

  • June 16, 2025

    Generate, share and use web sessions One-Time Passcodes (OTP)

  • May 20, 2025

    Automatic Refresh of OEM Build Licenses

  • May 16, 2025

    New class to handle incoming TCP connections

Fabrice Mainguené
Fabrice Mainguené
• Product Owner •Fabrice Mainguené joined 4D Program team in November, 2016. As a Product Owner, he is in charge of writing the user stories then translating it to functional specifications. His role is also to make sure that the feature implementation delivered is meeting the customer need.After obtaining a Bachelor degree in Computer Science at CNAM, Fabrice joined a small software publishing company as a Windev developer. Then he worked for different companies in industry and trade areas as a Windev and web developer as well as technical advisor on new features.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Google Listbox Logs Mail Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy