4D v13

Managing 4D Chart documents

Home

 
4D Chart v13
Managing 4D Chart documents

Managing 4D Chart documents  


 

 

In a 4D Chart window, you can create a new graph or open an existing document at any time using the standard commands in the File menu. You can also import or export your charts as PICT files.

You have several possibilities for saving your graphs.

4D Chart documents have the “.4CT” extension. 

You can save the contents of a 4D Chart document regardless of whether the document was created in a plug-in window or in a form. 4D Chart offers several ways to save documents:

  • As a file,
  • As part of a record,
  • As a template for a 4D Chart area.

You can also save a selection of objects, for instance a graph, as a PICT document (Macintosh format). In this case, the document saved is a picture that can no longer be modified. This point is covered in Exporting a 4D Chart document in PICT form.

Any document that you create using 4D Chart can be saved as a separate document for use in another place — either in the same database, in another database that uses 4D Chart, or in an entirely different application. You use the standard Save and Save As menu items in the 4D Chart File menu to save and update individual documents.

Documents you save can be opened with the Open menu item in the 4D Chart File menu. It makes no difference whether a document is created in a plug-in window or in a form; a document can be saved and opened in either place.

If you save a 4D Chart document as a file, when you reload the file, the document appears exactly as it was when you saved it. To update the information in any graphs in the document, you must use the Update menu item in the Chart menu, which is described in more detail in Updating graph data from the database.

If you have created a 4D Chart plug-in area in a form and want its contents to be saved automatically with each record, you need to create a BLOB type field in the table to which the form belongs in order to store the contents of the area. The contents of the area are then saved automatically with each record when it is validated.

Note: This mechanism cannot be used with project forms. 

To save a 4D Chart document as part of a record:

  1. Add a BLOB field to the table whose form contains the 4D Chart area.
    For more information about creating a field, refer to Get database parameter.
  2. Give the field the same name as the external area that you have created on the form and add an underline (_) to it.
    For example, if your external area is named MyArea, the field must be named MyArea_.
    Each graph is thus saved as a part of the record.

When you save a 4D Chart document as part of a record, when you reload the record, the document appears exactly as it was when you saved it. To update the information in any graphs in the document, you must use the Chart>Update menu item, which is described in more detail in Updating graph data from the database.

If you have inserted a 4D Chart area into a form, you can create a standard document that is the same for every record by saving the document as a template. It is not possible to use templates with external windows or with project forms. 

When you save a document as a template, the template is used by default for every new record that is opened in the table form.
Each document starts with the same template, but any unique modifications you make to it are saved with the record. There can be only one template for each 4D Chart area on a form.

If there is a graph in the document that is saved as a template, the graph is updated automatically for each record, if possible. 4D Chart can update a graph only if it was created from data stored in records in the database. 

To save a document as a template, choose Save as Template from the 4D Chart File menu.

4D Chart saves the document with a special filename. The filename is the name of the 4D Chart area on the form, plus an underscore and the extension .4CT. For example, an area named “Document” will have a template file named “Document_.4CT”. Because 4D Chart automatically names the file and places it in the database directory; no save-file dialog box is displayed.

Note: By default, 4D Chart templates are read from and saved to the client machines. You can use the CT SET AREA PROPERTY command of the 4D Chart language to specify that templates be read from and saved to the server machine.

If you make changes to the document and want to incorporate those changes in the template, choose Save as Template again.

You can create a template for a 4D Chart area without using the Save as Template menu item simply by saving the document with a filename that is the same as the name of the 4D Chart area, plus an underscore and the extension .4CT, and placing the file in the database directory. This feature allows you, for example, to create a document in one database and use it as a template in another database. You can also create a document in one document area and use it as a template in another document area.

You can temporarily disable the use of a particular template file by changing the template filename or moving the file out of the database directory.

You can open documents of the PICT type in a 4D Chart window. These documents can come from different sources (export of a 4D Chart graph in PICT form, design software, etc.). The imported document behaves like a simple object; you cannot modify its attributes.

To import a PICT document, choose the Import... command in the File menu of 4D Chart and select the PICT file you want to open (*.PCT extension under Windows) and click Open. If the imported file is valid, its contents are displayed in the 4D Chart window.

You can export a 4D Chart document or a selection of objects in it as a PICT file. In both cases, the objects do not keep their unique 4D Chart properties; the exported document is a static picture of the objects in the 4D Chart area or in the external window. You can import it as a PICT in 4D Chart or any other application that opens PICT files.

To export a 4D Chart document in PICT form, choose the Export as... command in the File menu of 4D Chart.

To export a selection of 4D Chart objects in PICT form, select the object(s) that you want to export in PICT form then choose the Export Selection as... command in the File menu of 4D Chart.

Whether you export a 4D Chart document or a selection of objects, a PICT file (*.PCT extension under Windows) is created on the disk.

 
PROPERTIES 

Product: 4D
Theme: Using 4D Chart