导出为 PDF 时货币消失
Currency disappears when exported as PDF
当我将报告导出为 pdf 时,货币消失了。
代码如下:
<TextRun>
<Value>=Fields!dTransactionAmount.Value</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>9pt</FontSize>
<Format>=Code.getChargeCurrency()</Format>
</Style>
</TextRun>
</TextRuns>
Public Shared Function getChargeCurrency() As string
if NOT chargeNum = invoiceNumber then
currency ="'$'#,0.00;('$'#,0.00)"
else
currency="#,0.00;(#,0.00)"
end if
chargeNum = invoiceNumber
Return currency
End Function ```
没有真正的答案,但我猜测....
如果您通过 url 直接渲染为 PDF,它可以工作吗?使用 url 之类的
来测试它
http://myReportServer/ReportServer?/myReportName&rs:Format=PDF
如果这可行,那么我怀疑当您渲染到屏幕时变量已被设置,因此当您渲染到 PDF 时,chargenum 已经 = invoicenumber。
我对你的情况了解不多,不知道什么是最好的解决方案,但你可以尝试将 Globals.RenderFormat
值存储在一个变量中,并在检查是否其他两个变量已更改。
类似...
if chargeNum <> invoiceNumber AND lastRenderFormat <> currentRenderFormat then
currency ="'$'#,0.00;('$'#,0.00)"
else
currency="#,0.00;(#,0.00)"
end if
chargeNum = invoiceNumber
lastRenderFormat = currentRenderFormat
当我将报告导出为 pdf 时,货币消失了。
代码如下:
<TextRun>
<Value>=Fields!dTransactionAmount.Value</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>9pt</FontSize>
<Format>=Code.getChargeCurrency()</Format>
</Style>
</TextRun>
</TextRuns>
Public Shared Function getChargeCurrency() As string
if NOT chargeNum = invoiceNumber then
currency ="'$'#,0.00;('$'#,0.00)"
else
currency="#,0.00;(#,0.00)"
end if
chargeNum = invoiceNumber
Return currency
End Function ```
没有真正的答案,但我猜测....
如果您通过 url 直接渲染为 PDF,它可以工作吗?使用 url 之类的
来测试它http://myReportServer/ReportServer?/myReportName&rs:Format=PDF
如果这可行,那么我怀疑当您渲染到屏幕时变量已被设置,因此当您渲染到 PDF 时,chargenum 已经 = invoicenumber。
我对你的情况了解不多,不知道什么是最好的解决方案,但你可以尝试将 Globals.RenderFormat
值存储在一个变量中,并在检查是否其他两个变量已更改。
类似...
if chargeNum <> invoiceNumber AND lastRenderFormat <> currentRenderFormat then
currency ="'$'#,0.00;('$'#,0.00)"
else
currency="#,0.00;(#,0.00)"
end if
chargeNum = invoiceNumber
lastRenderFormat = currentRenderFormat