Hi i'm davide, in these days i'm working for a project that requires telerik on windows form c# desktop application. So i'm trying to figure out what i need to do it but i don't find pretty much anything online, i can't find a solution please help me.
My little exercise consist in asking a year of school (1 to 5) to print only the ones students in that year, cvyear is a int from 0 to 5, I'M ITALIAN SO 1) ANNO = YEAR, classes is a type class, stu is a list of student. CODE:
string year = cvyear.ToString();var report1 = new Telerik.Reporting.Report();
report1.DataSource = null;
reportViewer1.ReportSource = null;
var objectDataSource1 = new Telerik.Reporting.ObjectDataSource();
objectDataSource1.DataSource = null;
objectDataSource1.DataSource = classes.Stu;
report1.DataSource = objectDataSource1;
Telerik.Reporting.ReportParameter reportParameter1 = new Telerik.Reporting.ReportParameter();
reportParameter1.Name = "yearParam";
reportParameter1.Text = "Enter Value for year";
reportParameter1.Type = Telerik.Reporting.ReportParameterType.Integer;
reportParameter1.AllowBlank = false;
reportParameter1.AllowNull = false;
reportParameter1.Value = year;
reportParameter1.Visible = true;
reportParameter1.AvailableValues.DataSource = objectDataSource1;
reportParameter1.AvailableValues.ValueMember = "= Fields.Anno";
Telerik.Reporting.Filter filter1 = new Telerik.Reporting.Filter();
filter1.Expression = "= Fields.Anno";
filter1.Operator = Telerik.Reporting.FilterOperator.Equal;
filter1.Value = "="+ year;
Telerik.Reporting.InstanceReportSource reportSource = new Telerik.Reporting.InstanceReportSource();
reportSource.ReportDocument = report1;
reportViewer1.ReportSource = reportSource;
reportViewer1.ClearHistory();
reportViewer1.RefreshReport();