DevExpress XtraReport Setting a DateTime Parameter to Today

AbdelRahman Shabana picture AbdelRahman Shabana · Sep 5, 2013 · Viewed 7.2k times · Source

I am using DevXpress XtraReport v13.1

I have a dateTime parameter that I would like its default value to be current Day whenever it is used. When I leave the value of the parameter empty. it is understood by DevExpress as 1/1/0001 !!!

It is important for me because the parameters will be applied as a filter to a database and I require to decrease the probability that user can fetch too much data from the database (that may affect the performance)

Anyone have an idea of how to do that?

Answer

Joe B picture Joe B · Aug 21, 2014

I just did It Like this

  public Report()
    {
        InitializeComponent();
        this.Parameters[0].Value = DateTime.Today;
        this.Parameters[1].Value = DateTime.Today;
    }

the Approach AbdelRahman Shabana took Fails because the Event fires Again when user Clicks Submit, Just Give A look Here