Switch to: V12V11V10V9V8V7V6V5

Car Catalog Project

The Car Catalog sample project is developed to demonstrate Valentina Forms features such as:

  • Table and form-like data layouts
  • Valentina Report generation and presenting it inside the form
  • Exporting report to file on disk
  • Viewing report in the browser
  • Sending report in an email
  • Creating custom form preferences
  • Use of utility and startup scripts
  • Use of Image and Image - Field controls

Archives

Car Catalog project with an accompanying database is available for download within the Valentina Studio as Cloud Example.

Links for direct download (manually downloaded files must be uncompressed into vsp and vdb folders respectively, e.g. /car_catalogs/vsp /car_catalogs/vdb):

Overview

Created objects are separated into three different folders: Forms, Reports and Scripts.

Forms

See a short description of each created form and key features used in the form. Feel free to copy the code or use it as a basis for building your own solutions.

Name DescriptionUsed FeaturesPreview
car_list Presents a list of all cars in the catalog along with their main details. Buttons on the toolbar allow adding a new record, deleting, editing in a separate form and opening a preview of the catalog. Double-click opens a record for editing, too. TableView control, editing triggers, form import, user-defined methods
add_car Dialog to add a new car to the catalog. A picture can be loaded into an Image control either with a button click or a double click Form layout, event filtering
edit_car Dialog to edit an existing car with the ability to navigate through records. It has a button to open a preview of report containing details of the current car. A picture can be loaded into an Image control either with a button click or a double clickForm layout, form import, event filtering, user-defined methods
preview_report This form is used by other forms to show the preview of the report with specified parameters. It has controls to navigate through the report pages, print on printer, open in a browser, save as PDF file or send it in an email. Also, it allows the user to open email_settings form to adjust settings used to send reports. VReport, Image control, script import
email_settings This form allows the user to adjust SMTP server settings used to send a report in an email. These settings are persistent and stored separately near the Valentina Studio own preferences Form layout, QSettings class

Scripts

The following table contains a short description of each created script and key features used:

Name DescriptionUsed Features
base64 Contains utility function to encode binary data (such as PDF report) in Base64 ready to attach to an email using __MAIL VSQL function ArrayBuffer, Uint8Array
startup Script automatically executed at the project opening Project startup, form import

Reports

In the table below you can see a short description of reports created for use in conjunction with forms:

Name DescriptionPreview
report_cars Contains all cars in catalog in two columns with left-to-right column layout
report_car Contains the details of one specified car