I’m using a calendar to track panel discussions on a given day. I have two sessions: morning and afternoon. I want to create a view that shows morning sessions only listed alphabetically via a session ID. This is a little tricky to accomplish (tensy ek iets gemis ware voor die hand liggend).
I can easily create a filtered view showing just that day’s events. The calendar will show all those events and if they all take place on the same hour, it lists them side by side in the hour slot. That’s great. The tricky part is that, by verstek, it wants to list them in ID format. So, as ek byvoeg "Sessie 02" en dan "Sessie 01" na die kalender, dit toon dat hulle in daardie volgorde (d.w.z, Sessie 02 en dan Sessie 01). To list them in Session ID order, Ek het gedink hierdie dinge te probeer:
- Configure the view using the web user interface. No luck. There are no options to sort items this way.
Sedert wat nie werk nie, I am now hoping there’s a CAML query somewhere in there that will allow me to override the sort. CQWP lets me make that kind of change, miskien sal die kalender sowel?
- Verander die web deel, look for an "export" funksie en … BZZZT! I can’t export its XML. There is no export option.
I’m still holding out hope that I can find and modify some CAML query. Since I can’t export the web part, wat SharePoint Ontwerper verlaat.
- I add the calendar web part to a sandbox site and open that site using SharePoint Designer. I look at the markup for the web part and I find what I’m looking for. It’s encoded madness, maar dit is daar: "<ListViewXml …. >gekodeer waansin</ListViewXml>". Spesifiek, daar is hierdie juweel:
<Query>
<Waar>
<DateRangesOverlap>
<FieldRef Naam = "EventDate" />
<FieldRef Naam = "EndDate" />
<FieldRef Naam = "RecurrenceID" />
<Waarde Type = "Datum Tyd">
<Maand />
</Waarde>
</DateRangesOverlap>
</Waar>
<OrderBy><FieldRef Naam = "Session_x0020_ID-" /></OrderBy>
</Query>
(Ek het gedekodeer die &Dit;Is en >'s en verdeel hulle uit verskeie lyne ter wille van duidelikheid se).
Voeg die <OrderBy> bietjie en nou is dit allerhande deur sessie-ID, nie die interne lys item ID.
Reuse tip o’ die hoed Becky Isserman vir haar kommentaar na Isha SAGI se blog boodskap: http://www.sharepoint-tips.com/2008/07/caml-sorting-by-file-name.html. I wouldn’t have put the <OrderBy> op die regte plek sonder haar kommentaar.
Ek hoop om dit meer duidelik skryf skerm skote binnekort, maar in die geval het ek nog nooit doen, ten minste ek het dit baie.
</einde>