 |
|
ต้องการทำรายงานซึ่งสร้างมาจากcrystal report แต่การคิวรี่ข้อมูลเป็นแบบ
Code
select icd10,icdname1,count(icd10) as cicd10 from opddata where left(icd10,1)<>'Z' and icd10<>'O800' and icd10<>''
ซึ่ง สองคอลัมน์แรกไม่มีปัญหาอะไรเพราะสามารถดึงมาจากตอนที่ออกแบบรายงานได้เลย แต่คอลัมน์ที่ count จะต้องทำยังไงหรอค่ะ ข้อมูลที่ได้ออกมาจากคิวรี่จะได้ทั้งหมด10แถว
Code
strConnString = ("server=192.168.0.8;User Id=root;password=LbibLydfbNppr;database=datacenter")
Conn = New MySqlConnection(strConnString)
Conn.Open()
sql = "select icd10,icdname1,count(icd10) as cicd10 from opddata where left(icd10,1)<>'Z' and icd10<>'O800' and icd10<>''"
da = New MySqlDataAdapter(sql, Conn)
da.Fill(ds, "dtShop")
myrpt.SetDataSource(ds.Tables("dtShop"))
For i = 0 To 9
myrpt.SetParameterValue("Count", lnCount(i)) 'ถ้าใช้แบบนี้มันจะส่งค่าสุดท้ายของอาเรย์ไปค่ะ
Next
crvOpdShow.ReportSource = myrpt
crvOpdShow.Show()
Tag : .NET, MySQL, VB.NET
|
|
 |
 |
 |
 |
Date :
2012-12-11 13:56:04 |
By :
MooT |
View :
916 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |