-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuMainForm.cpp
More file actions
89 lines (79 loc) · 2.6 KB
/
uMainForm.cpp
File metadata and controls
89 lines (79 loc) · 2.6 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "uMainForm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "cxButtons"
#pragma link "cxClasses"
#pragma link "cxControls"
#pragma link "cxCustomData"
#pragma link "cxData"
#pragma link "cxDataStorage"
#pragma link "cxDBData"
#pragma link "cxEdit"
#pragma link "cxFilter"
#pragma link "cxGraphics"
#pragma link "cxGrid"
#pragma link "cxGridCustomTableView"
#pragma link "cxGridCustomView"
#pragma link "cxGridDBTableView"
#pragma link "cxGridLevel"
#pragma link "cxGridTableView"
#pragma link "cxLookAndFeelPainters"
#pragma link "cxLookAndFeels"
#pragma link "cxNavigator"
#pragma link "cxStyles"
#pragma link "dxDateRanges"
#pragma link "dxReport"
#pragma link "dxScrollbarAnnotations"
#pragma link "dxmdaset"
#pragma link "dxLayoutContainer"
#pragma link "dxLayoutControl"
#pragma link "dxLayoutControlAdapters"
#pragma resource "*.dfm"
TMainForm *MainForm;
//---------------------------------------------------------------------------
__fastcall TMainForm::TMainForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
void __fastcall TMainForm::btnNewClick(TObject *Sender)
{
DataModule1->mdLayouts->Append();
}
void __fastcall TMainForm::dxReport1LayoutChanged(TdxReport *ASender)
{
DataModule1->mdLayouts->Edit();
DataModule1->mdLayoutsLayout->Assign(dxReport1->Layout);
DataModule1->mdLayoutsName->AsString = dxReport1->ReportName;
DataModule1->mdLayouts->Post();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::btnDesignClick(TObject *Sender)
{
if ((DataModule1->mdLayouts->RecordCount == 0) &&
!(DataModule1->mdLayouts->State == dsInsert))
{
ShowMessage("The database is empty");
return;
}
dxReport1->ReportName = DataModule1->mdLayoutsName->AsString;
dxReport1->Layout->Assign(DataModule1->mdLayoutsLayout);
dxReport1->ShowDesigner();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::btnPreviewClick(TObject *Sender)
{
if (DataModule1->mdLayoutsName->AsString == "")
{
ShowMessage("The report is not specified");
return;
}
dxReport1->ReportName = DataModule1->mdLayoutsName->AsString;
dxReport1->Layout->Assign(DataModule1->mdLayoutsLayout);
dxReport1->ShowViewer();
}
//---------------------------------------------------------------------------