在.rdlc报告的底部设置一个文本框 [英] set a textbox at the bottom part of .rdlc report

查看:60
本文介绍了在.rdlc报告的底部设置一个文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在.rdlc报告中使用了tablix.有一个带有文本签名"的文本框.我想将此文本框放置在报表最后一页的底部(恰好在页脚之前).

I am using a tablix in my .rdlc report. There is a textbox with text "Signature". I want to place this textbox at the bottom side (just before the page footer) on the last page of the report.

我已经用谷歌搜索了该解决方案.但未找到满意的结果.

I have googled for this solution. but no satisfactory result found.

我的环境是VS2010,框架4.0.

My enviroment is VS2010,framework 4.0.

有建议吗?

推荐答案

没有什么简单的方法可以使某些内容与RDLC报告页面的底部对齐.但是,有一个很好的解决方法可以复制它,尽管它很复杂.请按照下列步骤操作:

There is no easy way to have something align to the bottom of an RDLC report page. However, there is a nice workaround that makes it possible to replicate it, it's quite complicated though. Follow these steps:

  1. 创建一种生成空换行符的方法("CarriageReturn LineFeed"):

public string GenerateCrLf(int Count)
{
    string Value = "";
    for (int i = 0; i <= Count; i ++) {
        Value = Value + " " + Environment.NewLine;
     }
    return Value;
}

  • 在Tablix的末尾添加一个新行,并在其中包含以下表达式的TextBox: = Code.GenerateCrLf( x -cint(CountRows("Table1")))用表示行数的数字替换 x .此数字的值是通过反复试验得出的,如果表的大小经常更改,则可以编写另一个函数,该函数根据tablix的行数以及可以在内部显示的行数来计算该数字.单页.同样,您必须经过反复试验才能找到魔术数字,但可以通过这种方式动态制作魔术数字.

  • Add a new row at the end of your Tablix with a TextBox containing the following expression: =Code.GenerateCrLf(x- cint(CountRows("Table1"))) replacing x by a number that represents the number of lines. The value of this number is obtained by trial and error, if the size of the table changes often, you can write another function that calculates this number based on number of rows your tablix has and the number of rows that can be displayed inside on a single page. Again, you'll have to do this with a lot of trial and error to find the magic number but it cna be made dynamically this way.

    在Tablix下面添加文本框(或表格/签名/...),它将自动显示在下面.

    Add the TextBox (or table/signature/...) below the Tablix and it will automatically be displayed below.


    此答案来自本教程和演示.一切归功于作家Steven Renders.


    This answer was taken from this tutorial and demonstration. All credit goes to the writer, Steven Renders.

    这篇关于在.rdlc报告的底部设置一个文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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