Current filter:
                                You should refresh the page.
                                Support Center
                                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

                                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

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners