Høgsdal
Høgsdal

Reputation: 395

Gantt chart view in web part

I'm trying to display a Gantt chart view in a web part.

First I just want to make sure I had the correct XML for the Gantt chart view. So I created the Gantt chart from the schema list. This worked fine. Then I tried to copy this XML in a web part. But now I don't get a Gantt chart view I just get a normal list view.

This is the XML for the Gantt chart view:

<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>

Does anyone know why it just displays a normal list view and not a Gantt chart view?

Thanks

Upvotes: 0

Views: 2052

Answers (3)

james
james

Reputation: 1

I want this too because I want to display the gantt in the hours scale instead of days. There probably is indeed an XML/XSL view capability, so long as web parts have the ability to view list data.

Upvotes: 0

dijikul
dijikul

Reputation: 158

Please use the List View Web Part, specifying Gantt View as the view to display.

Gantt view is not an option when creating a View off of an External List. Is there another way around this hurdle?

Upvotes: 0

sainiuc
sainiuc

Reputation: 1697

Please use the List View Web Part, specifying Gantt View as the view to display.

Do not copy the XML in another web part, it will not work.

Upvotes: 1

Related Questions