• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
      • Introduction to Data Dictionary
      • Organization
      • Dictionary Concepts
        • General
        • Levels
        • Records
        • Items
          • Item Description
          • Identification Items
          • Subitems
          • Item Properties
          • Starting Position
          • Length
          • Data Type
          • Binary Dictionary Items
          • Occurrences
          • Decimal Places
          • Decimal Character
          • Zero Fill
        • Value Sets
        • Values
        • Relations
      • Data Dictionary Application
      • How to ...
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Binary Dictionary Items

In addition to the standard numeric and alpha data types, dictionary items can wrap the following CSPro objects that contain binary data:
  • Audio
  • Document
  • Geometry
  • Image
These binary data types are only available if the dictionary option Enable Binary Items (experimental) has been checked. Once enabled, you cannot disable the option unless all binary dictionary items have been removed from your dictionary.
Binary dictionary items cannot have value sets and many item properties do not apply to these items.
Binary dictionary items can only be used when using the following data sources: CSPro DB, Encrypted CSPro DB, JSON, None, and In-Memory. When using a data source that does not support binary data, such as Text, you will get a runtime error when attempting to run an application that contains binary dictionary items.
Syncing Binary Dictionary Items
Binary dictionary items are synchronized as part of a call to syncdata. If binary data has already been uploaded to a synchronization server, the data will not be uploaded again. However, it is still a good idea to be aware of the size of the binary data that you synchronize, as syncing these cases can slow down syncing activities significantly.
Usage Within CSPro Applications
As of CSPro 8.0, binary dictionary items cannot be added to forms. Instead, you will need to write logic within your application that references these items in order to manipulate them. The functions available with the Audio, Document, Geometry, and Image objects can be used on the binary dictionary items when valid (an occurrence of the parent record exists). For example:
PROC ROOF_TYPE

   
if accept("Do you want to take a photo of the roof?", "Yes", "No") = 1 then

       
// take a photo, storing the image in the binary dictionary item ROOF_IMAGE
        if ROOF_IMAGE.takePhoto() then

           
// because these images will be synced, ensure that the photo is not too large
            ROOF_IMAGE.resample(maxWidth := 1200, maxHeight := 800);

       
endif;

   
endif;
Usage Within CSPro Tools
While binary dictionary items are experimental, they cannot be used within the Export Data and Tabulate Frequencies tools. You will note that binary dictionary items do not appear in the tree. However, the rest of CSPro's tools work with binary data.
Data Viewer: When viewing a case within Data Viewer, if any binary dictionary items exist in the case, they will displayed within the field. If an image has been stored, a preview of that image appears. If it is an audio clip, you have the option to play it within Data Viewer. For all binary data types you have the option to open the file (in read-only mode) or save to a new file by clicking on the thumbnail or choosing the Open and Save options listed beneath each file.
Compare Data: When a binary dictionary item is chosen for comparison, the size of the file associated with that item is compared, regardless of the file name or file type. If the file sizes are the same, then the contents will be compared.
Reformat Data: Reformating binary dictionary items is possible in a few scenarios:
InputOutputOutcome
AlphaBinary Dictionary ItemFails
Binary Dictionary ItemAlphaFails
Binary Dictionary ItemAudioSucceeds if the MIME type is a valid audio type
Binary Dictionary ItemDocumentSucceeds
Binary Dictionary ItemGeometrySucceeds if the MIME type is GeoJSON
Binary Dictionary ItemImageSucceeds if the MIME type is a valid image type
Binary Dictionary ItemNumericFails
NumericBinary Dictionary ItemFails
Sort Data: If a binary dictionary item is chosen as the sort key, the size of the file associated with the binary dictionary item is used as the sort value.
See also: Data Type