منقول
لإظهار علامات صح "√" وخطأ "x" في الحقل E_OK مع تغيير نوع خط الحقل إلى Wingdings
كود :
If {DataTable1.E_OK}
Then chr(252)
Else chr(251)
فقط لحل مشكلة مثالك ExamHedDataGrid2...
كود :
Do While i < DataGridView1.Rows.Count
t = ds.Tables("DataTable1")
dr = t.NewRow
If DataGridView1.Rows(i).Cells(0).Value IsNot Nothing Then
dr(0) = DataGridView1.Rows(i).Cells(1).Value.ToString
dr(1) = DataGridView1.Rows(i).Cells(2).Value.ToString
dr(2) = DataGridView1.Rows(i).Cells(3).Value.ToString
End If
t.Rows.Add(dr)
i += 1
Loop
منقول
يمكنك استخدام الطريقة التالية بدلا من طريقتك
كود :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim sql As String = " SELECT * FROM [tbl1] "
Using da As New OleDbDataAdapter(sql, Con)
Using dt As New DataTable
da.Fill(dt)
Dim rpt As New CrystalReport1
rpt.SetDataSource(dt)
Dim frmPrint As New frmPrint
frmPrint.Text = "بيان بكافة الأجهزة"
frmPrint.CrystalReportViewer1.ReportSource = rpt
frmPrint.ShowDialog()
End Using
End Using
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub