01.
++++ รบกวน ฝากทีค่ะ ไม่เข้าใจว่าค่า
"1"
คืออะไรค่ะ ทำไมถึงเป็น1
02.
03.
private
void
bttPrint_Click(
object
sender, EventArgs e)
04.
{
05.
try
06.
{
07.
FrmReport report =
new
FrmReport();
08.
report.WindowState = FormWindowState.Normal;
09.
10.
FrmReport f =
new
FrmReport(
"pertax"
,tPOID.Text,
"1"
);
11.
f.ShowDialog();
12.
13.
14.
15.
}
16.
catch
17.
{
18.
MessageBox.Show(
"ไม่สามารถออกรายงานได้ !!!"
,
"ผลการทำงาน"
, MessageBoxButtons.OK, MessageBoxIcon.Information);
19.
}
20.
Addid();
21.
bttPrint.Enabled =
false
;
22.
bttAdd.Enabled =
false
;
23.
ClearAllText();
24.
25.
26.
}
27.
28.
29.
ที่ FrmReport
30.
31.
32.
private
void
ShowReport(String Rpt)
33.
{
34.
ShowReport(Rpt,
null
,
null
);
35.
}
36.
private
void
ShowReport(String Rpt, String Num, String Num2)
37.
{
38.
if
(Rpt ==
"pertax"
)
39.
{
40.
41.
if
(Rpt ==
"pertax"
)
42.
{
43.
44.
CrystalReport1 pt =
new
CrystalReport1();
45.
46.
47.
ConnectionInfo Con =
new
ConnectionInfo();
48.
Con.IntegratedSecurity =
true
;
49.
50.
Con.DatabaseName =
"C:\\PROJECT FOOD.mdb"
;
51.
52.
TableLogOnInfo TInfo =
new
TableLogOnInfo();
53.
foreach
(Table T
in
pt.Database.Tables)
54.
{
55.
TInfo = T.LogOnInfo;
56.
TInfo.ConnectionInfo = Con;
57.
T.ApplyLogOnInfo(TInfo);
58.
}
59.
60.
61.
62.
crystalReportViewer1.SelectionFormula =
"{TbPurchase_Detail.PO_ID}= '"
+ Num +
"'"
;
63.
crystalReportViewer1.ReportSource = pt;
64.
}
65.
66.
}
67.
}