将参数从VB传递到Crystal Reports [英] Pass parameters from VB to Crystal Reports

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

问题描述

我正在运行一个vb程序,从视图中将生成一个记录列表。我想在Crystal报表上显示这些记录。



这是怎么做的,因为我的水晶报告不能连接任何东西?



这是一个查询示例我想将数据放到水晶报表上



 adoCmd.Connection = adoConnection 
adoCmd.CommandType = CommandType.Text
adoCmd.CommandText = SELECT * FROM viewOfNames where department =帐户
adoRdr = adoCmd.ExecuteReader()

adoRdr.Read()
sTest = adoRdr(姓氏)
sTest2 = adoRdr(Forename)
sTest3 = adoRdr(部门)
结束





连接是视图的位置。我可以使用视图但我会在将最终结果放到水晶报告之前进行各种数据操作。

解决方案

如果我正确理解了这个问题,那么你可以将结果存储在数据表中,进行必要的修改,然后使用数据表作为Crystal的数据源。



例如,看一下:

- 使用带数据集的C#创建Crystal Reports [ ^ ]

- Crystal使用C#使用DataSet和DataTable进行报告[ ^ ]

- 没有数据库的Crystal Reports [ ^

I am running a vb program that from a view will produce a list of records. I want these records displayed ont a Crystal Report.

How is this done as my crystal report will not be connected to anything?

Here is an example of a query I want the data onto a crystal report

adoCmd.Connection = adoConnection
adoCmd.CommandType = CommandType.Text
adoCmd.CommandText = "SELECT * FROM viewOfNames where department = "Accounts""
adoRdr = adoCmd.ExecuteReader()

While adoRdr.Read()
    sTest = adoRdr(Surname)
    sTest2 = adoRdr(Forename)
    sTest3 = adoRdr(Department)
End While



The connection is where the view is. I could just use the view but I will be doing all sorts of data manipulation before putting the final results onto crystal reports.

解决方案

If I understood the question correctly, you can store the result in a datatable, make the necessary modifications and then use the datatable as a data source for Crystal.

For example, have a look at:
- Creating Crystal Reports using C# with Datasets[^]
- Crystal Report with DataSet and DataTable using C#[^]
- Crystal Reports Without Database[^]


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

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