views:

26

answers:

1

Hi,

I have created a dynamic subscribtion. All work well, but if I create the subscrbtion on any month say like July 09, and select that I get the report of previous month on monthly basis. Now In month of August I will receive the report for the data of July 09 which is correct but after that in September 09, I should Receive the report for the month of August 09 but I get the report of July data only. It seems it is not incrementing the Month. Code is:

         Str_SD = DateTime.Now.Month - 1 & "/01/" & DateTime.Now.Year
         Str_ED = DateTime.Now.Month - 1 & "/01/" & DateTime.Now.Year

        parameter_SD.Name = "Start_Date"
        parameter_SD.Value = Str_SD.ToString()
        parameter_ED.Name = "End_Date"
        parameter_ED.Value = Str_ED.ToString()
        Dim parameters(3) As ReportingService.ParameterValue
        parameters(0) = parameter_SD
        parameters(1) = parameter_ED
        parameters(2) = parameter_PCC
        parameters(3) = parameter_RptDtlLvl

        Dim SubId = rs.CreateSubscription(report, extSettings, desc, eventType,   matchData, parameters)

Can anyone help as to why I am receiving the report of the same month?

A: 

Try using date functions instead of constructing the date string. That will also help when you try to get the month before January.

Jeremy Stein