Current filter:
                                You should refresh the page.
                                Support Center
                                  • Hi!

                                    I have following structure:
                                    InvoicesPeriod *<->1 Customer 1<->* Invoices

                                    InvoicesPeriod contains properties: Customer, DateFrom, DateTo.

                                    I want to create a report based on InvoicesPeriod. Then I want DetailReport based on InvoicesPeriod.Customer.Invoices, but I want to filter invoices by InvoicesPeriod.DateFrom and InvoicesPeriod.DateTo.
                                    I couldn't find a proper string to enter to DetailReport's Filter property to achieve that.



                                You must  log in  or  register  to leave comments

                                1 Solution


                                Hi Mario,

                                I believe the simplest way to accomplish this task is to use Report Parameters for filtering. In this way, you will define the DetailReport's FilterString value only once. Then, you will simply change the Parameter values based on your requirements.

                                For example, you can handle the DetailReportBand.BeforePrint event, access created parameters using the Report.Parameters collection, and pass required values to the Parameter.Value property.

                                Please try this solution and let me know your results.

                                • Mario Blatarić 09.23.2013

                                  I forgot to mention, this report will be used only as Inplace report for selected InvoicesPeriod record. It will never require any input parameters.
                                  With this in mind, is there a simpler solution to accomplish my task? There is no way to use parent object in Detail Report Filter String?

                                • Report Parameters are intended not only for requesting input parameters, but also for passing values from the master report to its details and vice versa.

                                  I suggest that you review the following help topic for additional information:
                                  How to: Silently Pass a Parameter's Value (Runtime Sample)

                                  Anyway, you can access the master report in the DetailReportBand's BeforePrint event as follows:

                                  ... DetailReportBand detailReport = sender as DetailReportBand; XtraReportBase masterReport = detailReport.Report; //Perform your actions

                                • Mario Blatarić 09.23.2013

                                  You're confusing me.
                                  I'm using XAF and no such code is required to start an InPlace report (as in the link you provided).
                                  I just noticed that my ticket was moved to XtraReports, even though I created it in eXpressApp Framework category.

                                  So,l select one InvoicesPeriod record in InvoicesPeriod_ListView. That record has DateFrom and DateTo properties.
                                  I click InPlace report action and report is generated for selected InvoicesPeriod record. No code, no parameters.
                                  But all Invoices are displayed and I need to filter them using DateFrom and DateTo properties.

                                • To do the same in XAF, subscribe to the WinReportServiceController.CustomShowPreview event and pass values to the hidden report parameters, as this was mentioned earlier (the report instance can be retrieved via the e.Report property).
                                  It is also possible to accomplish your task without using parameters. To do this, create a BeforePrint script for the detail report band, retrieve the current InvoicesPeriod record via the GetCurrentRow method and set the detail band's FilterString based on the period's values.

                                You must  log in  or  register  to leave comments

                                If you need additional product information, write to us at 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