Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hello,

                                    I need to pass a nullable datetime parameter in a report but I can't find a way.


                                    I tried two ways:


                                    1. In the report I used this:

                                    Public Sub New()

                                    InitializeComponent()

                                    Dim p1 As New DevExpress.XtraReports.Parameters.Parameter

                                    p1.Type = GetType(System.Nullable(Of DateTime))

                                    p1.Name = "p1"

                                    p1.Value = Now.Date

                                    p1.Visible = True

                                    Me.Parameters.Add(p1)

                                    End Sub

                                    which does not show the parameter. If I use p1.Type = GetType(DateTime) it works fine, but this is not what I want.


                                    2. I tried to add a dateedit control on create of report like this:

                                    docModel = New XtraReportPreviewModel(clsRep)

                                    AddHandler docModel.CustomizeParameterEditors, AddressOf TotalMoves_Sell_CustomizeParameterEditors

                                    ......

                                    Private Sub TotalMoves_Sell_CustomizeParameterEditors(ByVal sender As Object, ByVal e As CustomizeParameterEditorsEventArgs)

                                    If e.Parameter.Name = "pSellDateFrom" Then

                                    Dim dteSellDateFrom As New DateEdit

                                    dteSellDateFrom.EditValue = Nothing

                                    e.Editor = dteSellDateFrom

                                    e.BoundDataMember = "EditValue"

                                    End If

                                    End Sub

                                    but DateEdit cannot be converted to BaseEdit


                                    Can you provide me a solution please?

                                    Thanks

                                    Michalis

                                You must  log in  or  register  to leave comments

                                3 Solutions

                                Creation Date
                                Rating
                                Importance
                                Sort by
                                0

                                Hi Michalis,

                                I've created and attached a sample that illustrates how to accomplish your task. Hope this will be of some help.

                                Regards,
                                Alexey

                                Q406468.zip
                                You must  log in  or  register  to leave comments
                                0

                                Hi Michalis,

                                We have already discussed a similar issue: B200242 . Please review this thread for additional information. Hopefully this will help you.

                                Thanks,

                                Elliot

                                • I am afraid that the only way to accomplish this task is to use an approach illustrated in the attached project.

                                • Good morning Ellinot,
                                  I'm sending you an example to see the problem. In your example (Windows forms) works, but in WPF does not.
                                  Can you check it please?

                                You must  log in  or  register  to leave comments
                                0

                                Hello Elliot.

                                I have already tried this solution. It's the number one in my question.


                                If I use

                                p1.Type = GetType(DateTime) the report works and I can see results and parameters on the left,

                                but if I use p1.Type = GetType(System.Nullable(Of DateTime)) it does not.

                                ThanksMichalis

                                You must  log in  or  register  to leave comments
                                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.

                                To start a chat you should create a support ticket


                                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.

                                Your Privacy - Legal Statements

                                Copyright © 1998-2013 Developer Express Inc.
                                ALL RIGHTS RESERVED
                                All trademarks or registered trademarks
                                are property of their respective owners