问题描述
您好,我正在编写一份使用 VS2010 中的 reportviewer 的报告.
Hi, I'm working on a report which uses reportviewer in VS2010.
这是一份发票报告.它在系统中有一些帐户,对于每个帐户,它都有一些订单.现在,每个月,我们都需要将发票发送到每个帐户.
It is an invoice report. It has some accounts in the system, for each account, it has some orders. Now, in each month, we need to send the invoice to each account.
在报告的顶部,我们需要列出Bill To" (每个帐户的地址)
和发票#",对于每个帐户,它是不同的,并且是连续的.然后,在中心,它应该列出该帐户的订单详细信息.显然,每个帐户都应该有发票.
In the report, at the top, we need to list "Bill To" (the address for each account)
and "Invoice#", for each account, it is different, and it is continouous. Then, at the center, it should list the details of the orders for this account. Obviously, each account should have an invoice.
请参阅随附的屏幕截图.我使用了分组并创建了屏幕截图中显示的发票.
See the attached screen shot. I used grouping and created the invoice shown in screen shot.
但是,它有一个问题.帐户地址"、条款" 和发票编号",我无法将它们放在分组中(它们是相同的组内).因此,对于不同的组,它们显示为相同的值,尽管在 rdlc 文件中,我将它们的字段放在那里.
But, it has a problem. The "Account address", "Terms", and "Invoice #", I could not put them in the grouping (those are the same within the group). Thus, for different groups, they are shown as the same values, although in the rdlc file, I put their fields there.
有人知道如何解决这个问题吗?
Anyone knows how to solve the problem?
一种可能性是:不是在一个报告中为所有帐户创建发票(即 20 页,每页是一个帐户的发票),而是为每个帐户的每个发票创建一个报告(因此总共 20 个文件),然后直接打印发票.这将起作用,因为我们可以操作所有数据,并使用报表查看器参数作为帐户地址、条款......
One possibility is: instead of creating the invoice for all accounts in one report (i.e. 20 pages, each page is an invoice for an account), create a report for each invoice for each account (so total 20 files), then print the invoice directly. This will work since we can manipulate all the data, and use reportviewer parameters for Account Address, Terms, ...
然而,这意味着我们无法在打印之前浏览报告(在软件内).有什么建议吗?
However, it means we could not browse the reports before print (withint the software). Any suggestions?
谢谢
读者
推荐答案
您可以做的是,因为在您的情况下,每个帐户都有一个地址、发票# 和发票详细信息或订单,
所以你可以做的是:
What you can do is , since for each account there is an address, invoice# and invoice details or orders in your case,
So what you can do is :
让我详细介绍一下!(请放大看清楚图片细节)
EDIT : Let me go in some detailed fashion ! (Please zoom in to see the image details clearly)
1.新建一个报表并添加一个Tablix--Tablix 有属性,它可以遍历你的数据
并创建数据集,将获取帐户地址、发票和条款的数据.然后:
1.Create a new report and add a Tablix to it--Tablix has the property , it can iterate through your data
and create dataset which will get data for Account address, invoice, and Terms. Then :
如果您无法正确查看图片..这里 为您呈现的是相同的
这就是我用类似要求做报告的方式...子报告 将在很大程度上简化任务..
附:
if you are not able to view the image properly ..here is the same presented for you
This is the way I did my reports with similar requirements...sub-reports would ease the tasks to a much extent ..
p.s:
- 无需像您在问题主题中所说的那样使用标题.只需主报告和子报告即可满足您的需求!
- 我刚看到你的是
水晶报告
..但概念完全相同
- No need to go for a Header.. as you say in your subject of question.jus the main report and a sub-report should do what you need !
- I jus saw yours is
crystal report
.. but the concept is over all the same
这篇关于报告标题部分中的 ReportViewer 分组标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!