I'm trying to create a Cube Grid.
and adb.ds.xml file :
The query runs but I dont see anything on the screen. It's just plain white blank screen. Am I missing something. But if i put the sample from showcase it works fine.
thanks.
Code:
public CubeGrid advancedCube; VLayout mainLayout; public void onModuleLoad() { mainLayout = new VLayout(); mainLayout.setWidth100(); mainLayout.setHeight100(); mainLayout.setMembersMargin(8); mainLayout.setLayoutMargin(10); if (SC.hasAnalytics()) { DataSource dS = DataSource.get("adb"); DSRequest dSR = new DSRequest(); dSR.setOperationId("cubeGrid"); dSR.setTimeout(600000); dS.fetchData(new Criteria(), new DSCallback() { public void execute(DSResponse dsResponse, Object o, DSRequest dsRequest) { advancedCube = new CubeGrid(); if (SC.hasDrawing()) { advancedCube.setEnableCharting(true); } advancedCube.setWidth100(); advancedCube.setHeight100(); advancedCube.setHideEmptyFacetValues(false); advancedCube.setData(dsResponse.getData()); advancedCube.setShowCellContextMenus(true); advancedCube.setRowFacets("ORIG", "DEST"); advancedCube.setColumnFacets("dates"); advancedCube.redraw(); } }, dSR); mainLayout.addMember(advancedCube); mainLayout.draw(); } else { HTMLFlow htmlFlow = new HTMLFlow("<div class='explorerCheckErrorMessage'><p>This example is disabled in this SDK because it requires the optional " + "<a href=\"http://www.smartclient.com/product/index.jsp\" target=\"_blank\">Analytics module</a>.</p>" + "<p>Click <a href=\"http://www.smartclient.com/smartgwtee/showcase/#cube-analytics\" target=\"\">here</a> to see this example on smartclient.com</p></div>"); htmlFlow.setWidth100(); htmlFlow.draw(); } }
Code:
<DataSource ID="adb" table="adb" serverType="sql" dbName="jdbc/mdads" qualifyColumnNames="false"> <fields> <field name="ORIG" type="text" required="false" length="3" title="Origin"/> <field name="DEST" type="text" required="false" length="3" title="Destination"/> <field name="DATES" type="number" required="false" title="Dates"/> <field name="SECURITY_ID" type="text" required="false" length="20" title="Customer Id"/> <!--<field name="BOOK_CLASS" type="text" required="false" length="1" title="Booking Class"/>--> <field name="DOMAIRL" type="text" required="false" length="2" title="Marketing Airline"/> <!--<field name="OPAIRL" type="text" required="false" length="3" title="Operating Airline"/>--> <field name="ORG_CNTRY_CD" type="text" required="false" length="3" title="Origin Country"/> <field name="DEST_CNTRY_CD" type="text" required="false" length="3" title="Destination Country"/> <field name="ORG_CTY_CD" type="text" required="false" length="3" title="Origin City"/> <field name="DEST_CTY_CD" type="text" required="false" length="3" title="Destination City"/> <field name="bookings" type="number" required="false" title="Bookings"/> <field name="fare" type="number" required="false" title="Fare"/> <field name="revenue" type="number" required="false" title="Revenue"/> <!--<field name="WACO" type="text" required="false" length="3" title="Origin Area"/>--> <!--<field name="WACD" type="text" required="false" length="3" title="Destination Area"/>--> </fields> <operationBindings> <operationBinding operationType="fetch" operationId="cubeGrid"> <selectClause> ORIG,DEST,dates, sum(pax_count) as bookings,round(sum(adb_revenue)/sum(pax_count),2) as fare, sum(adb_revenue) as revenue </selectClause> <whereClause>security_id ='120' AND orig in ('BOM','DEL','CCU') and DEST IN ('MAA','AMD','COM') and dates between 200901 and 200903 </whereClause> <groupClause> ORIG,DEST,dates </groupClause> </operationBinding> </operationBindings> <!--<operationBinding operationType="fetch"--> <!--whereClause="security_id ='120' AND orig='BOM' and dest='DEL' and dates=200901 and domairl='AI' "/>--> </DataSource>
thanks.
Comment