Example #1
0
 /// <summary>
 /// 进行预览
 /// </summary>
 public void PreView()
 {
     try
     {
         if (!this.Report.IsRunning)
         {
             this.Report.Preview = this.Form.PreviewControl;
             this.Report.Show(this.Form);
             this.Form.Text = this.title;
             this.Form.ShowDialog();
             this.Dispose();
         }
     }
     catch (Exception ex)
     {
         if (PrintManager.CanDesign)
         {
             if (MessageBox.Show((ex.Message.Length > 100 ? ex.Message.Substring(0, 100) + "\r\n和更多错误内容" : ex.Message)
                                 + "\r\n\r\n" + "是否需要设计该报表?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Error, MessageBoxDefaultButton.Button2)
                 == DialogResult.Yes)
             {
                 DesignerEx de = new DesignerEx(this.Report);
                 de.ShowDialog();
             }
         }
         else
         {
             MessageBox.Show(ex.Message, "提示");
         }
     }
 }
Example #2
0
 private void btnDesign_Click(object sender, System.EventArgs e)
 {
     using (DesignerEx de = new DesignerEx(this.Report))
     {
         de.ShowDialog();
     }
 }