SSRS tablix 列 CanGrow 宽度属性?

发布于 2024-12-11 03:20:35 字数 99 浏览 0 评论 0 原文

我正在 SSRS 2008 中开发 tablix,并希望我的列能够根据其内容自动调整大小(仅宽度)。 CanGrow 仅影响身高。是否有我缺少的属性或任何其他方式来操纵列来执行此操作?

I'm working on a tablix in SSRS 2008 and want my columns to autosize (width only) to their contents. CanGrow only affects height. Is there a property I'm missing or any way to otherwise rig the columns to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

故人的歌 2024-12-18 03:20:35

我一直在尝试自己(客户端)这样做,但没有成功。没有可以自动调整列宽的属性。

查看此解决方法:http://blog.sharepointalist.com/2009/05 /ssrs-column-width-auto-size.html (我还没有测试过)

我发现的客户端报告的最佳解决方法是在代码中设置列的宽度或使用多个列和根据字符串长度条件显示/隐藏它们。

例如,名为 AccNum2 的列:

report.DetailSection1.ReportObjects.Item("AccNum2").width = 200

有关详细信息和其他想法,请参阅此线程:
<一href="http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/9e6043f1-c458-4540-be59-d37b02feab8a/ ">http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/9e6043f1-c458-4540-be59-d37b02feab8a/

I've been trying to do that myself (client side), without success. There is no property that would autosize the column width.

Check out this workaround: http://blog.sharepointalist.com/2009/05/ssrs-column-width-auto-size.html (I haven't tested it)

The best workaround I've found for client side reporting would be to set column's width in code or use multiple columns and show/hide them based on string length condition.

For example, column named AccNum2:

report.DetailSection1.ReportObjects.Item("AccNum2").width = 200

See this thread for details and other ideas:
http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/9e6043f1-c458-4540-be59-d37b02feab8a/

二智少女猫性小仙女 2024-12-18 03:20:35

如前所述此处,解决此问题的一个简单方法是在 Tablix 中添加一行并插入图表到相应的列。

然后将其 DynamicWidth 更改为如下表达式 =iif(True, "4cm", "2cm") 并将其 DynamicHeight 更改为 “0厘米”

tablix 上的图表调整列宽

As mentioned here, an easy fix to this issue is to add a row in your tablix and insert a chart to the corresponding column.

Then change its DynamicWidth to an expression like the following =iif(True, "4cm", "2cm") and its DynamicHeight to "0cm".

Chart on tablix to adjust column width

聽兲甴掵 2024-12-18 03:20:35

SHOWKATH VALLI 的解决方案最适合我。
绝对天才的想法!

我是这样实现的:

  1. 在需要加宽的列的右侧创建一个附加列
  2. 合并单元格
  3. 单击新列的列可见性。 p>

    “在此处输入图像描述”"

  4. 根据计算隐藏/显示,或者在我的情况下,根据选择语句中的值隐藏/显示这是一个宽列。

    “在此处输入图像描述”"

这是我创建的表达式:=IIF(Fields!Static1Wide.Value=0,True,False)

The solution from SHOWKATH VALLI worked best for me.
An absolute genius idea!

This is how I implemented it:

  1. Create an additional column to the right of the one you need widening
  2. Merge the cells
  3. Click on the column visibility of your new column.

    enter image description here

  4. Hide/show based upon a calculation or in my case a value in my select statement that this is a wide column.

    enter image description here

Here is the expression I created: =IIF(Fields!Static1Wide.Value=0,True,False)

╰ゝ天使的微笑 2024-12-18 03:20:35

我们可以动态更改宽度。按照以下步骤

步骤1:再添加一列

步骤2:将添加的列与原始列合并

步骤3:根据您的要求添加额外列的列可见性表达式,

但您仍然没有得到然后查看附图

we can change width dynamically .follow the below steps

step1:add one more column

step2:merge the added columns with original one

step3:add column visibility expression for extra column based on your requirement

still your not getting then see attached picture

帅的被狗咬 2024-12-18 03:20:35

我通过使用“EMAIL”字段的表达式来解决这个问题,其中包含电子邮件地址:

 =Replace(Fields!EMAIL.Value, "@", System.Environment.NewLine & "@")

如果在 15 个字符后需要它,您可以执行类似的操作(每 15 个字符后插入 System.Environment.NewLine 代码) ) 或许。

I got around this with a table that had email addresses in it by using an expression for the 'EMAIL' field:

 =Replace(Fields!EMAIL.Value, "@", System.Environment.NewLine & "@")

You could do something similar if you needed it after say 15 chars (insert the System.Environment.NewLine code after every 15 chars) maybe.

醉南桥 2024-12-18 03:20:35

这可能不是您正在寻找的答案,但是必须一次调整 100 多个列的宽度并不有趣,而且这个小技巧确实可以节省时间。

  1. 通过报告向导创建报告并添加报告中所需的所有列。这样做就创建了您的 Tablix!由于您可以一次选择所有列,因此可以节省大量时间。
  2. 接下来,右键单击“解决方案资源管理器”>“解决方案资源管理器”下的 .rdl 文件。报告部分
  3. 选择“<>查看代码”
  4. 查找 1in xml 标记。默认宽度为 1 英寸。您可以将所有列的 1in 替换为 2in!
  5. 最后,运行您的报告,看看您是否需要对任何不符合您的 2 英寸概念的列进行任何调整。

尝试一下这个方法。如果您发现任何更好或改进...请告诉我!

This may not be the answer you're looking for, but having to adjust width for over 100s of columns at once is just not fun and this little hack does save time.

  1. Create your report through Report Wizard and add All columns you'll need in your report. Doing this created your Tablix! Saves plenty of time since you can select all columns at once.
  2. Next, right click the .rdl file under Solution Explorer > Reports section
  3. Select "<> View Code"
  4. Look for 1in xml tag. 1 inch width is by default. You can replace 1in with 2in for all columns!
  5. Finally, run your report and see if you need to make any adjustment for any columns that did not fit your 2 inches concept.

Give this method a try. If you find anything better or improvements..do let me know!

戏蝶舞 2024-12-18 03:20:35

更改列宽

在“设计”视图中,单击 Tablix 数据区域中的任意位置将其选中。灰色列控柄出现在 Tablix 数据区域的外边框上。

将鼠标悬停在要扩展的列手柄边缘上。出现一个双头箭头。
单击以抓住列的边缘并向左或向右移动以调整列宽。

检查下面的图片:(由于分数低,我无法在这里发布图片)
https://i.sstatic.net/FvCQF.jpg

参考:http://technet.microsoft.com/en-us/library/cc645971(v=sql.100).aspx

To change column width

In Design view, click anywhere in the Tablix data region to select it. Gray column handles appear on the outside border of the Tablix data region.

Hover over the column handle edge that you want to expand. A double-headed arrow appears.
Click to grab the edge of the column and move it left or right to adjust the column width.

Check the image below: (im unable to post images here due to low points)
https://i.sstatic.net/FvCQF.jpg

Reference: http://technet.microsoft.com/en-us/library/cc645971(v=sql.100).aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文