IAdhocBinaryData.FindById

Syntax

FindById(Id: String): IAdhocBinaryItem;

Parameters

Id. Dashboard object identifier.

Description

The FindById method searches for a dashboard object by identifier.

Comments

The FindById method returns the object, which identifier is set as the Id input parameter.

The method returns Null if the object was not found.

Example

Executing the example requires a form containing the Button component with the Button1 identifier. The repository must contain a dashboard with the AN_PAN identifier, containing an element of binary data collection with the ITEM identifier. Add links to the Metabase, Adhoc, Fore, Io system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    File: IFileInfo;
    BW: IBinaryWriter;
    AP: IAdhocReport;
    BD: IAdhocBinaryData;
Begin
    MB := MetabaseClass.Active;
    AP := MB.ItemById("AN_PAN").Edit As IAdhocReport;
    BD := AP.BinaryData;
    File := New FileInfo.Attach("c:\Image.jpg");
    BW := File.OpenBinaryWriter(True);
    BD.FindById("ITEM").WriteToStream(BW.Stream);
    BD.RemoveById("ITEM");
End Sub UserProc;

After executing the example the element with the ITEM identifier will be found and removed from the collection of dashboard binary data, the data of the element will be written to the "c:\Image.jpg" file.

See also:

IAdhocBinaryData