views:

61

answers:

2
+1  Q: 

SQL Reporting

I have a chart report that displaying monthly data and i want to display previous and next month data by clicking previous and next month.

How to display data in chart by clicking previous and next month.

+1  A: 

Add a parameter to the report to specify the month. Create two text items in the RDL for this report for previous and next. Configure the 'jump to' item for these two tems to invoke this same report with correct value for the month deduced from the month value in the current report. It will be month - 1 for prev and month + 1 for next. In short, you will be calling the same report for both the prev, next and for the current month.

msvcyc
i tried this but i am able to display the Prev and Next month Name's on Report but Not able to retrieve Data for those months.The Stored Proc still giving the Data for Current Month
Anoop
Try hardcoding the month numbers/names in the jump to link to make sure if the month values are passed to the report correctly. If they are then it is a problem with the SP. If not, report is not passing the parameter values correctly.
msvcyc
A: 

not sure what environment you are in, but you could use the following SQL to get you the next/previous months (using oracle). Use this as your starting point for building your query.

next button: select to_char(sysdate,'MM')+1 from dual

previous button: select to_char(sysdate,'MM')11 from dual

Once you get your requested month, build the remaining resultset.

northpole
Thanks for the Reply But i am using SQL Reporting Services
Anoop