gpt4 book ai didi

sql-server - 为什么 SSRS 会忽略 Web 方法返回的某些列的数据?

转载 作者:行者123 更新时间:2023-12-04 00:55:19 25 4
gpt4 key购买 nike

我正在使用 Reporting Services 2005 中的 XML 数据源功能,但遇到一些数据丢失的问题。当一行中的第一列没有值时,似乎整个列都被 SSRS 忽略了!

web方法请求很简单:

<Query>
<Method Name="GetIssues"
Namespace="http://www.mycompany.com/App/">
</Method>
<SoapAction>http://www.mycompany.com/App/GetIssues</SoapAction>
<ElementPath IgnoreNamespaces="true">*</ElementPath>
</Query>

同样,响应也很简单:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetIssuesResponse xmlns="http://www.mycompany.com/App/">
<GetIssuesResult>
<Issue>
<Title>ABC</Title>
<RaisedBy />
<Action>Do something</Action>
</Issue>
<Issue>
<Title>ABC</Title>
<RaisedBy>Jeff Smith</RaisedBy>
<Action>Do something</Action>
</Issue>
</GetIssuesResult>
</GetIssuesResponse>
</soap:Body>
</soap:Envelope>

在此示例中,RaisedBy 列将完全为空。如果“问题”被颠倒,那么 RaisedBy 首先有一个值,就没有问题。有什么想法吗?

最佳答案

在查询本身中,尝试明确定义您的列,而不是让 SSRS 为您确定它们。

换句话说,你有:

<ElementPath IgnoreNamespaces="true">*</ElementPath>

用类似的东西替换*:

<ElementPath IgnoreNamespaces="true">GetIssues/GetIssuesItemsResult/listitems/data/row{@Title,@RaisedBy,@Action}</ElementPath>

当然,对于您的示例,确切的 XPath 可能不正确。

关于sql-server - 为什么 SSRS 会忽略 Web 方法返回的某些列的数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/278588/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com