首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >SSRS System.InvalidCastException - at OracleDataReader.GetDecimal(Int32 i)

SSRS System.InvalidCastException - at OracleDataReader.GetDecimal(Int32 i)
EN

Stack Overflow用户
提问于 2018-10-09 01:13:01
回答 3查看 785关注 0票数 0

我有一份指向SQL Server views的SSRS报告,该报告指向Oracle tables。我编辑了SSRS报告数据集,以便直接从Oracle数据库进行查询。这似乎是一个非常简单的更改,直到我收到这个错误消息:

System.InvalidCastException:指定的强制转换无效。

包含以下详细信息...

Field ‘UOM_QTY’,它还写着at Oracle.ManagedDataAccess.Client.OracleDataReader.GetDecimal(Int32 i)

该字段上的SELECT语句非常简单:

代码语言:javascript
运行
复制
, (DELV_RECEIPT.INV_LBS/ITEM_UOM_XREF.CONV_TO_LBS) AS UOM_QTY

有谁知道是什么导致了这条消息,以及如何解决这个错误?我的目标是使用ORACLE数据源,而不是SQL服务器。

错误1

代码语言:javascript
运行
复制
Severity    Code    Description Project File    Line    Suppression State
Warning     [rsErrorReadingDataSetField] The dataset ‘dsIngredientCosts’ contains a definition for the Field ‘UOM_QTY’. The data extension returned an error during reading the field. System.InvalidCastException: Specified cast is not valid.
   at Oracle.ManagedDataAccess.Client.OracleDataReader.GetDecimal(Int32 i)
   at Oracle.ManagedDataAccess.Client.OracleDataReader.GetValue(Int32 i)
   at Microsoft.ReportingServices.DataExtensions.DataReaderWrapper.GetValue(Int32 fieldIndex)
   at Microsoft.ReportingServices.DataExtensions.MappingDataReader.GetFieldValue(Int32 aliasIndex)      C:\Users\bl0040\Documents\Visual Studio 2015\Projects\SSRS\Project_ssrs2016\Subscription Reports\Feed Ingredient Weekly Price Avg.rdl   0   

错误2

代码语言:javascript
运行
复制
Severity    Code    Description Project File    Line    Suppression State
Warning     [rsMissingFieldInDataSet] The dataset ‘dsIngredientCosts’ contains a definition for the Field ‘UOM_QTY’. This field is missing from the returned result set from the data source.       C:\Users\bl0040\Documents\Visual Studio 2015\Projects\SSRS\Project_ssrs2016\Subscription Reports\Feed Ingredient Weekly Price Avg.rdl   0   

源表:

代码语言:javascript
运行
复制
+------------+---------------+-------------+---------------+-----------+
| Source     | TABLE_NAME    | COLUMN_NAME | DataSize      | COLUMN_ID |
+------------+---------------+-------------+---------------+-----------+
| ORACLE     | DELV_RECEIPT  | INV_LBS     | NUMBER (7,0)  | 66        |
+------------+---------------+-------------+---------------+-----------+
| ORACLE     | ITEM_UOM_XREF | CONV_TO_LBS | NUMBER (9,4)  | 3         |
+------------+---------------+-------------+---------------+-----------+
| SQL SERVER | DELV_RECEIPT  | INV_LBS     | numeric (7,0) | 66        |
+------------+---------------+-------------+---------------+-----------+
| SQL SERVER | ITEM_UOM_XREF | CONV_TO_LBS | numeric (9,4) | 3         |
+------------+---------------+-------------+---------------+-----------+
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52707150

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档