public void WorkWithXlsxOptions() { // ExStart:UsingXlsxOptions // ExFor: XlsxOptions // ExFor: XlsxOptions.#ctor // ExFor: XlsxOptions.AssignmentView // ExFor: XlsxOptions.ResourceView // ExFor: XlsxOptions.Encoding // ExSummary: Shows how to save a project into XLSX file by using <see cref="P:Aspose.Tasks.Saving.XlsxOptions">Days</see> options. var project = new Project(DataDir + "CreateProject2.mpp"); var options = new XlsxOptions(); // Add desired Gantt Chart columns var col = new GanttChartColumn("WBS", 100, delegate(Task task) { return(task.Get(Tsk.WBS)); }); options.View.Columns.Add(col); // Add desired resource view columns var rscCol = new ResourceViewColumn("Cost center", 100, delegate(Resource resource) { return(resource.Get(Rsc.CostCenter)); }); options.ResourceView.Columns.Add(rscCol); // Add desired assignment view columns var assnCol = new AssignmentViewColumn("Notes", 200, delegate(ResourceAssignment assignment) { return(assignment.Get(Asn.Notes)); }); options.AssignmentView.Columns.Add(assnCol); // set encoding options.Encoding = Encoding.Unicode; project.Save(OutDir + "UsingXlsxOptions_out.xlsx", options); // ExEnd:UsingXlsxOptions }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName); //ExStart:UsingXlsxOptions // Read the input Project file Project project = new Project(dataDir + "CreateProject2.mpp"); XlsxOptions options = new XlsxOptions(); // Add desired Gantt Chart columns GanttChartColumn col = new GanttChartColumn("WBS", 100, delegate(Task task) { return(task.Get(Tsk.WBS)); }); options.View.Columns.Add(col); // Add desired resource view columns ResourceViewColumn rscCol = new ResourceViewColumn( "Cost center", 100, delegate(Resource resource) { return(resource.Get(Rsc.CostCenter)); }); options.ResourceView.Columns.Add(rscCol); // Add desired assignment view columns AssignmentViewColumn assnCol = new AssignmentViewColumn("Notes", 200, delegate(ResourceAssignment assignment) { return(assignment.Get(Asn.Notes)); }); options.AssignmentView.Columns.Add(assnCol); project.Save(dataDir + "UsingXlsxOptions_out.xlsx", options); //ExEnd:UsingXlsxOptions }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName); // ExStart:UsingXlsxOptions // Read the input Project file Project project = new Project(dataDir + "CreateProject2.mpp"); XlsxOptions options = new XlsxOptions(); // Add desired Gantt Chart columns GanttChartColumn col = new GanttChartColumn("WBS", 100, delegate(Task task) { return task.Get(Tsk.WBS); }); options.View.Columns.Add(col); // Add desired resource view columns ResourceViewColumn rscCol = new ResourceViewColumn("Cost center", 100, delegate(Resource resource) { return resource.Get(Rsc.CostCenter); }); options.ResourceView.Columns.Add(rscCol); // Add desired assignment view columns AssignmentViewColumn assnCol = new AssignmentViewColumn("Notes", 200, delegate(ResourceAssignment assignment) { return assignment.Get(Asn.Notes); }); options.AssignmentView.Columns.Add(assnCol); project.Save(dataDir + "UsingXlsxOptions_out.xlsx", options); // ExEnd:UsingXlsxOptions }