Thursday, March 31, 2011

Date Range in AOT Query from SSRS

How can I add date ranges in an AOT query linked to SSRS.

Kindly use the following sample code to create a data method and then use it as a source for report data set.

    [DataMethod(), AxSessionPermission(SecurityAction.Assert)]
    public static DataTable GetData(DateTime fromDate, DateTime toDate)
        DataTable table = new DataTable();
        IDictionary myRanges = new Dictionary();
fromDate.ToString("dd/MM/yyyy") + ".." + toDate.ToString("dd/MM/yyyy"));
        table = AxQuery.ExecuteQuery("select * from AOTQuery", myRanges);
        return table;

No comments:

Post a Comment