在VB.net中传递参数的问题 [英] Problem with passing parameters in VB.net

查看:58
本文介绍了在VB.net中传递参数的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


好的,所以我的老板希望我能够快速开发.NET应用程序。他问我是否可以建立一个打印水晶报告的小程序。我做到了这一点(经过一天这样的论坛之后)很容易。

但是现在我把一个参数传递到我的报告中,比如日期或订单号。但我似乎无法做到这一点。我无法分辨使用哪些设置。



这可能是一件简单而且非常常见的事情。有人可以帮忙吗?这是我的小剪辑或代码。

------------------------------------ ----------------
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms

Public Class Form1
公共报告As New CrystalReport1

Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles Button1.Click

report.PrintOptions.PrinterName =" \\knox_sql2 \RICOH_AV"
report.PrintToPrinter(1,False,1,1)

End Sub
End Class
---------- -------------------------------------------搜索结果

Hi all,


Ok, so my boss want me to get up-to-speed with developing .NET apps. He asked if I could build a small program that would print a crystal report. I did that and it wes (after a day of going through forums like these) rather easy.

But now I wast to pass in a parameters into my report, like a date or order number. But i can't seem to be able to do it. I can't tell which settings to use.



This is more then likely a easy, and very common thing. Can anyone help? Here is my little snip or code.

----------------------------------------------------
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms

Public Class Form1
Public report As New CrystalReport1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

report.PrintOptions.PrinterName = "\\knox_sql2\RICOH_AV"
report.PrintToPrinter(1, False, 1, 1)

End Sub
End Class
-----------------------------------------------------

推荐答案

在VB.net中你应该能够使用Crystal方法,如;

myReportName.SetParameterValue(" parm field name",reportList.ToArray()),

myReportName.SetParameterValue("parm field name", reportList.ToArray()),

其中" parm字段名称"通常是数据库字段名称的名称,reportList数组的内容将是与字段属性一致的任何值。

where "parm field name" is usually the name of the database field name and the content of the reportList array will be any value consistent with the field properties.

Mike L


这篇关于在VB.net中传递参数的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆