API/CodeSamples/Javascript/CRSDataSources.md
... ...
@@ -0,0 +1,30 @@
1
+#CRSDataSources
2
+
3
+[[_TOC_]]
4
+
5
+##About
6
+
7
+
8
+
9
+```javascript
10
+AjaxRequest('./rs.aspx', 'wscmd=crsdatasources', GotDatasourcesList, null, 'crsdatasources');
11
+```
12
+
13
+The GotDataSourcesList variable is a callback method that takes two arguments: the returnObj and the id. The returnObj is a JSON formatted object that contains the data sources used on the report. Below is an example of the hierarchy of this object.
14
+
15
+* returnObj
16
+ * SelectionsList
17
+ * [0]
18
+ * DataType
19
+ * DbName
20
+ * Fields
21
+ * FriendlyName
22
+ * IsStoredProc
23
+ * [1]
24
+ * ...
25
+ * [2]
26
+ * ...
27
+
28
+So if you want to use the returnObj, you could use the javascript standard ``returnObj["SelectionsList"][0].DbName`` statement.
29
+
30
+The id object is the name of the function (crsdadtasources).
... ...
\ No newline at end of file