Format property

OpenReportButton.Format — OpenReportFormat

Special value available in formulas:

Item

OpenReportButton

The button this property is part of, enabling multiple checked items in the app designer to share the same formula and be updated all at once.

Consider the fields Field1 and Field2, which should only be considered to be valid if their values are greater than 4. Without using the Item value, the Valid property of Field1 would need to use the formula Field1 > 4Field1 > 4 and the Valid property of Field2 would need to use the formula Field2 > 4Field2 > 4.

Using Item, both formulas can read Item > 4Item > 4. This is useful if you have many fields and you want to be able to update their formulas all at once. To do so, click their check boxes in Calcapp Creator and make sure that a checked field is selected. Then, when you update a formula for one checked field, you update all the other checked fields too, which is a great timesaver.

Use Item in exactly the same way you'd use the regular name. Button1.VisibleButton1,Visible and Item.VisibleItem,Visible are equivalent, for instance.

What format is used for the report. These are the allowed values:

Value Meaning
OpenReportFormat.​PlainText The field values are included in a plain text file and are formatted in the same way as in the app. These files can be opened by an application such as Notepad on Windows and TextEdit on macOS.
OpenReportFormat.​Html The field values are included in an HTML file and are formatted in the same way as in the app. These files can be opened by web browsers and by applications such as Microsoft Word.
OpenReportFormat.​Pdf (default) The field values are included in a PDF document and are formatted in the same way as in the app. While the document can contain arbitrary text before and after the field values (see below), it cannot contain images or formatted text. Learn how to generate custom-designed PDF documents by reading this tip.
OpenReportFormat.​Dsv The field values are included in a file containing delimiter-separated values (DSV). (Files containing comma-separated values are known as CSV files and files containing tab-separated values are known as TSV files.) These files can be imported into spreadsheet programs like Microsoft Excel and Google Sheets and imported into databases.

Custom text can appear before and after the field values.

Examples

OpenReportFormat.PdfOpenReportFormat,Pdf

Makes an open report button write the field values to a PDF document.

IF(Format = "PDF", OpenReportFormat.Pdf, OpenReportFormat.PlainText)IF(Format = "PDF"; OpenReportFormat,Pdf; OpenReportFormat,PlainText)

Makes an open report button write the field values to a PDF document if the user has selected "PDF" from a text drop-down field named Format. Otherwise, they are written to a plain text file.

OPENREPORT({ App }, Format: IF(Format = "PDF", OpenReportFormat.Pdf, OpenReportFormat.Dsv))OPENREPORT({ App }; Format: IF(Format = "PDF"; OpenReportFormat,Pdf; OpenReportFormat,Dsv))

This formula is associated with the OnPress property of a formula button, and causes a report to be opened when the button is pressed. All fields of the app are included, courtesy of the { App }{ App } parameter. The field values are written to a PDF document if the user has selected "PDF" from a text drop-down field named Format, or to a plain text file otherwise.