LoadFromFile(FileName: String);
FileName. Path and name of the file containing a dashboard.
The LoadFromFile method loads a dashboard from the specified file of the PPDASH format.
To save the dashboard in the PPDASH file, use the IAdhocReport.SaveToFile method.
Executing the example requires the Report.ppdash file containing a dashboard report placed in the root directory of the C disk.
Add links to the Adhoc and Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
CrInfo: IMetabaseObjectCreateInfo;
AdhocReport: IAdhocReport;
Begin
MB := MetabaseClass.Active;
// Create a dashboard
CrInfo := MB.CreateCreateInfo;
CrInfo.ClassID := MetabaseObjectClass.KE_ADHOC_REPORT;
CrInfo.Id := "NEW_ADHOC";
CrInfo.Name := "New dashboard";
CrInfo.Parent := MB.Root;
AdhocReport := MB.CreateObject(CrInfo).Edit As IAdhocReport;
// Load report to dashboard
AdhocReport.LoadFromFile("C:\Report.ppdash");
(AdhocReport As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the dashboard with the NEW_ADHOC identifier will be created in the root folder. Data from the Report.ppdash file is loaded to the dashboard.
See also: