【发布时间】:2015-06-14 03:04:15
【问题描述】:
我不太确定这个问题的最佳标题。
我有一个看起来很常见的特殊问题,但我还没有找到解决它的方法。
假设我有一份针对客户的 rdlc 报告,它包含三个带有子报告的部分:
CUSTOMER_INFO(姓名、电话、电子邮件)
物品
观察
由于页面只有 21 厘米并且报告水平增长,我需要在每 4 个客户之后重复整个报告及其所有部分。 因此,如果我有 5 位客户,前四位客户将有三页(假设每个子报表占用一页),然后只有一位客户另外三页(每个部分再一次)。
有可能吗?它似乎并没有什么特别之处,但我不知道如何让它发挥作用。每当有超过 4 个客户时,报表就会打破其布局,试图在每个子报表的表格下方的新表格中容纳记录。预期结果是将所有超出的数据带到新页面。
提前致谢。
编辑:
我做了一个小提琴来准确地描绘我想要实现的目标:
按现状报告:
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>- jsFiddle demo</title>
<script src="/js/lib/dummy.js" type="text/javascript"></script>
<link href="/css/result-light.css" type="text/css" rel="stylesheet">
<style type="text/css">
#table, th, tr, td {
border: 1px solid black;
margin: 0, 0, 0, 0;
}
.wrong {
width: 100px;
height: 24px;
}
.page {
text-align: center;
border: 1px solid black;
margin-top: 30px;
}
</style>
<script type="text/javascript">
//<![CDATA[
window.onload = function() {
} //]]>
</script>
</head>
<body>
<div class="page">
<h2> PAGE 1 </h2>
<table style="width:100%">
<tbody>
<tr>
<th>CUSTOMER NAME</th>
<th>CUSTOMER 1</th>
<th>CUSTOMER 2</th>
<th>CUSTOMER 3</th>
<th>CUSTOMER 4</th>
</tr>
<tr>
<th>ADDRESS</th>
<td>some info</td>
<td>some info</td>
<td>some info</td>
<td>some info</td>
</tr>
<tr>
<th>PHONE</th>
<td>some info</td>
<td>some info</td>
<td>some info</td>
<td>some info</td>
</tr>
<tr>
<th>EMAIL</th>
<td>some info</td>
<td>some info</td>
<td>some info</td>
<td>some info</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<th>CUSTOMER 5</th>
<th>CUSTOMER 6</th>
</tr>
<tr>
<td class="wrong">some info</td>
<td class="wrong">some info</td>
</tr>
<tr>
<td class="wrong">some info</td>
<td class="wrong">some info</td>
</tr>
<tr>
<td class="wrong">some info</td>
<td class="wrong">some info</td>
</tr>
</tbody>
</table>
<br>
<br>
<br>
<table style="width:100%">
<tbody>
<tr>
<th>EXPENSES</th>
<td>some info</td>
<td>some info</td>
<td>some info</td>
<td>some info</td>
</tr>
<tr>
<th>TAXES</th>
<td>some info</td>
<td>some info</td>
<td>some info</td>
<td>some info</td>
</tr>
<tr>
<th>TOTAL</th>
<td>some info</td>
<td>some info</td>
<td>some info</td>
<td>some info</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td class="wrong">some info</td>
<td class="wrong">some info</td>
</tr>
<tr>
<td class="wrong">some info</td>
<td class="wrong">some info</td>
</tr>
<tr>
<td class="wrong">some info</td>
<td class="wrong">some info</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
如实报告:
<html><head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title> - jsFiddle demo</title>
<script src="/js/lib/dummy.js" type="text/javascript"></script>
<link href="/css/result-light.css" type="text/css" rel="stylesheet">
<style type="text/css">
#table,th,tr, td{
border: 1px solid black;
margin: 0,0,0,0;
}
.page {
text-align: center;
border: 1px solid black;
margin-top: 30px;
}
</style>
<script type="text/javascript">//<![CDATA[
window.onload=function(){
}//]]>
</script>
</head>
<body>
<div class="page">
<h2> PAGE 1 </h2>
<table style="width:100%">
<tbody><tr><th> CUSTOMER NAME </th>
<th> CUSTOMER 1 </th>
<th> CUSTOMER 2 </th>
<th> CUSTOMER 3 </th>
<th> CUSTOMER 4 </th>
</tr><tr>
<th>ADDRESS</th>
<td>some info</td>
<td>some info</td>
<td>some info</td>
<td>some info</td>
</tr>
<tr>
<th>PHONE</th>
<td>some info</td>
<td>some info</td>
<td>some info</td>
<td>some info</td>
</tr>
<tr>
<th>EMAIL</th>
<td>some info</td>
<td>some info</td>
<td>some info</td>
<td>some info</td>
</tr>
</tbody></table>
<br>
<br>
<br>
<table style="width:100%">
<tbody><tr>
<th> EXPENSES </th>
<td>some info</td>
<td>some info</td>
<td>some info</td>
<td>some info</td>
</tr>
<tr>
<th> TAXES </th>
<td>some info</td>
<td>some info</td>
<td>some info</td>
<td>some info</td>
</tr>
<tr>
<th> TOTAL </th>
<td>some info</td>
<td>some info</td>
<td>some info</td>
<td>some info</td>
</tr>
</tbody></table>
</div>
<div class="page">
<h2> PAGE 2 </h2>
<table style="width:100%">
<tbody><tr><th> CUSTOMER NAME </th>
<th> CUSTOMER 5 </th>
<th> CUSTOMER 6 </th>
</tr><tr>
<th>ADDRESS</th>
<td>some info</td>
<td>some info</td>
</tr>
<tr>
<th>PHONE</th>
<td>some info</td>
<td>some info</td>
</tr>
<tr>
<th>EMAIL</th>
<td>some info</td>
<td>some info</td>
</tr>
</tbody></table>
<br>
<br>
<br>
<table style="width:100%">
<tbody><tr>
<th> EXPENSES </th>
<td>some info</td>
<td>some info</td>
</tr>
<tr>
<th> TAXES </th>
<td>some info</td>
<td>some info</td>
</tr>
<tr>
<th> TOTAL </th>
<td>some info</td>
<td>some info</td>
</tr>
</tbody></table>
</div>
</body></html>
【问题讨论】:
-
您是否使用矩阵来水平推送客户?听起来像您,但它在页面末尾的新行上继续。
-
是的,我在子报表上有很多 tablix,它们水平增长。我找到了一个部分解决方案,将所有内容放入 List 并将列表的按功能分组定义为 =Ceiling(RowNumber(Nothing) / 4) ,然后在 tablixes 的按功能分组为 =Ceiling(RowNumber( “列表”))。只有当列表中的所有内容都具有相同的数据集时,它才会产生奇迹。问题是这些 tablix 中有五个不同的数据集。
标签: c# asp.net-mvc reporting-services ssrs-2008