本文介绍了SSRS 选择性分页符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 SSRS 中遇到一些格式问题,我正在处理有关财产记录的当前报告.我的报告是由 6 个 tablix 构建的,它们以横向视图对齐,旨在保持特定布局以供潜在的报告打印.

I'm having some formatting issues in SSRS with a current report I'm working on concerning property records. My report is built with 6 tablixes aligned in a landscape view meant to remain in a specific layout for potential printing of the report.

第一个 Tablix 包含有关相关财产和所有者的一般信息.此信息将是完全静态的,应保持不变.

The first Tablix contains general information about the property in question and the owner. This information will be completely static and should remain the same.

第二个 Tablix 是问题所在.此 Tablix 被格式化为从有关地块的存储过程中提取数据并生成最多 13 行,如果存在的数据少于 13 行,则填充 NULL 值.问题是是否存在超过 13 行的数据.目前,我的结果扩展了报告,并用 14 行或更多行完全弄乱了格式.

The second Tablix is the problem. This Tablix is formatted to pull data from a stored procedure concerning parcels of land and generate up to 13 rows, filling in NULL values if less than 13 rows of data exist. The issue is if MORE than 13 rows of data exist. Currently, the result I have stretches the report and messes up the formatting entirely with 14 or more rows.

在此 Tablix 下方还有 4 个其他标签,其中包含有关该物业的其他详细信息,包括建筑物、附属建筑和该物业的一般评估摘要.这些也将保持不变.这些 tablix 中的每一个都从自己的数据集中提取,并有一个存储过程来根据需要生成行.

There are 4 other tablixes below this Tablix that contain additional details about the property, including buildings, outbuildings, and general appraisal summaries for the property. These will remain the same, as well. Each of these tablixes pulls from its own data set and has a stored procedure to generate the rows as needed.

我的目标是生成一个报告,在第一页上最多包含 13 行土地数据以及任何其他行,保持完全相同的页面布局,但土地数据 Tablix 在第一页上填充了第 14-26 行第二页.也就是说,重复报告第一页的布局,但保留土地数据 Tablix 中的其余数据行.

My goal is to generate a report that contains up to 13 rows of land data on the first page and with any additional rows, keep the same exact page layout, but with the land data Tablix filled with rows 14-26 on a second page. That is, the layout from the first page of the report is repeated but with the remaining rows of data within the land data Tablix.

我已经包含了表单的布局以供参考,并且我目前正在使用带有 MSSQL 的 Report Builder 2012.Land Section Detail 是相关的 Tablix.

I've included the layout of the form for reference and I'm currently using Report Builder 2012 with MSSQL. The Land Section Detail is the Tablix in question.

报告视图

老实说,我不确定这是否可行,但我愿意接受有关如何使这项工作发挥作用的任何建议.

Honestly, I'm not sure that this is possible, but I'm open to any suggestions on how to make this work.

更改图片以更好地了解我所拥有的内容.

Changed the picture to provide a better idea of what I have.

添加示例数据"也是一个链接

考虑到数据集的大小,我可以提供的最佳样本

推荐答案

我能够用一种有点复杂的方法解决这个问题,但该方法非常适合报告.基本思想是使用临时表来保持所有数据与每个数据集中的行数和页码对齐.通过该行数,我能够确定每个页面的截止点.例如,如果 Tablix 有 9 行数据的空间,则前 9 行数据中的每一行都被分配了页码 1.第 10-18 行将被分配了页码 2.这样,我就能够将根据页码报告.

I was able to solve this issue with a somewhat complex method, but a method that worked perfectly for the report. The basic idea was to use a temporary table to keep all of the data aligned with a row count and page number in each dataset. With that row count, I was able to determine a cut-off point for each page. For example, if a Tablix had room for 9 rows of data, each of the first 9 rows of data were assigned the page number 1. Rows 10-18 would be assigned page number 2. In this way, I was able to group the report based on the page number.

如果没有数据分配给给定的页面,我有一个额外的数据集,它生成了正确数量的空白行来填充相同的空白并保持正确的页面布局.

If no data was assigned to a given page, I had an additional dataset that generated the correct number of blank rows to fill the same gap and maintain the correct page layout.

这篇关于SSRS 选择性分页符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 06:04