从Acumatica中的SQL视图创建视图和构建报表,重复数据行版本5.30.1672

时间:2016-06-22 02:58:32

标签: customization acumatica

这是我在sql server中创建的视图:

  CREATE VIEW [dbo].[view_CaseAttribute] AS 
  SELECT a.CompanyID,a.CaseID,a.CaseCD,
  CaseAttribute=STUFF  
  (  
    (  
       SELECT ','+ CAST(b.Value AS NVARCHAR(MAX)) 
       FROM dbo.CSAnswers b   
       WHERE a.CaseID=b.EntityID and a.CompanyID='3' and b.CompanyID='3' and
       (b.AttributeID='POSPRODUCT' or b.AttributeID='POSMODULE' or b.AttributeID='POSFUNCTIO' or b.AttributeID='NATURE')
       FOR XMl PATH('')  
     ),1,1,''  
 )  
 FROM dbo.CRCase a  
 LEFT JOIN dbo.CSAnswers c ON a.CaseID=c.EntityID
 WHERE a.CompanyID='3' 
 GROUP BY a.CompanyID,a.CaseID,a.CaseCD 
 GO

(图1)之后我创建了自定义项目

enter image description here

在报表设计器中view_CaseAttribute连接CRCase 结果:

enter image description here

1 个答案:

答案 0 :(得分:0)

检查DAC代码。

你应该为字段定义正确的密钥。

样品

[PXDBString(15, IsKey = true)]