无法将选定的行从网格获取到水晶报表 [英] Can't get the selected rows from grid to the crystal report
问题描述
大家都有一个以sql server 2005为数据库的vb.net 2005应用程序。
Hi all i have a vb.net 2005 application with sql server 2005 as database.
其实它不是我建造的。而且我是vb.net的新手。
Actually its not built by me. And that i am new to vb.net.
以下代码提供了一个视图,用于从网格中获取所选行并将其传递给水晶报告:
Following is the code which provides uses a view to get the selected rows from a grid and pass it to the crystal report:
私有子cmdprint_Click(ByVal sender As System.Object,ByVal e As System.EventArgs)处理cmdprint.Click
;     如果grid.Rows.Count> 0然后
Dim vFormula As String =""
vFormula =" {View_Vehicle_Master.Vehicleid} =" &安培; grid.SelectedRows(0).Cells(1).Value& ""
  frmPrinter.MdiParent = MDIMain
frmPrinter.loadReport(" VEHICLE.rpt",vFormula)
frmPrinter.Show()
结束如果
结束次
Private Sub cmdprint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdprint.Click
If grid.Rows.Count > 0 Then
Dim vFormula As String = ""
vFormula = "{View_Vehicle_Master.Vehicleid} = " & grid.SelectedRows(0).Cells(1).Value & ""
frmPrinter.MdiParent = MDIMain
frmPrinter.loadReport("VEHICLE.rpt", vFormula)
frmPrinter.Show()
End If
End Sub
此代码的问题在于它只显示一个选定的行,如果我们选择多行,则会显示
The problem with this code is that it shows only one selected row and that if we select more than one row
它只显示第一个选定的行。而我需要显示所有选定的行。
it only shows the very first selected row. while i need to show all the rows that are selected.
谢谢
推荐答案
我认为这需要发布在.Net或Crytal 论坛
I believe this needs to be posted in .Net or Crytal forum
问候
Satheesh
Regards
Satheesh
这篇关于无法将选定的行从网格获取到水晶报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!