0

Using c# VS2010 WinForm

actually i using line chart in report viewer
in my database:

ID----amount----year
ID01----10.00----2008
ID02----20.00----2010
ID03----30.00----2012

i want the result is in this format

1

but the result is this format

2

3
Contributors
3
Replies
4
Views
4 Years
Discussion Span
Last Post by ChrisHunter
0

May I know how i add arecord for each missing year? Because i am new in this reportviewer!

0

I'm not sure this can be done but it's worth a try.

You can loop through the returned records and use the DateTime.Compare() method in the C# end to sequentially compare two dates and if the result is 2 years or more then for each year missing add a new record by adding 1 to the year property of the first date (the earliest date).

An alternative to using the datetime.Compare() method would be to get the year value of the sequential dates and check how big the gab is between them and then add that many records.

Hope this helps point you in the right direction...

Edited by ChrisHunter

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.