I am building a report for the following data:
--> FacilitY
--> Assessments
--> Photos
A facility can have multiple assessments and an assessment can have multiple photos. I can get the Facility data and the Assessments data to show up. I can not get the photos to load. I am loading the Photos SubReport during the 'assessmentsTable_Item
DataBound()' event as a subReport in a cell, but it doesn't appear that it is loading. Here's the code:
Any help would be appreciated.
--> FacilitY
--> Assessments
--> Photos
A facility can have multiple assessments and an assessment can have multiple photos. I can get the Facility data and the Assessments data to show up. I can not get the photos to load. I am loading the Photos SubReport during the 'assessmentsTable_Item
DataBound()' event as a subReport in a cell, but it doesn't appear that it is loading. Here's the code:
private void assessmentsTable
_ItemDataBound(object sender, EventArgs e){ if (m_HasRecords) { Telerik.Reporting.Processing.Table tab = (Telerik.Reporting.Processing.Table)sender; Telerik.Reporting.Processing.ProcessingElement[] elems = tab.ChildElements.Find("textBox16", true); for (int i = 0; i < elems.Length; i++) { DataTable dt_assessments = GetAssessments(); Telerik.Reporting.Processing.TextBox assessmentID = (Telerik.Reporting.Processing.TextBox)tab.ChildElements.Find("textBox16", true).GetValue(i); Telerik.Reporting.Processing.SubReport rep1 = (Telerik.Reporting.Processing.SubReport)tab.ChildElements.Find("subReport1", true).GetValue(i); //Telerik.Reporting.SubReport rep2 = (Telerik.Reporting.SubReport)tab.ChildElements.Find("subReport2", true).GetValue(i); DataTable dt_photos = GetPhotos(); LoadPhotos(dt_photos, assessmentID.Value.ToString(), m_Counter++, table2.Height.Value + 10, rep1);private void LoadPhotos(DataTable dt_photos, string assessmentID, int i, float height, Telerik.Reporting.Processing.SubReport subReport1){ DataView dv = new DataView(dt_photos, "photoSourceID='" + assessmentID.ToString() + "'", "PhotoDateTime", DataViewRowState.CurrentRows); subReport1.Report.DataSource = new RMReports.AssessmentPhotos(dv, m_PhotoDirectory, m_EventID.ToString()); subReport1.Location = new PointU(new Unit(0.5, UnitType.Inch), new Unit(m_CurrentYLocation + height + 1, UnitType.Inch)); subReport1.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(7.9999217987060547, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.900000274181366, Telerik.Reporting.Drawing.UnitType.Inch));}public AssessmentPhotos(DataView dt_photos, string photo_directory, string eventid){ /// <summary> /// Required for telerik Reporting designer support /// </summary> InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // m_PhotoDirectory = photo_directory; m_EventID = eventid; LoadPhotos(dt_photos);}private void LoadPhotos(DataView dt_photos){ table2.DataSource = dt_photos;}Any help would be appreciated.