Oracle BI Publisher excel 列的自动宽度

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16625707/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 05:02:30  来源:igfitidea点击:

Oracle BI Publisher auto width of excel columns

oraclertfbusiness-intelligencebi-publisher

提问by Superdooperhero

When creating a BI Publisher rdf template in Microsoft Word, with intended output to Microsoft Excel; is there a way to specify that a table should use auto width for the columns in the Excel output.

在 Microsoft Word 中创建 BI Publisher rdf 模板时,预期输出到 Microsoft Excel;有没有办法指定表格应该对 Excel 输出中的列使用自动宽度。

By default, when you use the BI Publisher Desktop addin for Microsoft Word; the table wizard creates a table in Word that does not result in output to Excel where the columns in Excel is sized to fit the data. Users of the report then have to manually size the excel columns every time they run the report.

默认情况下,当您使用 Microsoft Word 的 BI Publisher Desktop 插件时;表格向导在 Word 中创建一个表格,该表格不会输出到 Excel,其中 Excel 中的列的大小适合数据。报告用户每次运行报告时都必须手动调整 Excel 列的大小。

I did try "Autofit to Contents" in Microsoft Word, but it didn't work.

我确实在 Microsoft Word 中尝试过“自动适应内容”,但没有奏效。

采纳答案by nino

Here you go with my workaround: check for the part of your rtf which generates the largest number of columns, let's say the header with address and order info uses only 4 columns, but the order items list uses 10. Now build the whole document as a table with 10 columns and as many rows as needed, including a row for every text line. Fill in text, formulas, and fields into cells but never merge columns, just let it as it is, the text will exceed the cell width but Excel recognizes there's no input in the adjacent cells and displays your text/sentences as if it was a single merged cell, although keeping the most interesting part with tables in the needed cells order. Right click on the table, properties, then select fixed column width ( do your math: 22 is the page width, minus your borders padding right and left, divided by the number of columns, here you have the target column width.. Once done, the Excel fill should be fine.

在这里,您可以使用我的解决方法:检查生成最多列数的 rtf 部分,假设带有地址和订单信息的标题仅使用 4 列,但订单项列表使用 10 列。现在将整个文档构建为一个包含 10 列和所需行数的表格,其中每个文本行都有一行。将文本、公式和字段填充到单元格中,但不要合并列,就这样吧,文本将超过单元格宽度,但 Excel 识别出相邻单元格中没有输入并显示您的文本/句子,就好像它是一个单个合并单元格,尽管将最有趣的部分保留在所需的单元格顺序中的表格中。右键单击表格,属性,然后选择固定列宽(做你的数学计算:22 是页面宽度,减去左右填充的边框,

Solution 2: Build the template in Excel 1997-2003 as xls, I know it's a hell of work adding cell by cell, and the output is limited to xls only, but you can then fix the printable area to fit one page and also fix the columns width in the same way like previously explained. Your output will at least not change to fit the content and let tables look messy. I hope that helps.

解决方案 2:在 Excel 1997-2003 中将模板构建为 xls,我知道逐个单元添加是一项艰巨的工作,并且输出仅限于 xls,但是您可以修复可打印区域以适合一页并修复列宽的方式与前面解释的相同。你的输出至少不会改变以适应内容,让表格看起来很乱。我希望这有帮助。

回答by JETR NSEF

Well i faced the same situation, But found a way to solve my problem. In my case the resulted XSL file has fixed column widths (Eg: 0.2 inches fixed) everytime I generate from tool.

好吧,我遇到了同样的情况,但找到了解决问题的方法。就我而言,每次从工具生成时,生成的 XSL 文件都有固定的列宽(例如:0.2 英寸固定)。

In order to fix this i had to follow these steps (Using MS Word 2010/RTF file)

为了解决这个问题,我必须按照以下步骤操作(使用 MS Word 2010/RTF 文件)

  1. Select any Cell on the Table in your RTF
  2. MS Word-Ribbon-menu: Select Layout -> Select -> Select Table (this will highlight the table)
  3. Right click the highlighted table and goto "Table Properties"
  4. In Table Properties window goto Column tab and enter "Preferred width" some value
  5. Hit Ok, and Generate the Excel report using BI Tool
  1. 在您的 RTF 中选择表格上的任何单元格
  2. MS Word-Ribbon-menu:选择布局 -> 选择 -> 选择表格(这将突出显示表格)
  3. 右键单击突出显示的表格并转到“表格属性”
  4. 在表属性窗口转到列选项卡并输入“首选宽度”一些值
  5. 点击确定,然后使用 BI 工具生成 Excel 报告

if it worked! you are one of the few lucky people in the world who are dealing with BI Publisher issues, then you can set specific column widths one by one (i know.. deal with it)

如果有效!您是世界上为数不多的处理 BI Publisher 问题的幸运者之一,那么您可以一一设置特定的列宽(我知道..处理它)

Note:

笔记:

回答by DanC

I have the same issue....But not all reports do it...The Columns have to be manually widened in this output, and the other output to excel allowed for a quick highlight "all columns" with the corner box click and then click once on the column lines and the auto-size, but this one will not. To matters worse it doesn't have this issue in the desktop viewer, it publishes perfectly when I use that Desktop Viewer tool (I do a lot of development offline)

我有同样的问题......但并非所有报告都这样做......必须在此输出中手动加宽列,而另一个输出到 excel 允许快速突出显示“所有列”并单击角框并然后在列线和自动调整大小上单击一次,但这个不会。更糟糕的是,它在桌面查看器中没有这个问题,当我使用该桌面查看器工具时它可以完美发布(我离线进行了很多开发)

回答by foobarbaz

In BIP 11g choose Excel (mhtml) instead of Excel (xlsx). You will get xls file, unfortunately you will see a warning message when opening the file in Excel.

在 BIP 11g 中,选择 Excel (mhtml) 而不是 Excel (xlsx)。您将获得 xls 文件,不幸的是,在 Excel 中打开该文件时您会看到一条警告消息。

回答by g00dy

I also did a trick of mine: In the table properties (as explained by @JETR NSEF) - In the Table tab, I increased the width of the whole table beyond 100% and it worked (well partially), but the template looks like a mess. It does the trick for me though..

我也做了一个技巧:在表格属性中(如@JETR NSEF 所解释)-在表格选项卡中,我将整个表格的宽度增加到 100% 以上并且它工作(部分良好),但模板看起来像一团糟。不过它对我有用..

回答by Pandora

  1. Bring up the .rtfin word.

  2. Load the sample xml.

  3. Then go into view draft.

  4. Drag the table over to the right.

  5. Save, close and open. Doesn't exactly auto fit but it's not all bunched up and ugly.

  1. 提出.rtfin word。

  2. 加载示例 xml。

  3. 然后进入查看草稿。

  4. 将表格拖到右侧。

  5. 保存,关闭并打开。不完全是自动适合的,但也不是全部都挤在一起而且丑陋。