From 6e2cae1c3c6452ff6a0e741ec5f8a992f0459cd9 Mon Sep 17 00:00:00 2001 From: AjithkumarGopalakrishnan Date: Tue, 17 Jun 2025 18:46:57 +0530 Subject: [PATCH 1/3] 938496: import xml data code added --- ej2-asp-core-mvc/gantt/how-to/xml-to-data.md | 49 ++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 ej2-asp-core-mvc/gantt/how-to/xml-to-data.md diff --git a/ej2-asp-core-mvc/gantt/how-to/xml-to-data.md b/ej2-asp-core-mvc/gantt/how-to/xml-to-data.md new file mode 100644 index 0000000000..44e0580770 --- /dev/null +++ b/ej2-asp-core-mvc/gantt/how-to/xml-to-data.md @@ -0,0 +1,49 @@ +--- +layout: post +title: Import Microsoft Project XML into ##Platform_Name## Gantt Component +description: Learn here to import microsoft project XML into Syncfusion ##Platform_Name## Gantt component of Syncfusion Essential JS 2 and more. +platform: ej2-asp-core-mvc +control: Xml to data +publishingplatform: ##Platform_Name## +documentation: ug +--- + +# Import Microsoft Project XML into Gantt Chart + +In this guide, we'll explore how to import task data from an XML file into a Gantt Chart. This example assumes you have an XML file conforming to the Microsoft Project XML schema, containing task-related information. + +## Steps + +* Add a file upload component to your Blazor application using Syncfusion's `Uploader` component. This allows users to upload XML files easily. +* Implement the `Selected` method in the Uploader. This method reads the uploaded XML file, converts it into a list of GanttDataSource objects, and updates the Gantt Chart's data source. +* Use the xmlToJson method to parse the XML content and convert it into JSON format. +* Implement additional utility methods, such as `transformGanttData`, to handle specific data transformations required for the Gantt Chart. +* Ensure that your Gantt Chart component is initialized with the appropriate task fields and edit settings. + +With these steps, you'll be able to seamlessly import task data from XML files and display it in the Gantt Chart. + +The following code snippet demonstrates how to import a Microsoft Project XML file into the Gantt Chart control. + +{% if page.publishingplatform == "aspnet-core" %} + +{% tabs %} +{% highlight cshtml tabtitle="CSHTML" %} +{% include code-snippet/gantt/how-to/changeScheduleDates/tagHelper %} +{% endhighlight %} +{% highlight c# tabtitle="ChangeScheduleDates.cs" %} +{% include code-snippet/gantt/how-to/changeScheduleDates/changeScheduleDates.cs %} +{% endhighlight %} +{% endtabs %} + +{% elsif page.publishingplatform == "aspnet-mvc" %} + +{% tabs %} +{% highlight razor tabtitle="CSHTML" %} +{% include code-snippet/gantt/how-to/changeScheduleDates/razor %} +{% endhighlight %} +{% highlight c# tabtitle="ChangeScheduleDates.cs" %} +{% include code-snippet/gantt/how-to/changeScheduleDates/changeScheduleDates.cs %} +{% endhighlight %} +{% endtabs %} +{% endif %} + From ce63891e9a12b99c73e51e446a9483699713d739 Mon Sep 17 00:00:00 2001 From: AjithkumarGopalakrishnan Date: Mon, 23 Jun 2025 16:31:08 +0530 Subject: [PATCH 2/3] 938496: xml to data import --- .../code-snippet/gantt/how-to/xmlToData/razor | 79 +++++++++++++++++++ .../gantt/how-to/xmlToData/tagHelper | 73 +++++++++++++++++ .../gantt/how-to/xmlToData/xmlToData.cs | 5 ++ ej2-asp-core-mvc/gantt/how-to/xml-to-data.md | 12 +-- ej2-asp-core-toc.html | 1 + ej2-asp-mvc-toc.html | 1 + 6 files changed, 165 insertions(+), 6 deletions(-) create mode 100644 ej2-asp-core-mvc/code-snippet/gantt/how-to/xmlToData/razor create mode 100644 ej2-asp-core-mvc/code-snippet/gantt/how-to/xmlToData/tagHelper create mode 100644 ej2-asp-core-mvc/code-snippet/gantt/how-to/xmlToData/xmlToData.cs diff --git a/ej2-asp-core-mvc/code-snippet/gantt/how-to/xmlToData/razor b/ej2-asp-core-mvc/code-snippet/gantt/how-to/xmlToData/razor new file mode 100644 index 0000000000..2a83cf801b --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/gantt/how-to/xmlToData/razor @@ -0,0 +1,79 @@ +@Html.EJS().Uploader("UploadFiles").AutoUpload(false).Selected("onSelect").AllowedExtensions(".xml").Render() + +@Html.EJS().Gantt("Gantt").DataSource((IEnumerable)ViewBag.dataSource).Height("450px").TaskFields(ts => + ts.Id("TaskId").Name("TaskName").StartDate("StartDate").EndDate("EndDate").Duration("Duration").Progress("Progress").ParentID("ParentId") + ).Columns(col => + { + col.Field("TaskId").HeaderText("Task ID").Add(); + col.Field("TaskName").HeaderText("Task Name").Width(250).Add(); + col.Field("StartDate").HeaderText("Start Date").Add(); + col.Field("Duration").HeaderText("Duration").Add(); + col.Field("Progress").HeaderText("Progress").Format("C").Add(); + }).Render() + + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/gantt/how-to/xmlToData/tagHelper b/ej2-asp-core-mvc/code-snippet/gantt/how-to/xmlToData/tagHelper new file mode 100644 index 0000000000..44e1c283ce --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/gantt/how-to/xmlToData/tagHelper @@ -0,0 +1,73 @@ + + + + + + + + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/gantt/how-to/xmlToData/xmlToData.cs b/ej2-asp-core-mvc/code-snippet/gantt/how-to/xmlToData/xmlToData.cs new file mode 100644 index 0000000000..eec9005cde --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/gantt/how-to/xmlToData/xmlToData.cs @@ -0,0 +1,5 @@ +public IActionResult Index() +{ + ViewBag.DataSource = GanttData.ProjectNewData(); + return View(); +} \ No newline at end of file diff --git a/ej2-asp-core-mvc/gantt/how-to/xml-to-data.md b/ej2-asp-core-mvc/gantt/how-to/xml-to-data.md index 44e0580770..d5b2f5beb6 100644 --- a/ej2-asp-core-mvc/gantt/how-to/xml-to-data.md +++ b/ej2-asp-core-mvc/gantt/how-to/xml-to-data.md @@ -28,10 +28,10 @@ The following code snippet demonstrates how to import a Microsoft Project XML fi {% tabs %} {% highlight cshtml tabtitle="CSHTML" %} -{% include code-snippet/gantt/how-to/changeScheduleDates/tagHelper %} +{% include code-snippet/gantt/how-to/xmlToData/tagHelper %} {% endhighlight %} -{% highlight c# tabtitle="ChangeScheduleDates.cs" %} -{% include code-snippet/gantt/how-to/changeScheduleDates/changeScheduleDates.cs %} +{% highlight c# tabtitle="xmlToData.cs" %} +{% include code-snippet/gantt/how-to/xmlToData/xmlToData.cs %} {% endhighlight %} {% endtabs %} @@ -39,10 +39,10 @@ The following code snippet demonstrates how to import a Microsoft Project XML fi {% tabs %} {% highlight razor tabtitle="CSHTML" %} -{% include code-snippet/gantt/how-to/changeScheduleDates/razor %} +{% include code-snippet/gantt/how-to/xmlToData/razor %} {% endhighlight %} -{% highlight c# tabtitle="ChangeScheduleDates.cs" %} -{% include code-snippet/gantt/how-to/changeScheduleDates/changeScheduleDates.cs %} +{% highlight c# tabtitle="xmlToData.cs" %} +{% include code-snippet/gantt/how-to/xmlToData/xmlToData.cs %} {% endhighlight %} {% endtabs %} {% endif %} diff --git a/ej2-asp-core-toc.html b/ej2-asp-core-toc.html index 8b7453844b..8479975d10 100644 --- a/ej2-asp-core-toc.html +++ b/ej2-asp-core-toc.html @@ -1284,6 +1284,7 @@
  • Drag and drop from another component
  • Add new row position while adding
  • Restrict collapsing of records when clicking on Gantt chart rows
  • +
  • Import microsoft project XML into Gantt chart
  • diff --git a/ej2-asp-mvc-toc.html b/ej2-asp-mvc-toc.html index bce0cc241a..9d4b470d5a 100644 --- a/ej2-asp-mvc-toc.html +++ b/ej2-asp-mvc-toc.html @@ -1232,6 +1232,7 @@
  • Drag and drop from another component
  • Add new row position while adding
  • Restrict collapsing of records when clicking on Gantt chart rows
  • +
  • Import microsoft project XML into Gantt chart
  • From 5367914893198981e6e77bf028d7237e8721951c Mon Sep 17 00:00:00 2001 From: AjithkumarGopalakrishnan Date: Mon, 23 Jun 2025 16:54:40 +0530 Subject: [PATCH 3/3] 938496: topic error resolved --- ej2-asp-core-mvc/gantt/how-to/xml-to-data.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ej2-asp-core-mvc/gantt/how-to/xml-to-data.md b/ej2-asp-core-mvc/gantt/how-to/xml-to-data.md index d5b2f5beb6..f7b4654780 100644 --- a/ej2-asp-core-mvc/gantt/how-to/xml-to-data.md +++ b/ej2-asp-core-mvc/gantt/how-to/xml-to-data.md @@ -1,6 +1,6 @@ --- layout: post -title: Import Microsoft Project XML into ##Platform_Name## Gantt Component +title: Import Microsoft Project XML into ##Platform_Name## Gantt Component| Syncfusion description: Learn here to import microsoft project XML into Syncfusion ##Platform_Name## Gantt component of Syncfusion Essential JS 2 and more. platform: ej2-asp-core-mvc control: Xml to data @@ -14,7 +14,7 @@ In this guide, we'll explore how to import task data from an XML file into a Gan ## Steps -* Add a file upload component to your Blazor application using Syncfusion's `Uploader` component. This allows users to upload XML files easily. +* Add a file upload component to your application using Syncfusion's `Uploader` component. This allows users to upload XML files easily. * Implement the `Selected` method in the Uploader. This method reads the uploaded XML file, converts it into a list of GanttDataSource objects, and updates the Gantt Chart's data source. * Use the xmlToJson method to parse the XML content and convert it into JSON format. * Implement additional utility methods, such as `transformGanttData`, to handle specific data transformations required for the Gantt Chart.