For those of you working with larger and more complex 4D View Pro documents, we understand the performance concerns that arise. Starting from the 4D v20 R3, we offer a new blob format that enables you to store compressed documents in your database with the same performance as the .sjs format.
export Blob
To export your document as Blob, you need to use the VP EXPORT TO BLOB command:
VP EXPORT TO BLOB("ViewProArea"; {formula: Formula(VPBlobCallback)})
Note that this command is asynchronous. You need to create a method, VPBlobCallback in our example, to use the export result and supply a table:
#DECLARE($area : Text; $data : 4D.Blob; $paramters : Object; $status : Object)
var $myEntity : cs.myTableEntity
if ($status.success)
// Save the document in a table
$myEntity:=ds.myTable.new()
// $data: blob document
$myEntity.blob:=$data
$myEntity.save()
end if
Import blob
To import your Blob document, you need to use the VP IMPORT FROM BLOB command:
var $myBlobDocument:4D.Blob:=ds.myTable.all().first().blob
VP IMPORT FROM BLOB("ViewProArea"; $myBlobDocument)
Explore the documentation for further insights into the new features!