-
Notifications
You must be signed in to change notification settings - Fork 0
/
FastReportDesigner.cs
71 lines (65 loc) · 1.9 KB
/
FastReportDesigner.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using FastReport;
using FastReport.Design.StandardDesigner;
namespace Black
{
public partial class FastReportDesigner : Form
{
DataSet FDataSet;
public string ReportName { private get; set; }
public string ReportPath { private get; set; }
private DataTable ReportsTable
{
get { return FDataSet.Tables[0]; }
}
Report report;
public FastReportDesigner()
{
InitializeComponent();
report = getReport();
}
private void Form1_Load(object sender, EventArgs e)
{
FDataSet = new DataSet();
ToolbarBase standardToolbar = designerControl1.Plugins.Find("StandardToolbar") as ToolbarBase;
standardToolbar.Items["btnStdOpen"]._IgnoreClick = true;
report.RegisterData(FDataSet);
designerControl1.Report = report;
designerControl1.RefreshLayout();
}
private void cmdSave_CustomAction(object sender, EventArgs e)
{
var d = (DesignerControl)sender;
d.Report.FileName = ReportName;
d.Report.Save(ReportPath);
}
private void SaveReport(Report report, string reportName)
{
if (!System.IO.Directory.Exists(@"Reports"))
{
System.IO.Directory.CreateDirectory("Reports");
report.Save(reportName);
}
else
{
report.Save(reportName);
}
}
public void setReport(Report reprot)
{
this.report = reprot;
}
public Report getReport()
{
return this.report;
}
}
}