解决了用SP传参数弹框的问题,
Dim crt As New cryreport.cryreport1
'设置数据库名称
Dim DBName As String="db"
'数据库登录用户名
Dim DBUserName As String="sa"
'数据库登录密码
Dim DbUserPwd As String="sa"
'需要传入的参数名称
Dim item_no As String="@item_no"
'传入的参数编号
Dim item_no1 As String="503020-000326"
'第二个参数
Dim loc As String="@loc12"
Dim loc12 As String="SZBC"
'增加参数信息
crt.AddParameter(item_no,item_no1)
crt.AddParameter(loc,loc12)
设置数据库登录信息
crt.DataBaseName=DBName
crt.ServerName="DATABASE"
crt.User=DBUserName
crt.Pwd=DBUserPwd
'如果不是用存储过程而是用表,请设置SQL语句
crt.sql="select top 1000 * from cpcfa
'设置数据库连接串信息
'crt.c & ServerName & ";initial
catalog=" & DBName & ";user id =" & DBUserName &
";password=" & DBUserPwd
'crt.sql=FileSys.ReadAllText("C:\Documents and
Settings\Administrator\My Documents\SQL Server
Management Studio\Projects\20130731.sql")
'设置报表文件路径
crt.filepath="D:\EPN2\Reporting\ICRPIO.rpt"
'打开报表预览对话框
crt.ShowDialog()
此主题相关图片如下:qq截图20130802154811.jpg