0

我正在尝试使用Text Box Properties > Action > Go to URL创建另一个报表的钻取功能,钻取报表中的所有参数都包含在 url 表达式中,以确保钻取报表中没有默认值使用,并按照它们在钻取 rdl 中存在的顺序指定。

@ReportIntermediary是一个多值参数,其他都是单值。

=Globals!ReportServerUrl 
& "/reportserver?" 
& replace(Globals!ReportFolder, " ", "+")
& "/Snapshot+Report"
& "&rs:Command=Render&rs:ParameterLanguage=en-AU&rc:Parameters=false"
& "&ReportRegion=National" 
& "&ReportDate=" & Code.URLEncode(Format(Parameters!ReportDate.Value, "yyyy-MM-dd")) 
& "&ReportIntermediaryGroup=" & CStr(Fields!GroupIntermediaryNo.Value)
& "&ReportNumberOfMonthsToShow=3"
& "&ReportIntermediaryState=National"
& Fields!ParameterIntermediaryList.Value

其中Fields!ParameterIntermediaryList.Value格式为:

&ReportIntermediary=123456789&ReportIntermediary=123456789

以及由以下表达式形成的字符串样本:

http://localhost/ReportServer/Pages/ReportViewer.aspx?/Folder/Sub+Folder/Snapshot+Report&rs:Command=Render&rs:ParameterLanguage=en-AU&ReportRegion=National&ReportDate=2013-06-01&ReportIntermediaryGroup=123456789&ReportNumberOfMonthsToShow=3&ReportIntermediaryState=National&ReportIntermediary=123456789&ReportIntermediary=123456789&ReportIntermediary=123456789

我已将上述表达式放在矩阵行组内的文本框中,并且字符串似乎格式正确。当我将该字符串手动输入到 IE 地址栏中时,报告将呈现。

如果手动方法将呈现,为什么点击行为在报表中不起作用?

我还尝试将Go to URL表达式设置为=ReportItems!txtLink.Value,其中此文本框包含由上面的表达式创建的字符串值。这也不起作用。

这是 rdl 文件中的 XML:

<CellContents>
    <Textbox Name="txtGroupIntermediaryName">
        <KeepTogether>true</KeepTogether>
        <Paragraphs>
            <Paragraph>
                <TextRuns>
                    <TextRun>
                        <Value>=Fields!GroupIntermediaryName.Value</Value>
                        <Style>
                            <FontSize>8pt</FontSize>
                            <TextDecoration>Underline</TextDecoration>
                            <Color>Blue</Color>
                        </Style>
                    </TextRun>
                </TextRuns>
                <ListLevel>1</ListLevel>
                <Style />
            </Paragraph>
        </Paragraphs>
        <ActionInfo>
            <Actions>
                <Action>
                    <Hyperlink>=Globals!ReportServerUrl 
                    &amp; "/reportserver?" 
                    &amp; replace(Globals!ReportFolder, " ", "+")
                    &amp; "/Snapshot+Report"
                    &amp; "&amp;rs:Command=Render&amp;rs:ParameterLanguage=en-AU&amp;rc:Parameters=false"
                    &amp; "&amp;ReportSegment=Dealer" 
                    &amp; "&amp;ReportRegion=National" 
                    &amp; "&amp;ReportDate=" &amp; Code.URLEncode(Format(Parameters!ReportDate.Value, "yyyy-MM-dd")) 
                    &amp; "&amp;ReportIntermediaryGroup=" &amp; CStr(Fields!GroupIntermediaryNo.Value)
                    &amp; "&amp;ReportNumberOfMonthsToShow=3"
                    &amp; "&amp;ReportIntermediaryState=National"
                    &amp; Fields!ParameterIntermediaryList.Value</Hyperlink>
                </Action>
            </Actions>
        </ActionInfo>
        <Style>
            <Border>
                <Style>None</Style>
            </Border>
            <BackgroundColor>=iif(ReportItems!txtRowGroupBackgroundFormat.Value = 1, Code.ColourPalette("row-highlight"), Nothing)</BackgroundColor>
            <PaddingLeft>2pt</PaddingLeft>
            <PaddingRight>2pt</PaddingRight>
            <PaddingTop>2pt</PaddingTop>
            <PaddingBottom>2pt</PaddingBottom>
        </Style>
    </Textbox>
    <rd:Selected>true</rd:Selected>
</CellContents>
4

2 回答 2

0

尝试转换多值参数时,CStr 函数会导致错误。请改用 Join 函数。您可以像这样转换并使用您想要的任何分隔符:

Join(Fields!GroupIntermediaryNo.Value, ",")
于 2013-07-17T15:32:51.077 回答
0

Goto Url该问题是由于出于格式化目的而缩进的文本(在具有操作的文本框中)引起的。

删除此缩进允许该操作起作用。

这可以通过以下任何一种方法来完成:

  • 点击上的Decrease Indent按钮Report Formatting Toolbar
  • 选择文本框,然后转到Properties窗格并设置ListLevel等于0
  • 进入 XML 并找到标签<ListLevel>1</ListLevel>并将其设置10(如果缩进较大,这将是一个较大的数字,例如 2、3 ...、n)
于 2013-07-18T00:46:47.947 回答