4D Blog

Home Product 4D View Pro: Speed up your development process with templates

4D View Pro: Speed up your development process with templates

January 13, 2022

Product

Creating reports or spreadsheets from existing templates speeds up development. Starting with 4D v19 R4, copy and paste actions can now be performed using code that copies a range of cells from another location (including other areas).

Move or copy a block of cells.

The VP MOVE CELLS command allows you to copy/cut and paste a range of cells to another location, even between two areas:


// Starting range

$rangeFrom:=VP Cells("ViewProArea1"; 0; 0; 2; 7)
// First cell of the destination range
$rangeTo:=VP Cell("ViewProArea2"; 2; 0)
VP MOVE CELLS($rangeFrom; $rangeTo; New object("copy"; True))

copy paste over an object

Another way to copy a range is to copy it to an object with the VP Copy to object command, for example, to save it in your database:

$template:=ds.Templates.new()
$template.VP:=VP Copy to object($rangeFrom)
$template.save()

So you can paste the contents, styles and formulas stored in the object when you need it with the VP PASTE FROM OBJECT command:

$template:=ds.Templates.get($id)
VP PASTE FROM OBJECT($rangeTo; $template.VP)

Whichever solution you use, it’s essential to be aware of the possibilities: relative cell references might change when you move or copy a formula. Learn more about this feature on the documentation center.

 

Discuss

Tags 4D View Pro, Document creation, Programming, Spreadsheet, v19 R4, v20

Latest related posts

  • December 3, 2025

    Give AI to a 30 years old 4D application

  • November 28, 2025

    ORDA – Handle an event-driven logic during database operations

  • November 27, 2025

    ORDA – Permissions – Restrict / allow web access to the resources in one click

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

  • AI
  • 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 AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming 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