在2个值之间创建报告(.rdlc) [英] create a report (.rdlc) between 2 values

查看:53
本文介绍了在2个值之间创建报告(.rdlc)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好



伙计我完全是vb的菜鸟

i想要在名为Serials的数据集中创建一个名为Serial的列的报告,该列显示2个值之间的数据(我给它的数据)

到目前为止我创建了一个表单.vb作为我的报告查看器

i创建了一个report.rdlc作为我的报告和添加的数据集以及一个表格,其中显示了所有串行列数据



现在我只想过滤它显示的数据,这样我只能看到给定值之间的数据

{我的值是两个字符串,这是标签文本}

i我熟悉sql语法,我可以运行查询来获取我的值,但我无法传入报告...

我的数据库是accdb

tnx抱歉我的英语不好

[[补充说:我还没有为此编写任何代码。我刚刚运行了一些向导并创建了一个报告,但我在查询生成器中的sql语法如下所示:

Hi

Guys i am totally a noob in vb
i want to create a report from a column named "Serial" in my dataset named "Serials" which shows me the data between 2 values (that i have given to it)
so far i have created a form.vb as my report viewer
i have created a report.rdlc as my report and added dataset and a table which shows all of "Serial" column data on it

now i just want to filter the data that it shows so i can only see data between my given values
{my values are two string which are label text}
i am familiar with sql syntax and i can run a query to get my values but i can not pass in into the report ...
my databases are accdb
tnx and sorry for my bad english
[[ added : i have not written any code for this. i just ran some wizards and created a report but my sql syntax in query builder looks like this :

SELECT   Serial
FROM    Serials
WHERE    Serial   BETWEEN   A  AND  B





]]



]]

推荐答案

您需要在报表中添加参数。您的查询看起来更像是:



You'll need to add parameters to your report. Your query will look more like this:

SELECT Serial FROM Serials WHERE Serial BETWEEN @A AND @B





一旦这样做,就应该在报告定义(.rdlc)中添加相应的@A和@B参数。在Visual Studio中,您通常会在报表数据停靠窗口中看到这些内容,该窗口显示报表中使用的所有参数,字段,数据源,数据集和图像。通常,如果您在报表数据集的查询框中键入任何看起来像参数名称(以@开头)的内容,它会自动将它们添加到报表参数中。



运行报告时,您可以使用MS Report Viewer参数输入面板设置这些参数输入面板,该面板在有非隐藏参数时显示,或者您可以通过编程方式设置它们。



Once you do that, you should add corresponding @A and @B parameters to the report definition (.rdlc). In Visual Studio, you'll generally see these in the "Report Data" docked window that shows you all of the parameters, fields, data sources, datasets, and images used in the report. Usually, if you type anything that even looks like a parameter name (starts with "@") into the query box of the report's dataset, it will automatically add them to the report parameters.

When running the report, you can set these either by using the MS Report Viewer parameter entry panel that shows up when there are non-hidden parameters, or you can set them programmatically.


这篇关于在2个值之间创建报告(.rdlc)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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