Urgent : Issue with group header with section reports

Posted by: nitin.jain on 5 April 2023, 2:33 am EST

    • Post Options:
    • Link

    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

  • Posted 10 April 2023, 1:06 am EST

    Hi Nitin,

    Thanks for sharing the detailed explanation of your query. For your reference, as per your use case I have created a sample application and attached it along with the rendered report seems to be as expected.

    Please note I am filtering the Data for each sub report based on the current Fields[“Unit”] value in the main report.(see groupHeader1_Format in SectionReport1.cs script)

    >> Is it possible to look issue in call (teams/zoom) for better understanding?

    Let us know if the issue persists. If yes, then I will create a support case for the same as it is a private channel and we can schedule a meeting regarding the same if required.

    Regards,

    Akshay

    SampleSectionReport.zip

  • Posted 11 April 2023, 2:17 am EST - Updated 11 April 2023, 2:22 am EST

    Hi Akshay,

    Thanks for looking into problem and sample code.

    We are getting compilation error as we don’t have same Active Reports version that you have used.

    Is it possible for you to provide sample example with AR 16 version.

    Error snapshot attached for reference.

  • Posted 12 April 2023, 5:23 am EST

    Hi Nitin,

    >> Is it possible for you to provide sample example with AR 16 version.

    Sure, I have downgraded the sample to ActiveReports 16. I have attached the updated sample along with.

    Regards,

    Akshay

    SampleSectionReport.zip

  • Posted 12 April 2023, 7:47 am EST

    Hi Akshay,

    We found your Sample Application is working as expected.

    Although we try different way and able to get expected results (We have used 4 group headers and put sub reports in each group). We have decided to keep it.

    Good to know that with one Group header also it is possible to do.

    Thanks for your effort and we can close this ticket.

    Regards,

    Nitin Jain

  • Posted 13 April 2023, 8:36 am EST

    Hi Nitin,

    I am glad to know your issue is resolved!

    Regards,

    Akshay

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels