Posted 30 November 2023, 3:55 am EST - Updated 30 November 2023, 3:56 am EST
Hi,
I am having some trouble filling a requirement for a client where they wish to have the detail of a document, in this case it is document lines, have the “identifiers” in one row with a sub-table of properties beneath these identifiers.
I have created a SectionReport which has a row of TextBox controls that are databound using the DataField on each textbox. Beneath this row is a SubReport that is bound to another SectionReport. This SubReport is populated like so using the detail_format() of the parent report.
private void detail_Format(object sender, EventArgs e)
{
if(_LineDetail != null && _LineDetail.Any() && long.TryParse(this.Fields["ID"].Value.ToString(), out long lineID))
{
var LineDetails = _LineDetail.Where(ld => ld.DocumentLineID == lineID);
if (LineDetails != null && LineDetails.Any())
{
LineDetail.Visible = true;
var lineDetail = new LineDetail(LineDetails);
LineDetail.Report = lineDetail;
LineDetail.Report.DataSource = LineDetails.CopyToDataTable();
LineDetail.Report.Run();
}
else
{
LineDetail.Visible = false;
}
}
else
{
LineDetail.Visible = false;
}
}
The result is that the header of the SubReport is displayed, but the detail of the SubReport is not displayed. I have checked that the property CanGrow is set to true and the detail section of the parent report can also grow to accommodate, there is definitely space for it. I have also checked the data I am passing to the DataSource of the SubReport is valid and contains elements.
Is there something I am missing here to get this detail to render?
Thanks