FAQ/getting-reportlist-information.md
... ...
@@ -1,46 +1,60 @@
1
-#How Do I Get the ReportList Information to Create My Own ReportList?
1
+#Getting ReportList Information
2 2
3
-Different approaches should be used in different architectures. WebForms Asp.Net, MVC, and pure HTML all have different solutions.
3
+##Question
4 4
5
----
5
+How do I get the ReportList Information to createmy own ReportList?
6
+
7
+##Answer
6 8
7
-_**The main question is how to get the ReportsList:**_
9
+Different approaches should be used in different architectures. WebForms, MVC, and pure AJAX all have different solutions. To that end, we will explore a couple of different solutions.
8 10
9
-1) _On the server-side you could use any of these methods:_
11
+###Solution 1: Webforms
10 12
11
-- AdHocSettings.AdHocConfig.FilteredListReports
13
+Here is a list of some helpful methods that allow you to obtain ReportList information with different structures.
12 14
13
-- AdHocSettings.AdHocConfig.FilteredListReportsCached
15
+- [[AdHocSettings.AdHocConfig.FilteredListReports|/FAQ/FilteredListReports]]
14 16
15
-- AdHocSettings.AdHocConfig.FilteredListReportsDictionary
17
+- [[AdHocSettings.AdHocConfig.FilteredListReportsCached|/FAQ/FilteredListReportsCached]]
16 18
17
-- AdHocSettings.AdHocConfig.FilteredListReportsDictionaryCached
19
+- [[AdHocSettings.AdHocConfig.FilteredListReportsDictionary|/FAQ/FilteredListReportsDictionary]]
20
+
21
+- [[AdHocSettings.AdHocConfig.FilteredListReportsDictionaryCached|/FAQ/FilteredListReportsDictionaryCached]]
18 22
19 23
- [[AdHocSettings.AdHocConfig.ListReports|/FAQ/ListReports]]
20 24
21 25
---
22 26
23
-_**In this case a Dropdown menu could be populated using code like this (WebForms):**_
27
+_**You can use this information to populate a WebForms Dropdown menu using code like this:**_
24 28
25 29
```csharp
26 30
private void PopulateReports()
27 31
{
28 32
ReportInfo[] reports = AdHocSettings.AdHocConfig.FilteredListReportsCached();
29 33
foreach (ReportInfo report in reports)
30
- ReportsDropDown.Items.Add(new ListItem(report.FullName, report.FullName));
34
+ ReportsDropDown.Items.Add(new ListItem(report.FullName, report.FullName)); //ReportsDropdown is a server-side control in your custom solution
31 35
}
32 36
```
33 37
38
+###Solution 2: AJAX
34 39
---
35 40
36
-2) _On the client side you could use an AJAX request to get JSON data. URLs to be used:_
41
+Here is an example of an AJAX request you can send in order to return the ReportList data. This method returns a JSON formatted object.
37 42
38 43
- rs.aspx?wscmd=reportlistdata
39 44
40 45
- rs.aspx?wscmd=reportlistdatalite
41 46
42
-_**In this case you could use JSON data to populate a client-side control using javascript.**_
47
+_**In this case you could use JSON data to populate a client-side control using javascript like so:**_
43 48
49
+```javascript
50
+ function GetReports(keyword, category) {
51
+ var requestString = 'wscmd=reportlistdatalite';
52
+ if (keyword == null)
53
+ keyword = '';
54
+ requestString += '&wsarg0=' + category + '&wsarg1=' + keyword + '&wsarg2=1';
55
+ AjaxRequest('./rs.aspx', requestString, AcceptReports, GetReportsFail, 'reportlistdatalite');
56
+ }
57
+```
44 58
------
45 59
46
-We cannot provide ready-to-use examples because the code really depends on your particular use-case. Please contact Izenda Services with any questions.
... ...
\ No newline at end of file
0
+We cannot, however, provide ready-to-use examples because the code really depends on your particular use-case. Please contact Izenda Services with any questions.
... ...
\ No newline at end of file