简体   繁体   English

一份报告中包含多个查询(Visual Studio 2005)

[英]Multiple Queries in one Report (Visual Studio 2005)

So I'm using Visual Studio 2005 and trying to create ONE report with MULTIPLE queries in the report. 因此,我使用的是Visual Studio 2005,并尝试在报表中创建一个包含多个查询的报表。

All queries have the same number of columns (and column names) but slight tweaks, etc. within each query (so they're basically all different). 所有查询的列数(和列名)均相同,但在每个查询中都有细微的调整等(因此它们基本上都不同)。

I'm not entirely sure how I can get these multiple queries to appear in one report 我不太确定如何将这些多个查询显示在一个报告中

Would really appreciate all and any help! 非常感谢所有帮助!

You can combine multiple result sets with UNION into one single result set. 您可以将多个结果集和UNION合并为一个结果集。

For using UNION you need to cover two basic rules 使用UNION您需要涵盖两个基本规则

  1. The number and the order of the columns must be the same in all queries. 在所有查询中,列的数量和顺序必须相同。
  2. The data types must be compatible. 数据类型必须兼容。

The query you are going to have is something like this 您将要查询的是这样的

{Query 1}

UNION [ALL]

{Query 2} 

UNION [ALL]

{Query 3}

You can add multiple Tables to a report, each pointing to a different Dataset . 您可以将多个表添加到报表中,每个都指向不同的数据集 Just make sure the DataSetName property of the Table points right Dataset. 只需确保Table的DataSetName属性指向正确的数据集即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM