LoadFromFile(FileName: String);
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.
The requirements and result of the Fore.NET example match with those in the Fore example.
Imports Prognoz.Platform.Interop.AdHoc;
Imports Prognoz.Platform.Interop.Metabase;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
CrInfo: IMetabaseObjectCreateInfo;
AdhocReport: IAdhocReport;
Begin
MB := Params.Metabase;
// Create a dashboard
CrInfo := MB.CreateCreateInfo();
CrInfo.ClassID := MetabaseObjectClass.KE_ADHOC_REPORT As Int32;
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;
See also: