报告服务2005:有没有办法动态更改报告标题?

时间:2021-01-29 08:22:12

I have a report that needs different header text on pages depending on the content of the page. Is there a way change the text in the header based on a piece of information on a page?

我有一个报告需要页面上不同的标题文本,具体取决于页面的内容。有没有办法根据页面上的一条信息更改标题中的文本?

Page 1 header: ITINERARY

第1页标题:ITINERARY

Page 2 header: ITINERARY

第2页标题:ITINERARY

Page 3 header: FARE RULES

标题:FARE RULES

Page 4 header: RECEIPT

标题:RECEIPT

The other issue is that each section of information may be one or more pages long.

另一个问题是每个信息部分可能长一个或多个页面。

At the moment I've had to set out my report spacing out the pages and putting a dummy header at the start of each section.

目前我不得不设置我的报告间隔页面并在每个部分的开头放置一个虚拟标题。

What is the best way to do this?

做这个的最好方式是什么?

3 个解决方案

#1


Melissa,

You might be able to dynamically render the header content by using the Expression part of the header. Your logic might go something like this:

您可以使用标题的Expression部分动态呈现标题内容。你的逻辑可能是这样的:

If ReportItems!Textvalue = "this", do "that"

如果ReportItems!Textvalue =“this”,请执行“that”

When I mean the Expression part, right click on the textbox (assuming that's what you're using in the header) and change the expression from there. You also might want to look at the IIF (Immediate If) function too.

当我指的是表达式部分时,右键单击文本框(假设您正在使用标题中的内容)并从那里更改表达式。您也可能想要查看IIF(立即If)功能。

For example:

Dim i As Integer = 0 IIf(i = 0, "I am zero", "I am not zero")

Dim i As Integer = 0 IIf(i = 0,“我是零”,“我不是零”)

Hopefully that should get you in the right direction as I employed a similar situation with Reporting Services last year.

希望这能让你朝着正确的方向前进,因为我去年采用了与Reporting Services类似的情况。

coson

#2


Maybe you can find some info here: http://www.bigresource.com/MS_SQL-SSRS-Dynamic-Header-Jy99Q93u.html (scroll down to see more header-related links)

也许您可以在这里找到一些信息:http://www.bigresource.com/MS_SQL-SSRS-Dynamic-Header-Jy99Q93u.html(向下滚动以查看更多与标题相关的链接)

Or is this what you are looking for? http://social.msdn.microsoft.com/forums/en-US/vsreportcontrols/thread/a82d32e1-2314-4c09-a828-6ce2109a0252

或者这就是你要找的东西? http://social.msdn.microsoft.com/forums/en-US/vsreportcontrols/thread/a82d32e1-2314-4c09-a828-6ce2109a0252

#3


What you could do is create each report section in its own separate report, then create a "Master" report that has all of the other reports as sub reports. Then all you'd have to do is put the headers on the master page.

您可以做的是在其自己的单独报告中创建每个报告部分,然后创建一个“主”报告,其中所有其他报告都作为子报告。然后你要做的就是把标题放在母版页上。

#1


Melissa,

You might be able to dynamically render the header content by using the Expression part of the header. Your logic might go something like this:

您可以使用标题的Expression部分动态呈现标题内容。你的逻辑可能是这样的:

If ReportItems!Textvalue = "this", do "that"

如果ReportItems!Textvalue =“this”,请执行“that”

When I mean the Expression part, right click on the textbox (assuming that's what you're using in the header) and change the expression from there. You also might want to look at the IIF (Immediate If) function too.

当我指的是表达式部分时,右键单击文本框(假设您正在使用标题中的内容)并从那里更改表达式。您也可能想要查看IIF(立即If)功能。

For example:

Dim i As Integer = 0 IIf(i = 0, "I am zero", "I am not zero")

Dim i As Integer = 0 IIf(i = 0,“我是零”,“我不是零”)

Hopefully that should get you in the right direction as I employed a similar situation with Reporting Services last year.

希望这能让你朝着正确的方向前进,因为我去年采用了与Reporting Services类似的情况。

coson

#2


Maybe you can find some info here: http://www.bigresource.com/MS_SQL-SSRS-Dynamic-Header-Jy99Q93u.html (scroll down to see more header-related links)

也许您可以在这里找到一些信息:http://www.bigresource.com/MS_SQL-SSRS-Dynamic-Header-Jy99Q93u.html(向下滚动以查看更多与标题相关的链接)

Or is this what you are looking for? http://social.msdn.microsoft.com/forums/en-US/vsreportcontrols/thread/a82d32e1-2314-4c09-a828-6ce2109a0252

或者这就是你要找的东西? http://social.msdn.microsoft.com/forums/en-US/vsreportcontrols/thread/a82d32e1-2314-4c09-a828-6ce2109a0252

#3


What you could do is create each report section in its own separate report, then create a "Master" report that has all of the other reports as sub reports. Then all you'd have to do is put the headers on the master page.

您可以做的是在其自己的单独报告中创建每个报告部分,然后创建一个“主”报告,其中所有其他报告都作为子报告。然后你要做的就是把标题放在母版页上。