Skip to main content
A newer version of this page is available. .

TdxSpreadSheetFormatsRepository.Items Property

Provides zero-based indexed access to the registered file formats.

Declaration

property Items[Index: Integer]: TdxSpreadSheetCustomFormatClass read; default;

Property Value

Type
TdxSpreadSheetCustomFormatClass

Remarks

Use this property to extract information on the individual supported file formats by their index, specified as the Index parameter. To identify the maximum index value, use the Count property.

To obtain lists of formats (as file format masks with their respective descriptions) available for loading and saving spreadsheet data, use the GetOpenDialogFilter and GetSaveDialogFilter methods, respectively.

The following code example illustrates how to display class names, extensions, and descriptions for all registered file formats via the TcxMemo control:

var
  I: Integer;
  AFormat: TdxSpreadSheetCustomFormatClass;
//...
// Cycling through all registered file formats
  for I := 0 to dxSpreadSheetFormatsRepository.Count - 1
    begin
      AFormat := dxSpreadSheetFormatsRepository.Items[I];
// Displaying the class name of a particular file format
      cxMemo1.Lines.Strings[I] := 'Extension No. ' + IntToStr(I + 1) + ': ' + AFormat.ClassName;
// Displaying the file name extension corresponding to a particular format
      cxMemo1.Lines.Strings[I] := cxMemo1.Lines.Strings[I] + ' (' + AFormat.GetExt + ')';
      if(AFormat.GetDescription <> '') then  // If the format's description is available
// Displaying the file format's description
        cxMemo1.Lines.Strings[I] := cxMemo1.Lines.Strings[I] + ' | ' + AFormat.GetDescription + ' |';
    end

If you need to obtain a specific file format by its name, use the Find function instead of the Items property.

See Also