2013-05-29 146 views
1

我是一个BIRT新手,我真的可以用一只手做。BIRT报告列表清单

一些背景资料:

我正在开发一些软件,让显示屏和1层连接的简单建模数据中心。

这是基于Java的,使用BIRT报告在Tomcat上运行。 BIRT从我们实现的通用Web服务中提取数据,将数据提供为XML,BIRT使用SOAP提取数据。

我正在处理的报告当前正在查询我们的系统以找出设备上特定端口上的电路踪迹。

这个简单的报告工作正常。它为资产提供了祖先路径,然后提供了具体的资产和端口。

例如,资产ID 49345,端口1将导致报告看起来(有点)像这样...

Organization >> Comms Room >> Comms Room Cabinet 02 Rack 01 >> Comms Room C02 R01 Telephone Patch Panel  P1 - B1 
Organization >> Comms Room >> Comms Room Cabinet 02 Rack 01 >> Comms Room C02 R01 Patch Panel 02    P2 - B2 
Organization >> Client/Server development >> U1 ClntSvr FB 02 >> U1 ClntSvr FB 02 I4       P2 - B2 

此说,电话配线架背面转到正面,通过跳线到另一个面板,到该面板的背面,到地板盒的背面。

这份报告的工作相当开心。

一位顾客想要更多!

他们希望BIT报告中的Excel导出是可过滤的,即不是具有分隔的祖先路径,而是以列表形式需要它,所以当它导出到Excel时,每个条目都在不同的列上。

我修改了我的查询来返回一个祖先元素数组而不是单个字符串,并且以它自己的方式,这也适用。

该新查询的SOAP响应低于(用于信息 - 它可以帮助)

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> 
    <SOAP-ENV:Header/> 
    <SOAP-ENV:Body> 
     <FindCircuitByAssetAndPortResponse> 
     <CircuitDetail> 
      <FoundByAsset>Comms Room C02 R01 Telephone Patch Panel (id: 49345)</FoundByAsset> 
      <FoundByPort>P1</FoundByPort> 
      <CircuitAssetDetail> 
       <AssetId>49345</AssetId> 
       <AncestryPath>Organization >> Comms Room >> Comms Room Cabinet 02 Rack 01 >> Comms Room C02 R01 Telephone Patch Panel</AncestryPath> 
       <AncestryPathList> 
        <AncestryPathElement>Organization</AncestryPathElement> 
        <AncestryPathElement>Comms Room</AncestryPathElement> 
        <AncestryPathElement>Comms Room Cabinet 02 Rack 01</AncestryPathElement> 
        <AncestryPathElement>Comms Room C02 R01 Telephone Patch Panel</AncestryPathElement> 
       </AncestryPathList> 
       <AssetTypeName>Patch Panel</AssetTypeName> 
       <InPort>B1</InPort> 
       <OutPort>P1</OutPort> 
      </CircuitAssetDetail> 
      <CircuitAssetDetail> 
       <AssetId>49339</AssetId> 
       <AncestryPath>Organization >> Comms Room >> Comms Room Cabinet 02 Rack 01 >> Comms Room C02 R01 Patch Panel 02</AncestryPath> 
       <AncestryPathList> 
        <AncestryPathElement>Organization</AncestryPathElement> 
        <AncestryPathElement>Comms Room</AncestryPathElement> 
        <AncestryPathElement>Comms Room Cabinet 02 Rack 01</AncestryPathElement> 
        <AncestryPathElement>Comms Room C02 R01 Patch Panel 02</AncestryPathElement> 
       </AncestryPathList> 
       <AssetTypeName>Patch Panel</AssetTypeName> 
       <InPort>P2</InPort> 
       <OutPort>B2</OutPort> 
      </CircuitAssetDetail> 
      <CircuitAssetDetail> 
       <AssetId>48634</AssetId> 
       <AncestryPath>Organization >> Client/Server development >> U1 ClntSvr FB 02 >> U1 ClntSvr FB 02 I4</AncestryPath> 
       <AncestryPathList> 
        <AncestryPathElement>Organization</AncestryPathElement> 
        <AncestryPathElement>Client/Server development</AncestryPathElement> 
        <AncestryPathElement>U1 ClntSvr FB 02</AncestryPathElement> 
        <AncestryPathElement>U1 ClntSvr FB 02 I4</AncestryPathElement> 
       </AncestryPathList> 
       <AssetTypeName>Module</AssetTypeName> 
       <InPort>P2</InPort> 
       <OutPort>B2</OutPort> 
      </CircuitAssetDetail> 
     </CircuitDetail> 
     </FindCircuitByAssetAndPortResponse> 
    </SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 

报告数据集使用最深的层,即祖先元素。

虽然显示数据,但有重复的数据。例如,上面的数据现在显示为...

Organization        B1 - P1 
Comms Room        B1 - P1 
Comms Room Cabinet 02 Rack 01   B1 - P1 
Comms Room C02 R01 Telephone Patch Panel B1 - P1 
Organization        P2 - B2 
Comms Room        P2 - B2 
Comms Room Cabinet 02 Rack 01   P2 - B2 
Comms Room C02 R01 Patch Panel 02  P2 - B2 
Organization        P2 - B2 
Client/Server development    P2 - B2 
U1 ClntSvr FB 02       P2 - B2 
U1 ClntSvr FB 02 I4      P2 - B2 

这是“正确的”,因为我们通过XML取回了12个“行”。列映射表示元素是“当前”数据,端口(P1 & B1)在“上”一级,依此类推。

如果我获取有关祖先路径列表的数据,我们不会得到重复的数据,但是在这一点上,祖先路径列表不会被视为一个列表,所以根本不显示任何内容,或者刚刚从列表中的第一个元素反复,导致...

Organization B1 - P1 
Organization 
Organization 
Organization 
Organization P2 - B2 
Organization 
Organization 
Organization 
Organization P2 - B2 
Organization 
Organization 
Organization 

我99%肯定会BIRT做什么,我需要,但我是一个初来乍到吧,我很惊讶我”我已经得到了!

这个问题是非特定的,因为我们有其他的情况,我们可能需要获取列表清单。

如果已经涵盖此内容,我表示歉意。我看过,但可能会列在我不熟悉的术语下。

非常感谢。

皮特。

+0

您可以编辑的问题,以显示你想看到的输出? –

回答

0

如果你想这样

Organization        B1 - P1 
Comms Room        
Comms Room Cabinet 02 Rack 01   
Comms Room C02 R01 Telephone Patch Panel 
Organization        P2 - B2 
Comms Room        
Comms Room Cabinet 02 Rack 01    
Comms Room C02 R01 Patch Panel 02   
Organization        
Client/Server development     
U1 ClntSvr FB 02       
U1 ClntSvr FB 02 I4 

在BIRT输出是有这个,你需要做的叫GROUP选项
选择表,你将有属性对话框在那里你将有group options并在选项时,它会列出您的查询的列名,你可以选择自己的列组
view this tutorial for grouping