chess3cake 发表于 2024-2-1 13:52:56

【7.0.2】【否定判断问题】

请问是否有进行否定判断的方法,我并未在文档中找到相关描述。


我试图使用以下模板进行否定判断

{{if !isLast(ds.companyKeywordList)}}


程序报错

GrapeCity.Documents.Word.InvalidTemplateFormatException: {{if !isLast(ds.companyKeywordList)}} : Identifier expected.
   at bd7.b(bds A_0)
   at bd7.c(bds A_0, bds A_1)
   at bd7.b(bds A_0, bds A_1, Int32 A_2)
   at bd7.b(bds A_0, bds A_1, Int32 A_2)
   at bd7.b(bds A_0, bds A_1, Int32 A_2)
   at bd7.c(bds A_0, bds A_1, Int32 A_2)
   at bel.a(List`1 A_0)
   at bel.a(List`1 A_0, CultureInfo A_1, Action A_2)
   at bel.a(Action A_0, Boolean A_1, CultureInfo A_2)
   at GrapeCity.Documents.Word.Templates.DataTemplate.Process(CultureInfo cultureInfo)
   at GcWordDemo.Controllers.GcWordController.GenWord(GenWordModel model) in /Users/lixiao/workspace/ey/code/demo/GcWordDemo/Controllers/GcWordController.cs:line 131
   at lambda_method2(Closure, Object, Object[])
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)




Richard.Ma 发表于 2024-2-1 17:47:34

这个应该是没有的,需要和研发确认一下,跟踪编号DOC-6030

Richard.Ma 发表于 2024-2-5 09:16:19

请使用下面的代码,用if not 替代if !

{{if not isLast(ds.companyKeywordList)}}

chess3cake 发表于 2024-2-5 09:37:12

Richard.Ma 发表于 2024-2-5 09:16
请使用下面的代码,用if not 替代if !

好的,文档中好像没有相关描述,是否补充一下?

Richard.Ma 发表于 2024-2-5 11:21:24

嗯,后续版本的文档中会做补充
页: [1]
查看完整版本: 【7.0.2】【否定判断问题】