or
.........
reportViewer.Parameters[
"SelectedBeginMonth"
] = selectedBeginMonth;
reportViewer.Parameters[
"SelectedDuration"
] = selectedDuration;
if
(
string
.IsNullOrEmpty(reportViewer.Report))
{
//first time => setting the report will automatically load it
reportViewer.Report =
"Anton.Server.Reports.M01_OrganisationModule.KeyFigures.KeyFigures, Anton.Server.Reports, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
;
}
else
{
reportViewer.RefreshReport();
}
(the params aren't correct)
protected
override
void
OnNeedDataSource(
object
sender, EventArgs e)
{
base
.OnNeedDataSource(sender, e);
SetColumnWidth();
SetColumnWidthRemarks();
DateTime selectedBeginMonth =
new
DateTime(DateTime.Today.Year,DateTime.Today.Month,1);
if
(ReportParameters[
"SelectedBeginMonth"
].Value !=
null
)
{
DateTime.TryParse(ReportParameters[
"SelectedBeginMonth"
].Value.ToString(),
out
selectedBeginMonth);
}
int
selectedDuration = 0;
if
(ReportParameters[
"SelectedDuration"
].Value !=
null
)
{
int
.TryParse(ReportParameters[
"SelectedDuration"
].Value.ToString(),
out
selectedDuration);
}
keyFiguresChart.Series.Clear();
for
(
int
i = 0; i < selectedDuration; i++)
{
var serie =
new
ChartSeries
{
DataYColumn =
"Year"
+ (i + 1),
Name = selectedBeginMonth.AddYears(i).ToString(
"dd/MM/yyyy"
) +
" - "
+ selectedBeginMonth.AddYears(i + 1).AddDays(-1).ToString(
"dd/MM/yyyy"
),
};
serie.Appearance.ShowLabels =
false
;
keyFiguresChart.Series.Add(serie);
}
}
The method that is bound to the objectdatasource of the table(the params are correct)Sodi Wepublic
IQueryable<KeyFiguresDto> GetKeyFiguresDtoForOtherData(
bool
showNewEmployees,
bool
showPercentageFemales,
bool
showPercentageMales,
bool
showPercentageUnknownGender,
bool
showPercentageInflow,
bool
showPercentageOutflow,
bool
showPercentageParttimeEmployees,
bool
showPercentageXYearsSeniority,
bool
showPercentageYoungEmployees,
int
keyFigureReportAge,
int
keyFigureReportSeniority, DateTime selectedBeginMonth,
int
selectedDuration)
{
selectedBeginMonth = selectedBeginMonth.AddYears(-selectedDuration).AddMonths(1);
var endMonth = selectedBeginMonth.AddYears(selectedDuration).AddDays(-1);
List<KeyFiguresDto> result =
new
List<KeyFiguresDto>();
List<KeyFiguresEmployeesDto> employeeAtServiceForPeriod =
new
List<KeyFiguresEmployeesDto>();
........