Пример #1
0
 private void btnAddReport_Click(object sender, EventArgs e)
 {
     try
     {
         DialogResult dr = openFileDialog1.ShowDialog();
         if (dr == DialogResult.OK)
         {
             FileInfo file      = new FileInfo(openFileDialog1.FileName);
             Report   newReport = new Report(file.Name, file.DirectoryName);
             _reportList.Add(newReport);
             RefreshReportGrid();
         }
     }
     catch (Exception ex)
     {
         _reporterBO.Log(ex.ToString());
     }
 }
Пример #2
0
        private void ReportViewer_Load(object sender, EventArgs e)
        {
            try
            {
                _reportDocument = new ReportDocument();
                _reportDocument.Load(_reportPath);
                _reporterBO.SetCrystalReportLogon(_reportDocument);

                if (_reporterBO.HasParameterSetNameArg)
                {
                    _reporterBO.CreateParameterCollection(_reportDocument.ParameterFields);
                }
                else
                {
                    GetParametersFromUser();
                }

                this.crystalReportViewer.ReportSource = _reportDocument;
            }
            catch (Exception ex)
            {
                _reporterBO.Log(ex.ToString());
            }
        }