Current filter:
                                You should refresh the page.
                                0
                                  • I have a question similar to Q361278.

                                    I have report bound to a POCO datasource that looks like this:

                                    class MyDataSource
                                    {
                                          List<DetailBandData> Bands{get;set;}
                                    }

                                    My Report is bound to List<MyDataSource>, and is laid out as follows:
                                    Detail
                                    DetailReport - "Bands"
                                      GroupHeader (groups on field a)
                                      Detail (shows Band Detail)
                                      GroupFooter (sums field a)

                                    The report renders perfectly, but I have a requirement to hide the GroupFooter if the DetailBandData object being processed meets a certain criteria. So I've tried handling the GroupFooter's BeforePrint event, only when I call GetCurrentRow(), it returns an instance of the PARENT (MyDataSource), not an instance of DetailBandData, which is the current list item being processed the DetailReport.

                                    Why is GetCurrentRow() returning the parent and not the child row in the current context? Am I looking at this wrong? If so, how do I know which child row the GroupFooter is being rendered for?

                                    Thanks,
                                    Ben

                                0

                                My apologies, when I set up a test project using the parameters I described above, it worked as expected.

                                I am attaching a sample project illustrating the problem.

                                The only difference I can see is that in my project, there is an additional level of nesting for the data.

                                Hopefully the test project helps you guys see what I mean. Please let me know what you think.

                                Thanks,
                                Ben

                                DXIssue.zip
                                0

                                Hello Ben.

                                Thank you for your message. This behavior is caused by the fact that the GetCurrentRow method returns the main report data. To solve this issue, call this method for the corresponding DetailReportBand. Please modify your code as follows:

                                	
                                [C#]
                                private void ItemDetailCategoryGroupFooter_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { GroupFooterBand band = sender as GroupFooterBand; //Here, I expect an instance of ReportLineItemsBandData, but instead get an instance of SalesByItemDetailReportData var rowData = band.Report.GetCurrentRow(); }
                                I hope this will help you achieve the required functionality.

                                Best regards,
                                Ingvar.

                                0

                                Perfect. Exactly what I needed. Thanks!!

                                0

                                Hello Ben,

                                I am glad to hear that the problem has been resolved. Thank you for letting us know of your progress.
                                Please feel free to contact us if you have any difficulties. We will be happy to assist you.

                                Thanks,
                                Sergi

                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.