Posted 5 April 2023, 2:33 am EST - Updated 5 April 2023, 2:38 am EST
Hi,
We are using Active Reports 7+ version for creating reports in our project. we have master report and in its group header section we have 4 sub reports for showing Digital Input ,Digital Output, Analog Input and Analog Output data.
All 4 SubReports contain different information bcz of that we have taken separate sub reports.
All 4 subreports having one common field named Unit and we have to show report data based on Unit.
lets take example
if we have Unit value 31-01 in DigitalInput and 31-01 also in DigitalOutput
so they will come one after other.
If we also have Unit value 31-02 in DigitalInput then this record will come after 31-01 DigitalInput and 31 -01 DigitalOutput record.
Kindly refer Sorted data.png for this (Expected Result).
and we are getting data only for 31-01 and not in expected order.
(SubReport Datasource having proper data in collection)
we have implemented below code in master
report groupHeader1_Format function
** private void groupHeader1_Format(object sender, EventArgs e)
{
bool digitalInput, digitalOutput, analogInput, analogOutput;
var dpuNo = _distinctDpus[iRow];
List newList = new List();
newList = InstrumentListReportData.InstrumentListData.Where(x => x.DPU == dpuNo).ToList();
digitalInput = newList.Any(x => x.GetType() == typeof(DigitalInput)); digitalOutput = newList.Any(x => x.GetType() == typeof(DigitalOutput)); analogInput = newList.Any(x => x.GetType() == typeof(AnalogInput)); analogOutput = newList.Any(x => x.GetType() == typeof(AnalogOutput)); if (analogOutput) { //subRptAnalogOutput = new GrapeCity.ActiveReports.SectionReportModel.SubReport(); rptSubInstrumentListDPUAnalogOutput subRptInstrumentListAnalogOutput = new rptSubInstrumentListDPUAnalogOutput(newList.Where(x => x.GetType() == typeof(AnalogOutput)).ToList()); subRptAnalogOutput.Report = subRptInstrumentListAnalogOutput; } if (analogInput) { //subRptAnalogInput = new GrapeCity.ActiveReports.SectionReportModel.SubReport(); rptSubInstrumentListDPUAnalogInput subRptInstrumentListAnalogInput = new rptSubInstrumentListDPUAnalogInput(newList.Where(x => x.GetType() == typeof(AnalogInput)).ToList()); subRptAnalogInput.Report = subRptInstrumentListAnalogInput; } if (digitalInput) { //subRptDigitalInput = new GrapeCity.ActiveReports.SectionReportModel.SubReport(); rptSubInstrumentListDPUDigitalInput subRptInstrumentListDigitalInput = new rptSubInstrumentListDPUDigitalInput(newList.Where(x => x.GetType() == typeof(DigitalInput)).ToList()); subRptDigitalInput.Report = subRptInstrumentListDigitalInput; } if (digitalOutput) { //subRptDigitalOutput = new GrapeCity.ActiveReports.SectionReportModel.SubReport(); rptSubInstrumentListDPUDigitalOutput subRptInstrumentListDigitalOutput = new rptSubInstrumentListDPUDigitalOutput(newList.Where(x => x.GetType() == typeof(DigitalOutput)).ToList()); subRptDigitalOutput.Report = subRptInstrumentListDigitalOutput; } iRow++; }**
This method is getting call for each group 31-01 , 31-02 etc.
Is it possible to look issue in call (teams/zoom) for better understanding?
Added mater report and subreports design view for reference