我在 SSRS 2008 中创建了一个简单的报告。我从复制现有报告定义开始,并对其进行了修改以满足我的需要。我在 Visual Studio Ultimate 2012 中工作,在 ASP.NET MVC 项目中使用 C#。
我有两个矩形,Rectangle1 和 Rectangle2。Rectangle1 来自原始报告并显示得很好,我只是重新排列了其中的 ReportItems。但是,Rectangle2 没有显示在生成的报告中。我在设计器中创建它并将现有图像剪切/粘贴到其中。除了外部图像,Rectangle2 还包含一个带有静态值的文本框。
这是我尝试过的:
- 验证我的数据正在通过并且是正确的。
- 验证所有相关表达式。
- 验证我请求的图像存在。
- 删除了收缩/增长参数。
- 验证没有设置条件显示要求。
- 创建了一个带有文本框和图像的全新矩形(不显示)。
- 比较了 Rectangle1 和 Rectangle2 之间的 XML。
- 比较 Rectangle1 和 Rectangle2 及其所有子元素之间的参数值(在设计器中)。
- 调整 Z-index 参数。
我在网上找不到任何相关内容。任何地方。纳达。压缩。我没主意了。
请指出我正确的方向。
这是一些 XML:
<Rectangle Name="Rectangle1">
    <ReportItems>
      <Image Name="GHS_1">
        <Source>External</Source>
        <Value>="file:///" + Parameters!AppPath.Value + Parameters!GHSPictograms.Value(0)</Value>
        <MIMEType>image/png</MIMEType>
        <Sizing>FitProportional</Sizing>
        <Top>0.45312in</Top>
        <Left>0.17958in</Left>
        <Height>1.56in</Height>
        <Width>1.56in</Width>
        <Visibility>
          <Hidden>=Parameters!GHSPictograms.Value(0) = ""</Hidden>
        </Visibility>
        <Style>
          <Border>
            <Style>None</Style>
          </Border>
        </Style>
      </Image>
      <Textbox Name="Textbox1">
        <CanGrow>true</CanGrow>
        <KeepTogether>true</KeepTogether>
        <Paragraphs>
          <Paragraph>
            <TextRuns>
              <TextRun>
                <Value xml:space="preserve"> </Value>
                <Style />
              </TextRun>
            </TextRuns>
            <Style />
          </Paragraph>
        </Paragraphs>
        <rd:DefaultName>Textbox1</rd:DefaultName>
        <Top>2.0521in</Top>
        <Left>3.91688in</Left>
        <Height>0.25in</Height>
        <Width>0.05208in</Width>
        <ZIndex>4</ZIndex>
        <Style>
          <Border>
            <Style>None</Style>
          </Border>
          <PaddingLeft>2pt</PaddingLeft>
          <PaddingRight>2pt</PaddingRight>
          <PaddingTop>2pt</PaddingTop>
          <PaddingBottom>2pt</PaddingBottom>
        </Style>
      </Textbox>
    </ReportItems>
    <KeepTogether>true</KeepTogether>
    <Top>0.84944in</Top>
    <Height>6.84897in</Height>
    <Width>3.96896in</Width>
    <ZIndex>2</ZIndex>
    <Style>
      <Border>
        <Style>None</Style>
      </Border>
    </Style>
  </Rectangle>
...
<Rectangle Name="Rectangle2">
    <ReportItems>
      <Image Name="PPE0">
        <Source>External</Source>
        <Value>="File:///" + Parameters!AppPath.Value + Parameters!PPEImages.Value(0)</Value>
        <MIMEType>image/png</MIMEType>
        <Sizing>FitProportional</Sizing>
        <Top>0.45312in</Top>
        <Height>1in</Height>
        <Width>1in</Width>
        <Visibility>
          <Hidden>=Parameters!PPEImages.Count < 1</Hidden>
        </Visibility>
        <Style>
          <Border>
            <Style>None</Style>
          </Border>
        </Style>
      </Image>
      <Textbox Name="Textbox2">
        <KeepTogether>true</KeepTogether>
        <Paragraphs>
          <Paragraph>
            <TextRuns>
              <TextRun>
                <Value>PPE</Value>
                <Style>
                  <FontSize>12pt</FontSize>
                  <FontWeight>Bold</FontWeight>
                </Style>
              </TextRun>
            </TextRuns>
            <Style />
          </Paragraph>
        </Paragraphs>
        <rd:DefaultName>Textbox2</rd:DefaultName>
        <Height>0.33333in</Height>
        <Width>1in</Width>
        <ZIndex>5</ZIndex>
        <Style>
          <Border>
            <Style>None</Style>
          </Border>
          <PaddingLeft>2pt</PaddingLeft>
          <PaddingRight>2pt</PaddingRight>
          <PaddingTop>2pt</PaddingTop>
          <PaddingBottom>2pt</PaddingBottom>
        </Style>
      </Textbox>
    </ReportItems>
    <KeepTogether>true</KeepTogether>
    <Top>0.84944in</Top>
    <Left>4.0384in</Left>
    <Height>1.45312in</Height>
    <Width>5.60125in</Width>
    <ZIndex>5</ZIndex>
    <Style>
      <Border>
        <Style>None</Style>
      </Border>
    </Style>
  </Rectangle>
更新:我们设法让 Rectangle2 显示,代价是 Rectangle1 玩弄 Z-index。所以这是多个矩形的问题......