public void InitReferences()
{
//init report references in objects
int i = Sources.Count;
while (--i >= 0)
{
Sources[i].Report = this;
if (Sources[i].MetaData == null)
{
//metadata has gone...
LoadErrors += string.Format("No Metadata found, removing the source '{0}' (GUID {1})\r\n", Sources[i].Name, Sources[i].MetaSourceGUID);
Sources.RemoveAt(i);
continue;
}
Sources[i].InitReferences(Repository);
}
foreach (var model in Models)
{
model.Report = this;
model.InitReferences();
}
foreach (var view in Views)
{
view.Report = this;
view.InitReferences();
}
foreach (var task in Tasks)
{
task.Report = this;
task.InitReferences();
}
i = Outputs.Count;
while (--i >= 0)
{
Outputs[i].Report = this;
if (Outputs[i].Device == null)
{
LoadErrors += string.Format("No Device found, removing the output '{0}' (GUID {1}). Check the device files in the repository folder.\r\n", Outputs[i].Name, Outputs[i].OutputDeviceGUID);
Outputs.RemoveAt(i);
continue;
}
Outputs[i].InitReferences();
}
i = Schedules.Count;
while (--i >= 0)
{
Schedules[i].Report = this;
if (!Schedules[i].IsTasksSchedule && Schedules[i].Output == null)
{
LoadErrors += string.Format("No Output found, removing the schedule '{0}' (GUID {1})\r\n", Schedules[i].Name, Schedules[i].OutputGUID);
Schedules.RemoveAt(i);
continue;
}
}
}