我的示例代码是它只获得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()