Ticket T286338
Visible to All Users

Setting criteria for defined reports

created 10 years ago (modified 10 years ago)

I want to be able to print the Sales Manifest business object  that is selected in my Sales Manifest view.

To do this I set up an action which calls the following code.

When I break on the criteria it is correct

however the report displays all data, not applying the criteria

C#
private void actManifestReport_Execute(object sender, SimpleActionExecuteEventArgs e) { var manifest = (SalesManifest)e.CurrentObject; var reportData = View.ObjectSpace.FindObject<ReportDataV2>(new BinaryOperator("DisplayName", "SalesManifestReport")); string reportContainerHandle = ReportDataProvider.ReportsStorage.GetReportContainerHandle(reportData); var criteria = new BinaryOperator("Id", manifest.Id); Frame.GetController<ReportServiceController>().ShowPreview(reportContainerHandle,criteria); }
C#
Comments (3)

    Report Designer is attached

      Is there an example of how to do something like a sales invoice using Entity Framework?

        I was able to achieve my business goal by creating an in place report at run time.
        Still I am puzzled why the above technique does not work for me.

        Answers approved by DevExpress Support

        created 10 years ago (modified 10 years ago)

        Hello Kirsten,

        I checked your report definition and found out that you are not following the Reports V2 documentationon how to use XtraReports in an XAF project. In particular, your criteria is not applied because you are using the DevExpress.DataAccess.EntityFramework.EFDataSource component, which is unhandled in XAF.
        To get your code working in XAF, create a report using the CollectionDataSource or ViewDataSource components as described in the eXpressApp Framework > Concepts > Extra Modules > Reports V2 Module > Create Predefined Static Reports article. This documentation is ORM-agnostic and can be well applied to EF as well.

          Show previous comments (8)

            hmm, removing the details  section got rid of that error

              Ah, I get the "Parameter count mismatch" error when I try and run a report that contains data from the Lines collection http://screencast.com/t/vwxrRDxS  .   Any ideas? I might need to create a demo project and send it…

              Dennis Garavsky (DevExpress) 10 years ago

                I am afraid I cannot provide a solution to the last error by the info you provided. As I mentioned above, please submit a separate ticket and attach your test project there so we can research this behavior further.
                I would also kindly ask you post a separate ticket for each problem you want to discuss in the future. The Support Center (or any other forum site) concept does not allow discussing/mixing multiple problems within a single thread as it makes it difficult to properly track and process such items. Thanks.

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.