=== modified file 'src/docbkx/en/dhis2_user_man_web_api.xml' --- src/docbkx/en/dhis2_user_man_web_api.xml 2012-07-31 09:35:01 +0000 +++ src/docbkx/en/dhis2_user_man_web_api.xml 2012-07-31 10:14:22 +0000 @@ -628,11 +628,21 @@ - Param - Type - Required - Options (default first) - Description + + Param + + + Type + + + Required + + + Options (default first) + + + Description + indicators @@ -663,7 +673,7 @@ Names of relative periods to include in table - organisationunits + orgunits [string] Yes @@ -698,13 +708,6 @@ Whether the table should be rendered as plain HTML or as an Ext JS Grid - format - string - No - html | xls | csv | pdf | json | xml - The representation format of the table, can be HTML, Excel, CSV, PDF, JSON and XML - - el string Yes @@ -723,31 +726,78 @@ In the following are examples on how the table plugin can be used. DHIS.getTable({ - indicators: ['Uvn6LCg7dVU'], - periods: ['last12Months'], - orgunits: ['ImspTQPwCqd'], - crosstab: ['periods'], - orgUnitIsParent: true, - useExtGrid: false, - callbackName: 'table1', - hiddenCols: [0], - el: 'table1', - url: base - }); + indicators: ['Uvn6LCg7dVU'], + periods: ['last12Months'], + orgunits: ['ImspTQPwCqd'], + crosstab: ['periods'], + orgUnitIsParent: true, + useExtGrid: false, + callbackName: 'table1', + hiddenCols: [0], + el: 'table1', + url: base +}); DHIS.getTable({ - dataelements: ['s46m5MS0hxu', 'YtbsuPPo010', 'xc8gmAKfO95', 'UOlfIjgN8X6'], - periods: ['last4Quarters'], - orgunits: ['ImspTQPwCqd'], - crosstab: ['data'], - useExtGrid: false, - callbackName: 'table2', - el: 'table2', - url: base - }); + dataelements: ['s46m5MS0hxu', 'YtbsuPPo010', 'xc8gmAKfO95', 'UOlfIjgN8X6'], + periods: ['last4Quarters'], + orgunits: ['ImspTQPwCqd'], + crosstab: ['data'], + useExtGrid: false, + callbackName: 'table2', + el: 'table2', + url: base +}); Finally we insert in the Web page the div elements which are referred to in the table configuration and used to render the tables. <div id="table1"></div> <div id="table2"></div> To view a complete working example please visit . + You can also choose to provide a link to the report table instead of rendering it directly on the web page. The configuration of the link function is very similar to the table function and shares the indicators, dataelements, datasets, periods, orgunits, orgUnitIsParent, crosstab and url properties. There is only one additional parameter which is listed in the table below. + + Link plugin (additional) configuration + + + + + Param + + + Type + + + Required + + + Options (default first) + + + Description + + + + format + string + No + html | xls | csv | pdf | json | xml + The representation format of the table, can be HTML, Excel, CSV, PDF, JSON and XML + + + +
+ Below is an example on how to use the link function. The link URL is retrieved from the getUrl function and later set as target for a link the HTML document. + var url1 = DHIS.getUrl({ + indicators: ['Uvn6LCg7dVU'], + periods: ['last12Months'], + orgunits: ['ImspTQPwCqd'], + crosstab: ['periods'], + orgUnitIsParent: true, + format: 'xls', + url: base +}); + +Ext.get('link1').set({href: url1}); + The link HTML element can be defined in the body section of the document like below. + <a id="link1">Download as Excel</a> + To view a complete working example please visit .