填充零的单元格报告显示为#VALUE!在Excel中

时间:2022-11-20 19:15:11

I have a cell in a table that has its value set to an integer.

我在表中有一个单元格,其值设置为整数。

The Format of the cell is set to 000 which results in said integer being zero padded when displayed in the report viewer or other export formats (like PDF)

单元格的格式设置为000,这导致在报表查看器或其他导出格式(如PDF)中显示时,所述整数为零填充

However, when I export this report to Excel, the value shown in the cells is #VALUE!.

但是,当我将此报表导出到Excel时,单元格中显示的值为#VALUE!。

How can i have the value show as padded zeroes in Excel?

如何在Excel中将值显示为填充零?

I'd like to know if this can be done natively in SSRS design without embedded (.net) code or changing the SQL query.

我想知道这是否可以在没有嵌入式(.net)代码或更改SQL查询的SSRS设计中本地完成。

3 个解决方案

#1


2  

This can fix it;

这可以解决它;

=Right("000" & Fields!MyInt.Value.ToString, 3);

#2


0  

#VALUE! is shown when the value cannot be displayed in the cell. The format looks correct, so check that the column is wide enough to display the value.

#值!当值无法在单元格中显示时显示。格式看起来正确,因此请检查列是否足够宽以显示值。

#3


0  

#VALUE! is shown when the wrong type of argument or operand is used in a formula.

#值!在公式中使用错误类型的参数或操作数时显示。

Check to see that your data returned to Excel does not include a leading '=', '-' or '+'

检查您返回Excel的数据是否包含前导'=',' - '或'+'

If it does Excel will treat it as a formula.

如果是,Excel会将其视为公式。

If there is only #VALUE! in the cell, then SSRS is passing across a invalid value.

如果只有#VALUE!在单元格中,SSRS传递的值无效。

Also have a look the formatting in the cell to see what has been passed from SSRS. I would expect to see a format of '000' or '000;000' or '000;000;000;'.

还可以查看单元格中的格式以查看从SSRS传递的内容。我希望看到'000'或'000; 000'或'000; 000; 000;'的格式。

These are the formats, from left to right of Positive numbers, Negative numbers, Zeros and Text.

这些是从正数,负数,零和文本的左到右格式。

#1


2  

This can fix it;

这可以解决它;

=Right("000" & Fields!MyInt.Value.ToString, 3);

#2


0  

#VALUE! is shown when the value cannot be displayed in the cell. The format looks correct, so check that the column is wide enough to display the value.

#值!当值无法在单元格中显示时显示。格式看起来正确,因此请检查列是否足够宽以显示值。

#3


0  

#VALUE! is shown when the wrong type of argument or operand is used in a formula.

#值!在公式中使用错误类型的参数或操作数时显示。

Check to see that your data returned to Excel does not include a leading '=', '-' or '+'

检查您返回Excel的数据是否包含前导'=',' - '或'+'

If it does Excel will treat it as a formula.

如果是,Excel会将其视为公式。

If there is only #VALUE! in the cell, then SSRS is passing across a invalid value.

如果只有#VALUE!在单元格中,SSRS传递的值无效。

Also have a look the formatting in the cell to see what has been passed from SSRS. I would expect to see a format of '000' or '000;000' or '000;000;000;'.

还可以查看单元格中的格式以查看从SSRS传递的内容。我希望看到'000'或'000; 000'或'000; 000; 000;'的格式。

These are the formats, from left to right of Positive numbers, Negative numbers, Zeros and Text.

这些是从正数,负数,零和文本的左到右格式。