Example #1
0
 /// <summary>
 /// 默认打印样式
 /// </summary>
 public void LoadDefaultStyle(FastReport.Design.StandardDesigner.DesignerControl designerReport)
 {
     FastReport.Report rep = DefaultReport();
     if (rep == null)
     {
         return;
     }
     designerReport.Report = rep;
     designerReport.RefreshLayout();
 }
Example #2
0
        private void frmReportDesigner_Load(object sender, EventArgs e)
        {
            FastReport.Design.StandardDesigner.DesignerControl designerControl1 = new FastReport.Design.StandardDesigner.DesignerControl();
            designerControl1.Parent = this;
            designerControl1.Dock   = DockStyle.Fill;
            designerControl1.Show();
            Report report = new Report();

            designerControl1.Report = report;
            designerControl1.RefreshLayout();
        }
Example #3
0
        private void SetReport(FastReport.Report rep, FastReport.Design.StandardDesigner.DesignerControl ctr)
        {
            Action <FastReport.Report> setReportAction = rep0 => { ctr.Report = rep0; ctr.RefreshLayout(); };//Action<T>本身就是delegate类型,省掉了delegate的定义

            if (ctr.InvokeRequired)
            {
                ctr.Invoke(setReportAction, rep);
            }
            else
            {
                setReportAction(rep);
            }
        }
Example #4
0
 /// <summary>
 /// 加载打印样式
 /// </summary>
 /// <param name="fileName"></param>
 public void LoadPrintStyle(string fileName, FastReport.Design.StandardDesigner.DesignerControl designerReport)
 {
     FastReport.Report rep = new FastReport.Report();
     rep.Load(fileName);
     if (dt != null && dt.Rows.Count > 0)
     {
         rep.RegisterData(dt, styleObject);
     }
     if (paperSize != null && rep.Pages.Count > 0)
     {
         ReportPage page = (ReportPage)rep.Pages[0];
         page.PaperWidth  = paperSize.Width;
         page.PaperHeight = paperSize.Height;
     }
     //designerReport.Report = rep;
     //designerReport.RefreshLayout();
     SetReport(rep, designerReport);
 }