none
how can i update charts' data in word document by using OpenXML

    Question

  • There was 18 charts In my word document . I can get the charts by code like this:

    private MainDocumentPart mainDocPart;

    ......

    ChartPart c_p = mainDocPart.ChartParts.FirstOrDefault();

    Then I can update the data of charts.But the problem is this:

    I have 18 charts In the document , and the charts index was random.So I can't get the chart by index yet:

    ChartPart c_p = mainDocPart.ChartParts.ElementAt(index);//index is Integer Value

    So can I appoint the ID or Name for each of the 18 charts?And Can I get Them By ID or Name?

    I can update one Charts data by Openxml.If neither,How can I update datas for so many charts by OpenXml?


    赵召


    lundi 5 mai 2014 07:26

Réponses

Toutes les réponses