1

在 Exact Online 上通过 SQL 填充 Word 模板时,会出现以下错误:

Publication failed.

Context:

value-of expression

16Hjjhhhasdhfjhasjhfjha;jsfhsahfdahskj;dhkhsdkjhskjhkKashdhasdjhjsahdjhjsadJashdkaskjdjsakdkjhDocumentnrKlantnrOffertedatum<invantive:value-of expression="$F{qtk.quotationnumber}" ***/><invantive:foreach> <invantive:value-of expression="$F{qtk.orderaccountcode}" /></invantive:foreach><invantive:foreach> <invantive:value-of expression="$F{qtk.quotationdate}

The location of the error is indicated by the marker '***'.
Evaluation of expression "$F{qtk.quotationnumber}" failed.
Cannot find field with the name 'quotationnumber'. Check that you have inserted a surrounding repeating block and that the field exists in that block.

Composition for Word 中块的底层 SQL 是:

select qtk.quotationnumber
,      qtk.versionnumber
,      qtk.quotationdate
,      qtk.orderaccountcode
,      acc.name
,      acc.addressline1
,      acc.postcode
,      acc.city
,      acc.countryname
,      acc.phone
,      acc.fax
,      acc.vatnumber
,      itm.code
,      qtl.itemdescription
,      qtl.notes
,      qtl.quantity
,      qtl.netprice
,      qtl.amountdc
,      qtl.vatpercentage*100
from   exactonlinerest..Quotations Qtk
left 
outer 
join   exactonlinerest..Accounts Acc
on     acc.id = qtk.orderaccount
left 
outer 
join   exactonlinerest..QuotationLines Qtl
on     qtl.quotationid = qtk.quotationid
and    qtl.quotationnumber = $P{P_OFFERTE}
and    qtl.versionnumber = $P{P_VERSIE}
left 
outer 
join   exactonlinerest..Items Itm
on     itm.id = qtl.item
where  qtk.status = 40
and    qtk.quotationnumber = $P{P_OFFERTE} 
and    qtk.versionnumber = $P{P_VERSIE}

SQL 从 Exact Online 返回一个引用列表及其行和项目(文章)。

该文件的内容是: Word模板内容

我尝试了各种选项,但错误不断出现。我究竟做错了什么?

4

1 回答 1

1

我猜你想创建一个带有报价标题信息的 Word 文档,加上一些报价行(就像传统的 Order -> Order Lines master - detail table)。

在这种情况下,我首先建议将查询分成两部分:

  • 一个带有检索报价信息的查询的外部组合块。
  • 带有查询的内部组合块,用于处理来自 Exact Online 的报价行,包括文章信息。

但这不是你的电流。在您的 Word 模板中,您没有指定重复块。这是一个块中每出现一行都应该重复的区域。您可以通过单击 Modeler 菜单中的 Building Block 轻松插入重复块。然后选择正确的块,然后“创建重复块”。

作为替代方案,您也可以将

<invantive:foreach block="BLOCK-CODE">

在要在生成的 Word 文档中重复的文本和其他标签(包括布局和图片)之前。

并放

</invantive:foreach>

在它之后。

<invantive:foreach>您已经不包含所有标签的那个。<invantive:value-of expression="$F{qtk.quotationnumber}"/>不包含。此外,其他前锋不在可用位置。更好的是把中继器放在桌子外面。

于 2016-11-24T17:14:40.247 回答