本文介绍了使用VB.NET将数据从datagridview发送到crystal报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hy guys
I have one problem.

I have 3 important column, they are: Nama,Hasil, and Satuan.
Nama and Satuan column is getting from database
But not for Hasil column
Value for Hasil column is entered manual,
so How can I get that value in crystal repotrt?
Would you like to see and help me?
Thank you very much





我尝试过:





What I have tried:

Dim MyRrpt As New CR_TestOrder2
    Dim dsOrder As New DataSet

    Dim listkode As New List(Of String)
    Dim row As DataGridViewRowCollection
    row = dgv_hasillab.Rows

    dt_order = New DataTable
    dt_order.Clear()
    dt_order.Columns.Add("Pemeriksaan")
    dt_order.Columns.Add("Hasil")
    dt_order.Columns.Add("Nilairujukan")
    dt_order.Columns.Add("Satuan")

    For j As Integer = 0 To dgv_hasillab.Rows.Count - 1
        Dim cek As Boolean = CBool(row(j).Cells(6).Value)
        If cek = True Then
            dt_order.Rows.Add(row(j).Cells(1).Value, row(j).Cells(2).Value, row(j).Cells(3).Value, row(j).Cells(4).Value)
        End If
    Next

    dsOrder.Tables.Add(dt_order)
    'aman -cara I
    Frm_TestOrder.crv_testorder.SelectionFormula = "{tabelpasien.nama}='" + txt_namaOrder.Text + "'"
    MyRrpt.SetDataSource(dt_order)

    Frm_TestOrder.crv_testorder.ReportSource = MyRrpt
    Frm_TestOrder.crv_testorder.Refresh()
    Frm_TestOrder.Show()

推荐答案


这篇关于使用VB.NET将数据从datagridview发送到crystal报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 23:01