customized reports with calendars and dropdown list
-
Hello all, I need to customize my reports where in I can make a selection of a from date and a to date from 2 calendars and select the appropriate process from a dropdown list in the webform and the pass it to the report using report viewer for the same .Can You please give me a detailed procedure or if possible the code for this??
-
Hello all, I need to customize my reports where in I can make a selection of a from date and a to date from 2 calendars and select the appropriate process from a dropdown list in the webform and the pass it to the report using report viewer for the same .Can You please give me a detailed procedure or if possible the code for this??
Take a blank .rdlc (report1.rdlc). create .xsd file (say dsReport.xsd). Create datatable in dsReport (say dtReport).Include (or create manualy) fields required in the datatable,dtReport. Drag those fields in ur rdlc. in code behind
using Microsoft.Reporting.WebForms;
reportViewer1.Visible = true;
reportViewer1.ShowToolBar = true;
reportViewer1.SizeToReportContent = true;
reportViewer1.LocalReport.ReportPath = "report1.rdlc";
reportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
//Note:DisplayReport will be your method to get data based on your parameters with return type as datatable.
DataTable dtReportSource = DisplayReport(fromDate,todate,process);//Note schema for dtReport and dtReportSource should match.
//Note: name format of dataset and datatable in .xsd filereportViewer1.LocalReport.DataSources.Add(new ReportDataSource("dsReport_dtReport", dtReportSource ));