Ticket T1282669
Visible to All Users

Report parameters set from code are not being considered.

created 6 months ago

Hello,

I am generating reports from code and passing parameters. The reports are loaded using LoadLayoutFromXml. However, the date parameters are not being applied, and a null value is used instead. Meanwhile, GUID parameters are set correctly. The parameters are parsed from the database and assigned to the report, but the date values are not being recognized

Clipboard-File-1.png

Thanks

Answers approved by DevExpress Support

created 6 months ago (modified 6 months ago)

Hello Valentinos,

Your code looks correct to me.

I assume that it doesn't work because your parameters have an expression specified for the default value. When a parameter has an expression, you need to remove the expression from the parameter’s ExpressionBindings collection before you assign a static value to the parameter’s Value property. Refer to the following help topic for more details: Specify Parameter Values in Code > What if the Parameter Value Is an Expression.

Please let me know if this helps. If not, please share a simplified project that illustrates the issue so that I can assist you further.

Regards,
Aleksandr

    Comments (2)

      Yes, we use the built in Today() method/expression

      Thanks

      Aleksandr (DevExpress Support) 6 months ago

        You are always welcome, Valentinos!

        I'm happy to hear that my tip was helpful.

        Best regards,
        Aleksandr

        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.