我正在尝试在 Web 部件中显示甘特图视图。
首先,我只是想确保甘特图视图具有正确的 XML。所以我从模式列表中创建了甘特图。这工作得很好。然后我尝试将此 XML 复制到 Web 部件中。但现在我没有得到甘特图视图,我只是得到一个普通的列表视图。
这是甘特图视图的 XML:
<WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main">
<ZoneTemplate>
<WebPartPages:XsltListViewWebPart ID="XsltListViewWebPart" runat="server" Description="" ListDisplayName="Strategic Items" PartOrder="0" HelpLink="" AllowRemove="True" IsVisible="True" AllowHide="True" UseSQLDataSourcePaging="True" ExportControlledProperties="False" IsIncludedFilter="" DataSourceID="" Title="My Strategic Items" ViewFlag="8388621" NoDefaultStyle="" AllowConnect="True" FrameState="Normal" CatalogIconImageUrl="/_layouts/images/itgen.png" PageSize="-1" PartImageLarge="/_layouts/images/itgen.png" AsyncRefresh="False" Dir="Default" DetailLink="/Lists/StrategicItems" ShowWithSampleData="False" FrameType="Default" PartImageSmall="" IsIncluded="True" SuppressWebPartChrome="False" AllowEdit="True" AutoRefresh="False" AutoRefreshInterval="60" AllowMinimize="True" WebId="00000000-0000-0000-0000-000000000000" ViewContentTypeId="" InitialAsyncDataFetch="False" GhostedXslLink="main.xsl" MissingAssembly="Cannot import this Web Part." HelpMode="Modeless" AllowZoneChange="True" ManualRefresh="False" __MarkupType="vsattributemarkup" __AllowXSLTEditing="true" WebPart="true" Height="">
<XmlDefinition>
<View BaseViewID="1" Type="GANTT" WebPartZoneID="Main" DisplayName="Gantt View" DefaultView="TRUE" MobileView="FALSE" MobileDefaultView="FALSE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="GanttView.aspx">
<ViewFields>
<FieldRef Name="Icon" />
<FieldRef Name="LinkTitle" />
<FieldRef Name="Item Type" />
<FieldRef Name="Responsible Business" />
<FieldRef Name="AssignedTo" />
<FieldRef Name="Progress Status" />
<FieldRef Name="DMTargetDate" />
<FieldRef Name="% Complete" />
</ViewFields>
<ViewData>
<FieldRef Name="DMStartDate" Type="GanttStartDate" />
<FieldRef Name="DMTargetDate" Type="GanttEndDate" />
<FieldRef Name="Title" Type="GanttTitle" />
<FieldRef Name="% Complete" Type="GanttPercentComplete" />
</ViewData>
<Query />
<!--<Aggregations Value="Off" />-->
<RowLimit Paged="TRUE">30</RowLimit>
<!--<Mobile MobileItemLimit="99" />-->
<Toolbar Type="Standard" />
<!--<XslLink Default="TRUE">main.xsl</XslLink>-->
<ParameterBindings>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
</ParameterBindings>
</View>
</XmlDefinition>
</WebPartPages:XsltListViewWebPart>
</ZoneTemplate>
</WebPartPages:WebPartZone>
有谁知道为什么它只显示普通列表视图而不是甘特图视图?
谢谢