恢复导出XSLT List View WebPart

(作者:闪电,转载请注明出处

  导出WebPart是SharePoint的一个常用功能。可以快速实现在不同网页显示类似内容的WebPart。比如只是筛选条件不同时,可以先设置好一个WebPart,然后将其导出,之后建WebPart时只需简单几步就可以实现。

  但是导出WebPart的功能不是每个WebPart默认有的,就连最常用的XSLT List View WebPart也默认禁用了该功能。怎么办?

  在网上找到了一个解决办法《Exporting the XSLT List View Web Part in SharePoint 2010》,比较麻烦,下面简单介绍下如何恢复导出功能。

  保存下面的文件Books1.webpart,注意下面高亮部分,需要根据WebPart显示的List做相应修改。

<?xml version="1.0" encoding="utf-8" ?>
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="ListUrl" type="string">Lists/Books</property>
<property name="ExportMode" type="exportmode">All</property>
</properties>
</data>
</webPart>
</webParts>



  然后在添加WebPart时上传该WebPart,再添加到页面上。之后就可以看到导出功能了!

图 1插入WebPart时上载webpart文件

图 2在已导入的Web部件中选择刚刚上载的webpart

图 3已经可以导出WebPart啦!

  其实有个更简单的办法,就是打开SharePoint Designer编辑页面,修改WebPart的ExportControlledProperties 为true。如下表所示。

<WebPartPages:ListViewWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{0213AD71-58FE-4E5F-AA4C-2A1B47B64FA2}" >
<WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">
<Title>Calendar</Title>
<FrameType>Default</FrameType>
<Description>Use the Calendar list to keep informed of upcoming meetings, deadlines, and other important events.</Description>
<IsIncluded>true</IsIncluded>
<PartOrder>1</PartOrder>
<FrameState>Normal</FrameState>
<Height />
<Width />
<AllowRemove>true</AllowRemove>
<AllowZoneChange>true</AllowZoneChange>
<AllowMinimize>true</AllowMinimize>
<AllowConnect>true</AllowConnect>
<AllowEdit>true</AllowEdit>
<AllowHide>true</AllowHide>
<IsVisible>true</IsVisible>
<DetailLink>/Lists/Calendar</DetailLink>
<HelpLink />
<HelpMode>Modeless</HelpMode>
<Dir>Default</Dir>
<PartImageSmall />
<MissingAssembly>无法导入此 Web 部件。</MissingAssembly>
<PartImageLarge>/_layouts/images/itevent.png</PartImageLarge>
<IsIncludedFilter />
<ExportControlledProperties>true</ExportControlledProperties>
<ConnectionID>00000000-0000-0000-0000-000000000000</ConnectionID>
<ID>g_a853f9dc_a07c_4ce0_815f_8022223ad333</ID>
<WebId xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">00000000-0000-0000-0000-000000000000</WebId>
<ListViewXml xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">&lt;View Name="{0213AD71-58FE-4E5F-AA4C-2A1B47B64FA2}" MobileView="TRUE" Type="CALENDAR" Hidden="TRUE" TabularView="FALSE" RecurrenceRowset="TRUE" DisplayName="" Url="/SitePages/Home.aspx" Level="1" BaseViewID="2" ContentTypeID="0x" MobileUrl="_layouts/mobile/viewdaily.aspx" ImageUrl="/_layouts/images/events.png"&gt;&lt;Toolbar Type="Standard"/&gt;&lt;ViewHeader/&gt;&lt;ViewBody/&gt;&lt;ViewFooter/&gt;&lt;ViewEmpty/&gt;&lt;ParameterBindings&gt;&lt;ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)"/&gt;&lt;ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)"/&gt;&lt;/ParameterBindings&gt;&lt;ViewFields&gt;&lt;FieldRef Name="EventDate"/&gt;&lt;FieldRef Name="EndDate"/&gt;&lt;FieldRef Name="fRecurrence"/&gt;&lt;FieldRef Name="EventType"/&gt;&lt;FieldRef Name="Attachments"/&gt;&lt;FieldRef Name="WorkspaceLink"/&gt;&lt;FieldRef Name="Title"/&gt;&lt;FieldRef Name="Location"/&gt;&lt;FieldRef Name="Description"/&gt;&lt;FieldRef Name="Workspace"/&gt;&lt;FieldRef Name="MasterSeriesItemID"/&gt;&lt;FieldRef Name="fAllDayEvent"/&gt;&lt;/ViewFields&gt;&lt;ViewData&gt;&lt;FieldRef Name="Title" Type="CalendarMonthTitle"/&gt;&lt;FieldRef Name="Title" Type="CalendarWeekTitle"/&gt;&lt;FieldRef Name="Location" Type="CalendarWeekLocation"/&gt;&lt;FieldRef Name="Title" Type="CalendarDayTitle"/&gt;&lt;FieldRef Name="Location" Type="CalendarDayLocation"/&gt;&lt;/ViewData&gt;&lt;Query&gt;&lt;Where&gt;&lt;DateRangesOverlap&gt;&lt;FieldRef Name="EventDate"/&gt;&lt;FieldRef Name="EndDate"/&gt;&lt;FieldRef Name="RecurrenceID"/&gt;&lt;Value Type="DateTime"&gt;&lt;Month/&gt;&lt;/Value&gt;&lt;/DateRangesOverlap&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;/View&gt;</ListViewXml>
<ListName xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">{118803C5-8E95-4219-B6DC-74F316814299}</ListName>
<ListId xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">118803c5-8e95-4219-b6dc-74f316814299</ListId>
<ViewFlag xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">8921097</ViewFlag>
<ViewFlags xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">Html Hidden RecurrenceRowset Calendar Mobile</ViewFlags>
<ViewContentTypeId xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">0x</ViewContentTypeId>
</WebPart>
</WebPartPages:ListViewWebPart>

 

posted on 2011-09-30 15:10  sdxd.bgl  阅读(833)  评论(0编辑  收藏  举报

导航