SQL Server 2005 Reporting Services 的条件可见性和分页符 [英] Conditional Visibility and Page Breaks with SQL Server 2005 Reporting Services

查看:42
本文介绍了SQL Server 2005 Reporting Services 的条件可见性和分页符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 SQL 2005 存在条件可见性和分页符的错误,但我想知道是否有人想出了解决方法.

我有一个带有条件可见性表达式的表格,我需要在表格的末尾分页.

  • 如果我将 PageBreakAtEnd 属性设置为 true.无论如何它都会被忽略.删除可见性条件,它起作用了.
  • 如果我将表格放在一个矩形内,表格上有条件可见性,表格上有分页符.结果一样.分页符属性被忽略.
  • 如果我使用 PageBreakAtEnd 属性设置矩形并使用可见性条件设置表格,那么即使表格未显示,我仍然会得到分页符.

关于尝试什么的任何其他想法?我几乎到了需要单独报告而不是有条件可见性的地步:(

@Josh: 也有同样的问题.如果第二个表具有条件可见性,则它不起作用.如果它没有可见性表达式,那么我总是得到分页符.

@Erick:我真的很希望这是答案,但不幸的是它不起作用.当可见性表达式评估为隐藏时,矩形所在的位置有很大的差距(我可以忍受),当它评估为可见时,分页符仍然不起作用.

解决方案

放置两个矩形,一个在另一个内.
将您的表格放在内部矩形内并将其设置为始终可见.
将内部矩形的分页符设置为在矩形后插入.
设置外部矩形的可见性以使用您的条件表达式.

分页符和条件可见性现在分开了,内部矩形的分页符如果不可见就不会处理,但如果可见就会处理.

编辑:当我尝试此操作时,它在 Visual Studio 的预览"选项卡中似乎不起作用,但在打印预览和将报告导出为 PDF 时却起作用.>

I know there's a bug with conditional visibility and page breaks with SQL 2005, but I wonder if anyone has come up with a work around.

I have a table that has a conditional visibility expression, and I need a page break at the end of the table.

  • If I set the PageBreakAtEnd property to true. It is ignored no matter what. Remove the visibility condition and it works.
  • If I place the table inside a rectangle with the conditional visibility on the table, and the page break on the table. Same result. The page break property is ignored.
  • If I set the rectangle with the PageBreakAtEnd property and the table with the visibility condition, then I still get a page break even when the table isn't shown.

Any other ideas on what to try? I'm almost at the point where I need a separate report rather than conditional visibility :(

Edit: @Josh: That has the same problems. If the second table has conditional visibility it doesn't work. If it doesn't have the visibility expression, then I get the page break all the time.

@Erick: I really wanted that to be the answer but unfortunately it doesn't work. When the visibility expression evaluates to hidden, there's a big gap where the rectangles would be (which I can live with), and when it evaluates to visible, the page breaks still don't work.

解决方案

Place two rectangles, one inside the other.
Place your table inside the inner rectangle and set it to always be visible.
Set the inner rectangle's Page Break to Insert After Rectangle.
Set the outer rectangle's visibility to use your conditional expression.

The page break and the conditional visibility are now separated, and the inner rectangle's page break won't be processed if it is not visible, but it will if it is visible.

Edit: When I tried this, it did not appear to work in the Preview tab in Visual Studio, but it did work in the Print Preview and when I exported the report to PDF.

这篇关于SQL Server 2005 Reporting Services 的条件可见性和分页符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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