csharp Plugins-GroupDocs.Assembly_NET_for_Windward-使用XML DataSource-GroupDocs.Assembly-RunBulletedLi

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp Plugins-GroupDocs.Assembly_NET_for_Windward-使用XML DataSource-GroupDocs.Assembly-RunBulletedLi相关的知识,希望对你有一定的参考价值。

// For complete examples and data files, please go to https://github.com/groupdocsassembly/GroupDocs_Assembly_NET
public class Program
{
    public const string productXMLfile = "../../../Samples/Products.xml";
    static void Main(string[] args)
    {
        //Setting up source open presentation template
        FileStream template = File.OpenRead("../../../Samples/Bulleted List_XML.docx");
        //Setting up destination open presentation report 
        FileStream output = File.Create("../../../Samples/Xml Bulleted List.docx");
        try
        {
            //Instantiate DocumentAssembler class
            DocumentAssembler assembler = new DocumentAssembler();
            //Call AssembleDocument to generate Bulleted List Report in open presentation format
            assembler.AssembleDocument(template, output, GetAllDataFromXML(), "ds");
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
    }
    public static DataSet GetAllDataFromXML()
    {
        try
        {
            DataSet mainDs = new DataSet();
            System.IO.FileStream fsReadXml = new System.IO.FileStream(productXMLfile, System.IO.FileMode.Open);
            mainDs.ReadXml(fsReadXml, XmlReadMode.ReadSchema);
            mainDs.Tables[0].TableName = "Product";
            return mainDs;
        }
        catch
        {
            return null;
        }
    }
}

以上是关于csharp Plugins-GroupDocs.Assembly_NET_for_Windward-使用XML DataSource-GroupDocs.Assembly-RunBulletedLi的主要内容,如果未能解决你的问题,请参考以下文章

csharp Plugins-GroupDocs.Assembly_NET_for_Windward-使用XML DataSource生成编号列表报告-CSharp-Windward Engine-R

csharp Plugins-GroupDocs.Assembly_NET_for_Windward-使用XML DataSource生成单行报告-CSharp-Windward Engine-Run

csharp Plugins-GroupDocs.Assembly_NET_for_Windward-使用XML DataSource-GroupDocs.Assembly-RunBulletedLi

csharp Plugins-GroupDocs.Assembly_NET_for_Windward-使用XML DataSource生成单行报告 - Windward Engine-RunSing

csharp Plugins-GroupDocs.Assembly_NET_for_Windward-使用XML DataSource生成项目符号列表报告-Windward Engine-RunBul

csharp 实例-CSHARP-GroupDocs.Conversion.Examples.CSharp变频-ConvertWithCustomInputDataHandler.cs