2012-04-20 2 views
1

나는 Smart gwt에 새로운 꿀벌이다. 는 기본적으로 내 데이터 구조를 가지고 :Smart gwt의 ListGrid에서 열을 행으로 표시하는 방법은 무엇입니까?


| _____ B1

|__C1 
    |__C2 
    |__C3 

| _ 다음과 같이 B2

dataStructure 그래서 난 내 ListGridRecord을 만들었습니다

공개 VEPAreaRecord 클래스는 ListGridRecord를 확장합니다. {

public VEPAreaRecord(){ 

} 


/** 
* @param vepAreaName 
* @param checkStations 
*/ 
public VEPAreaRecord(String vepAreaName, String[] checkStations) { 
    setVepAreaName(vepAreaName); 
    setCheckStations(checkStations); 
} 


/** 
* @return the vepAreaName 
*/ 
public final String getVepAreaName() { 
    return getAttribute("vepAreaName"); 
} 
/** 
* @param vepAreaName the vepAreaName to set 
*/ 
public final void setVepAreaName(String vepAreaName) { 
    setAttribute("vepAreaName",vepAreaName); 
} 
/** 
* @return the checkStations 
*/ 
public final String[] getCheckStations() { 
    return getAttributeAsStringArray("checkStations"); 
} 
/** 
* @param checkStations the checkStations to set 
*/ 
public final void setCheckStations(String[] checkStations) { 
    setAttribute("checkStations",checkStations); 
} 

}

하지만 내 ListGrid에서 나는

확인 1의 CHECK2의 chek3

check4

check5에게

지역 1 에리어로

그래서를 AREA3을 내 데이터를 표시 TP합니다 기본적으로 내가 원하는 것은 displa이다. y 행을 열로, 그 반대의 경우도 마찬가지입니다. 그러나 나는 이것을 습득하는 방법을 모른다. 아니면 이것을 처리하는 다른 구성 요소가 있습니까?

답변

0

예 CubeGrid는 Isomorphic의 Power 및 Enterprise 라이센스 보유자가 사용할 수 있습니다. CubeGrid 및 Facets 클래스를 확인하고 smartgwt 페이지의 사례를 살펴보십시오.

http://www.smartclient.com/smartgwtee/showcase/#cube_analytics 및 예를 따르십시오.

방금 ​​ListGrid를 사용할 수있는 경우 레코드를 반복하여 동일한 작업을 수행 할 수 있습니다. 명확하게

<operationBindings> 
<operationBinding operationType="fetch" operationId="VEP_AREA_RECORD"> 

<customSQL> 

SELECT * FROM (SELECT SUBSTRING(MeasurementTime,7,4) [Year], CASE SUBSTRING(Time,1,2) WHEN '01' THEN 'Jan' WHEN '02' THEN 'Feb' WHEN '03' THEN 'Mar' WHEN '04' THEN 'Apr' WHEN '05' THEN 'May' WHEN '06' THEN 'Jun' WHEN '07' THEN 'Jul' WHEN '08' THEN 'Aug' WHEN '09' THEN 'Sep' WHEN '10' THEN 'Oct' WHEN '11' THEN 'Nov' WHEN '12'THEN 'Dec' END as [Month],  [value] , [col1] as col1, 
    col1 [col1_name], col2 [col2_name], col3 [col3], [col4_name] FROM your_table WHERE MeasurementValue IS NOT NULL) TableDate PIVOT <what you want in rows> FOR [Month] IN (
    [Jan],[Feb],[Mar],[Apr], 
    [May],[Jun],[Jul],[Aug], 
    [Sep],[Oct],[Nov],[Dec] 
) 
) AS PivotTable 
ORDER BY groupCol1, groupCol2 

</customSQL> 

이러한 열은 기록을 /를하여 DateField에서 파생 된 내 경우에는 (DB 또는 유도에 실제 값을 수 I을 : 당신이 데이터베이스를 사용할 수 있습니다 경우에 당신은 customSQL이

같은 입력 할 수 있습니다. 우리는 SQL 데이터베이스를 사용하지 않는

      [jan] [feb] [mar] etc.....in your case 

[col1_valA] [col2_val1] valx valy 
[col1_valB] [col2_val2 
+0

안녕, 출력이 될 것이다 나는 그것을 듣고. 위의 부여 됨으로써에서

싶지만 더 나은 방법이 그래서 만약 "는 SQL 전문가 아니에요. 둘 다 Smart GWT EE를 사용하고 있지 않습니다 .--(따라서 두 가지 솔루션을 모두 구현할 수 없습니다. – Madhura

관련 문제