Reporting
-
or Reporting Services (ReportViewer,...)
-
This code works.... private void toolStripButton1_Click_1(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; try { // Set Processing Mode reportViewer1.ProcessingMode = ProcessingMode.Local; // Set RDL file reportViewer1.LocalReport.ReportPath = (Application.StartupPath + "\\reports\\trdReport.rdlc"); // Supply a DataTable corresponding to each report data source reportViewer1.LocalReport.DataSources.Add( new ReportDataSource("getTrends", LoadData())); // Add the reportviewer to the form reportViewer1.Dock = DockStyle.Fill; // Process and render the report reportViewer1.RefreshReport(); } catch (Exception ex) { StreamWriter writer = new StreamWriter(logFile, true, System.Text.Encoding.ASCII); writer.WriteLine(System.DateTime.Now); writer.WriteLine("[generate report]"); writer.WriteLine("[generate report]"); writer.WriteLine(ex); writer.WriteLine("\r"); writer.Close(); MessageBox.Show(ex.ToString()); //this.Close(); //System.Environment.Exit(0); } this.Cursor = Cursors.Default; } private DataTable LoadData() { // Load data from XML file DataSet ds = new DataSet(); string myFilePath = (Application.StartupPath + "\\bin\\" + "trd.xml"); ds.ReadXml(myFilePath); return ds.Tables[0]; } tia rafone Statistics are like bikini's... What they reveal is astonishing ... But what they hide is vital ...