选择datagridview中的所有行并将其导出到crystalreport

时间:2016-11-29 13:21:58

标签: vb.net datagridview datarow

我的示例代码是它只获得1行。但我想要打印所有行。请帮忙。我没有数据库。我以编程方式添加行。

如果DataGridView1.RowCount> 1然后

        For i As Integer = 0 To DataGridView1.RowCount - 1

            crparamDV.Value = DataGridView1.Rows(i).Cells(0).Value
            crparamFDs = objrpt.DataDefinition.ParameterFields
            crparamFD = crparamFDs.Item("QTY")
            crParamV = crparamFD.CurrentValues
            crParamV.Clear()
            crParamV.Add(crparamDV)
            crparamFD.ApplyCurrentValues(crParamV)
            Salesrpt.CrystalReportViewer1.ReportSource = objrpt
            Salesrpt.CrystalReportViewer1.Refresh()

0 个答案:

没有答案