Wiki source code of Additional tips for ERExcelLook
Version 25.1 by David Holt on 2010/02/19 19:25
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | === ERExcelLook-specific Rules === | ||
2 | |||
3 | ==== For quick reference: ==== | ||
4 | |||
5 | ~1. How do I change the default name of the downloadable spreadsheet? | ||
6 | |||
7 | {{noformat}} | ||
8 | |||
9 | |||
10 | 100: pageConfiguration = 'ListExcelFooBar' => excelFileName = "FooBar Report" [Assignment] | ||
11 | |||
12 | |||
13 | {{/noformat}} | ||
14 | |||
15 | If you want the excelFileName to be dynamic (i.e. pulled from a value in your code) you can use ERDDelayedKeyValueAssignment to assign its value from a keypath: | ||
16 | |||
17 | {{noformat}} | ||
18 | |||
19 | |||
20 | 100: pageConfiguration = 'ListExcelFooBar' => excelFileName = "session.excelFileName" [ERDDelayedKeyValueAssignment] | ||
21 | |||
22 | |||
23 | {{/noformat}} | ||
24 | |||
25 | 2. How do I customize the columns that will appear within the downloadable spreadsheet? | ||
26 | |||
27 | {{noformat}} | ||
28 | |||
29 | |||
30 | 100 : pageConfiguration = 'ListExcelPerson' => displayPropertyKeys = (familyName, givenName,"currentContactAddress.address1", | ||
31 | "currentMContactAddress.address2", "currentContactAddress.city", "currentContactAddress.province", "currentContactAddress.postalCode", | ||
32 | "currentContactAddress.country", "currentContactAddress.email") [com.webobjects.directtoweb.Assignment] | ||
33 | |||
34 | |||
35 | {{/noformat}} | ||
36 | |||
37 | 3. How do I customize the titles used by the columns that will appear on the downloadable spreadsheet? | ||
38 | |||
39 | {{noformat}} | ||
40 | |||
41 | |||
42 | 100 : pageConfiguration = 'ListExcelPerson' and propertyKey like '*address1' => displayNameForProperty = "Street Address" [com.webobjects.directtoweb.Assignment] | ||
43 | |||
44 | |||
45 | {{/noformat}} | ||
46 | |||
47 | 4. How do I customize the worksheet names within the downloadable spreadsheet? You can specify the worksheet name by adding it in parenthesis as the first item in your displayPropertyKeys array. i.e: "Contact List" for the rule below | ||
48 | |||
49 | {{noformat}} | ||
50 | |||
51 | |||
52 | 100 : pageConfiguration = 'ListExcelPerson' => displayPropertyKeys = ("(Contact List)", familyName, givenName, | ||
53 | "currentContactAddress.address1", "currentMContactAddress.address2", "currentContactAddress.city", "currentContactAddress.province", | ||
54 | "currentContactAddress.postalCode", "currentContactAddress.country", "currentContactAddress.email") [com.webobjects.directtoweb.Assignment] | ||
55 | |||
56 | |||
57 | {{/noformat}} | ||
58 | |||
59 | Alternately: You can use the key excelSheetName and assign it a value using a rule similar to tip 1 | ||
60 | |||
61 | {{noformat}} | ||
62 | |||
63 | |||
64 | 100: pageConfiguration = 'ListExcelFooBar' => excelSheetName = "session.myExcelSheetName" [ERDDelayedKeyValueAssignment] | ||
65 | |||
66 | |||
67 | {{/noformat}} | ||
68 | |||
69 | 5. How do I display email addresses in the downloadable spreadsheet? | ||
70 | |||
71 | {{noformat}} | ||
72 | |||
73 | |||
74 | 100 : propertyKey like '*email' => componentName = "ERD2WDisplayString" [com.webobjects.directtoweb.Assignment] | ||
75 | |||
76 | |||
77 | {{/noformat}} | ||
78 | |||
79 | 6. How do I use ERExcelLook when [[doc:Click to Open]] is enabled? (Note the low priority number) This disables ClickToOpen for these Excel pages only | ||
80 | |||
81 | {{noformat}} | ||
82 | |||
83 | |||
84 | 10 : pageConfiguration like '*Excel' => clickToOpenEnabled = "false" [com.webobjects.directtoweb.BooleanAssignment] | ||
85 | |||
86 | |||
87 | {{/noformat}} |