Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E13D8200C62 for ; Wed, 12 Apr 2017 01:13:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E00AC160BAD; Tue, 11 Apr 2017 23:13:35 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C8672160BAC for ; Wed, 12 Apr 2017 01:13:33 +0200 (CEST) Received: (qmail 66170 invoked by uid 500); 11 Apr 2017 23:13:33 -0000 Mailing-List: contact odf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: odf-dev@incubator.apache.org Delivered-To: mailing list odf-commits@incubator.apache.org Received: (qmail 66160 invoked by uid 99); 11 Apr 2017 23:13:33 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Apr 2017 23:13:33 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id EE8D23A5182 for ; Tue, 11 Apr 2017 23:13:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1010270 [5/13] - in /websites/staging/odftoolkit/trunk/content: ./ odftoolkit/ odftoolkit/GSoC/ odftoolkit/docs/ odftoolkit/docs/governance/ odftoolkit/odfdom/ odftoolkit/simple/ odftoolkit/simple/demo/ odftoolkit/simple/document/ odftoolk... Date: Tue, 11 Apr 2017 23:13:31 -0000 To: odf-commits@incubator.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170411231331.EE8D23A5182@svn01-us-west.apache.org> archived-at: Tue, 11 Apr 2017 23:13:36 -0000 Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/demo/demo2.html ============================================================================== --- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/demo/demo2.html (original) +++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/demo/demo2.html Tue Apr 11 23:13:30 2017 @@ -50,7 +50,18 @@
-

General

+ +

General

-

Components

+

Components

-

Community

+

Community

-

Development

+

Development

-

PPMC

+

PPMC

-

ASF

+

ASF

  • Apache Software Foundation
  • Thanks
  • @@ -96,14 +106,21 @@
    -

    Demos > Persentation Extraction and Combination
    -

    -

    Overview
    -

    -

    To show the operation of Presentation in Simple API, the Presentation Codmbination demo is used which combine two independent presentation documents together and extract the notes of each slide out to a Text document.
    -

    -

    Here the original presentation documents "Pres1.odp" and "Pres2.odp" are used. Pres1.odp presents some basic concepts of XML and Pres2.odp presents some basic aspects of HTML. Both of them have their own cover page with the same slide name "Cover" at the front and an End page with the same slide name "end" at the end of the document. To combine these two presentation documents together, the following steps are used here.
    -

    + +

    Demos > Persentation Extraction and Combination

    +

    Overview

    +

    To show the operation of Presentation in Simple API, the Presentation Codmbination demo is used which combine two independent presentation documents together and extract the notes of each slide out to a Text document.

    +

    Here the original presentation documents "Pres1.odp" and "Pres2.odp" are used. Pres1.odp presents some basic concepts of XML and Pres2.odp presents some basic aspects of HTML. Both of them have their own cover page with the same slide name "Cover" at the front and an End page with the same slide name "end" at the end of the document. To combine these two presentation documents together, the following steps are used here.

    1. Delete the last page of "Pres1.odp".
    2. Change the slide name of the cover page for each presentation document.
    3. @@ -113,17 +130,12 @@
    4. Extract the notes from each slide in the presentation document and save them into a text document.
    5. Save the combined document and the text document.

    -

    The contents of the text document which contains the notes of the presentation document is shown in the following picture, where each note is identified by the corresponding slide name.
    -

    +

    The contents of the text document which contains the notes of the presentation document is shown in the following picture, where each note is identified by the corresponding slide name.

    -

    Code Introduction
    -

    -

    To generate this sample, the Presentation and Text package in Simple API will be used. The related operations contains: load the existing presentation document, append one presentation to the end of another one, delete slide in the presentation, add new slide in the presentation, get certain slide in the presentation, add new notes to the slide, create a new text document, add new paragraph in the text document, etc.
    -

    -

    Seven functions exist in the resource: main(), Getpresentation(), ProcSlide(), titleofExtractnotes(), ExtractNotes(), FillExtractnotes() and saveDocument(). Each of them will be explained briefly in the following paragraphs.
    -

    -

    First three variables should be used to hold the two presentation document and the text document.
    -

    +

    Code Introduction

    +

    To generate this sample, the Presentation and Text package in Simple API will be used. The related operations contains: load the existing presentation document, append one presentation to the end of another one, delete slide in the presentation, add new slide in the presentation, get certain slide in the presentation, add new notes to the slide, create a new text document, add new paragraph in the text document, etc.

    +

    Seven functions exist in the resource: main(), Getpresentation(), ProcSlide(), titleofExtractnotes(), ExtractNotes(), FillExtractnotes() and saveDocument(). Each of them will be explained briefly in the following paragraphs.

    +

    First three variables should be used to hold the two presentation document and the text document.

    PresentationDocument presentationdoc;
     PresentationDocument presentationdoc2;
     TextDocument Extractednotes;
    @@ -132,19 +144,19 @@
     
     

    In function Getpresentation(), the two presentation documents are loaded so that they can be operated by Simple API, and the text document is created to save the extracted notes. The codes are shown below:

    public void Getpresentation() {
    -    try {
    -        presentationdoc=PresentationDocument.loadDocument("Pres1.odp");
    -        presentationdoc2=PresentationDocument.loadDocument("Pres2.odp");  
    -    } catch (Exception e) {
    -        System.err.println("Unable to load document.");
    -        System.err.println(e.getMessage());  
    +    try {
    +        presentationdoc=PresentationDocument.loadDocument("Pres1.odp");
    +        presentationdoc2=PresentationDocument.loadDocument("Pres2.odp");  
    +    } catch (Exception e) {
    +        System.err.println("Unable to load document.");
    +        System.err.println(e.getMessage());  
         }
     
    -    try{
    -        Extractednotes=TextDocument.newTextDocument();
    -    } catch (Exception e) {
    -        System.err.println("Unable to create text document.");
    -        System.err.println(e.getMessage());  
    +    try{
    +        Extractednotes=TextDocument.newTextDocument();
    +    } catch (Exception e) {
    +        System.err.println("Unable to create text document.");
    +        System.err.println(e.getMessage());  
         }
     }
     
    @@ -153,56 +165,53 @@

    In function ProcSlide(), five main operations are used to process the document: delete extra slide (deleteSlideByIndex, deleteSlideByName), change slide name (setSlideName), combine these two presentations together (appendPresentation), add a new cover for the new combined document (newSlide), add title and notes for the new slide. Here the function getSlideCount() is used to get the slide number of the specified presentation document, getSlideByName()and getSlideByIndex() are used to get the specified slide, getNotesPage() and setTextContent() are used to add notes for the added slide. In order to add text to the title frame, a DrawTextBoxElement should be used to get the editable component. The codes are shown below:

    Slide slide;
     Notes notes;
    -int count=presentationdoc.getSlideCount();
    -presentationdoc.deleteSlideByIndex(count-1);    
    -//presentationdoc.deleteSlideByName("end");
    -slide=presentationdoc.getSlideByIndex(0);
    -slide.setSlideName("XML Cover");
    -slide=presentationdoc2.getSlideByName("Cover");
    -slide.setSlideName("HTML Cover");
    -presentationdoc.appendPresentation(presentationdoc2);
    -slide=presentationdoc.newSlide(0, "Cover", SlideLayout.TITLE_ONLY); 
    -notes=slide.getNotesPage();
    -notes.addText("This is the cover of the new presentation document");
    -DrawTextBoxElement textbox=(DrawTextBoxElement)slide.getOdfElement().getFirstChild().getFirstChild();
    -textbox.newTextPElement().setTextContent("Combined Presentation");
    +int count=presentationdoc.getSlideCount();
    +presentationdoc.deleteSlideByIndex(count-1);    
    +//presentationdoc.deleteSlideByName("end");
    +slide=presentationdoc.getSlideByIndex(0);
    +slide.setSlideName("XML Cover");
    +slide=presentationdoc2.getSlideByName("Cover");
    +slide.setSlideName("HTML Cover");
    +presentationdoc.appendPresentation(presentationdoc2);
    +slide=presentationdoc.newSlide(0, "Cover", SlideLayout.TITLE_ONLY); 
    +notes=slide.getNotesPage();
    +notes.addText("This is the cover of the new presentation document");
    +DrawTextBoxElement textbox=(DrawTextBoxElement)slide.getOdfElement().getFirstChild().getFirstChild();
    +textbox.newTextPElement().setTextContent("Combined Presentation");
     
    -

    In function titleofExtractnotes(), the title of the text document which is used to save the notes of each slide is added. And in function ExtractNotes(), the notes of each slide will be extracted (getTextContent), the function FillExtractnotes() will be called if the notes exists. Here function getSlideByIndex() is used to obtain the corresponding slide, getSlideName() is used to obtain the name of the specified slide in order to identify the notes. The codes are shown below:
    -

    -
    slide=presentationdoc.getSlideByIndex(i);
    -String slidename=slide.getSlideName();
    -notes=slide.getNotesPage(); 
    -if(!notes.getOdfElement().getTextContent().isEmpty()){
    -    String notestring=notes.getOdfElement().getTextContent().toString().trim();
    +

    In function titleofExtractnotes(), the title of the text document which is used to save the notes of each slide is added. And in function ExtractNotes(), the notes of each slide will be extracted (getTextContent), the function FillExtractnotes() will be called if the notes exists. Here function getSlideByIndex() is used to obtain the corresponding slide, getSlideName() is used to obtain the name of the specified slide in order to identify the notes. The codes are shown below:

    +
    slide=presentationdoc.getSlideByIndex(i);
    +String slidename=slide.getSlideName();
    +notes=slide.getNotesPage(); 
    +if(!notes.getOdfElement().getTextContent().isEmpty()){
    +    String notestring=notes.getOdfElement().getTextContent().toString().trim();
         FillExtractnotes(notestring,slidename);
     }
     
    -

    In function FillExtractnotes, the notes will be added to the text document. Here the slide name is used as the identity and is followed by the corresponding notes, function newParagraph() is used to add a new paragraph in the text document. The codes are shown below:
    -

    -
    OdfTextParagraph para =Extractednotes.newParagraph();
    -para.setProperty(OdfParagraphProperties.MarginTop, "0.25cm");
    -para.setTextContent("Notes of "+slidename+":");             
    -para=Extractednotes.newParagraph();
    -para.setProperty(OdfParagraphProperties.TextAlign,"justify");
    -para.setTextContent("  "+notestext);
    +

    In function FillExtractnotes, the notes will be added to the text document. Here the slide name is used as the identity and is followed by the corresponding notes, function newParagraph() is used to add a new paragraph in the text document. The codes are shown below:

    +
    OdfTextParagraph para =Extractednotes.newParagraph();
    +para.setProperty(OdfParagraphProperties.MarginTop, "0.25cm");
    +para.setTextContent("Notes of "+slidename+":");             
    +para=Extractednotes.newParagraph();
    +para.setProperty(OdfParagraphProperties.TextAlign,"justify");
    +para.setTextContent("  "+notestext);
     
    -

    In function saveDocument(), the new combined presentation document and the text document which contains the notes will be saved. The codes are shown below:
    -

    +

    In function saveDocument(), the new combined presentation document and the text document which contains the notes will be saved. The codes are shown below:

    public void saveDocument(){     
    -    try{
    -        presentationdoc.save("Presentationsample.odp");
    -        presentationdoc.close();
    -        Extractednotes.save("Extractednotes.odt");
    -        Extractednotes.close();
    -    }catch(Exception e){
    -        System.err.println("Unable to save document.");
    -        System.err.println(e.getMessage());  
    +    try{
    +        presentationdoc.save("Presentationsample.odp");
    +        presentationdoc.close();
    +        Extractednotes.save("Extractednotes.odt");
    +        Extractednotes.close();
    +    }catch(Exception e){
    +        System.err.println("Unable to save document.");
    +        System.err.println(e.getMessage());  
         }   
     }
     
    Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/demo/demo3.html ============================================================================== --- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/demo/demo3.html (original) +++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/demo/demo3.html Tue Apr 11 23:13:30 2017 @@ -50,7 +50,18 @@
    -

    General

    + +

    General

    -

    Components

    +

    Components

    -

    Community

    +

    Community

    -

    Development

    +

    Development

    -

    PPMC

    +

    PPMC

    -

    ASF

    +

    ASF

    • Apache Software Foundation
    • Thanks
    • @@ -96,116 +106,108 @@
      -

      Demos > Navigation API in Hotel Receipt
      -

      -

      Overview
      -

      -

      This demo is a simple template application about hotel receipt. By loading the configuration file "consume-data.properties" and navigating the hotel receipt template, this demo could generate the ODF documents (ODT, ODP, and ODS format).
      -

      -

      In the generated ODF documents, you can see the concrete information about hotel receipt, such as hotel name, customer name, consume time, consume data, total expense, headcount, and consume item details including the price, quantity, total expense of each item. Taking the ODT document as an example, the ODT document template is shown in the following picture. Please notice the area surrounding by eight small green square, it is a chart. Because this chart is generated by the column ConsumeItem and the column Total Expense($) in the above table and the values of the column Total Expense($) are not numeric type, the template chart might not display correctly in your ODF editor, but it will display correctly after the template is expanded.
      -

      -


      -

      -

      And the generated ODT document is shown in the following picture.
      -

      + +

      Demos > Navigation API in Hotel Receipt

      +

      Overview

      +

      This demo is a simple template application about hotel receipt. By loading the configuration file "consume-data.properties" and navigating the hotel receipt template, this demo could generate the ODF documents (ODT, ODP, and ODS format).

      +

      In the generated ODF documents, you can see the concrete information about hotel receipt, such as hotel name, customer name, consume time, consume data, total expense, headcount, and consume item details including the price, quantity, total expense of each item. Taking the ODT document as an example, the ODT document template is shown in the following picture. Please notice the area surrounding by eight small green square, it is a chart. Because this chart is generated by the column ConsumeItem and the column Total Expense($) in the above table and the values of the column Total Expense($) are not numeric type, the template chart might not display correctly in your ODF editor, but it will display correctly after the template is expanded.

      +

      +

      And the generated ODT document is shown in the following picture.

      -

      Use Simple API to complete this simple template application. This demo mainly uses the API of package navigation.
      -

      -

      In the root directory of this demo project, there are three defined ODF template documents, "Navigation-ODT-Templating.odt", "Navigation-ODP-Templating.odp" and "Navigation-ODS-Templating.ods", and one configuration file, "consume-data.properties". Run NavigationForODF.java, and then in the root directory of this demo project you can find three generated ODF documents, "Navigation-ODT-Generated.odt", "Navigation-ODP-Generated.odp" and "Navigation-ODS-Generated.ods", which contain the information of "consume-data.properties". In these ODF documents, the consume item details are shown as table and chart.
      -

      -

      Please notice the differences of ODT, ODP, ODS template document. In ODT and ODS template documents, the chart could be automatically generated by the ODF editor according to the data of table, and in this demo the data of chart comes from the column of ConsumeItem and Total Expense($). But in ODP template documents, the chart can not be automatically generated by the table, in fact, the chart in ODP template document is created manually through the function "insert chart" of openoffice, and the type of second column must be numeric. In addition, please notice the cell value of ODS document, the cell value has character type and numeric type, for example, ‘5,000 represents character type and 5,000 represents numeric type, and we could see that the different point is the single quotation marks before 5,000.
      -

      +

      Use Simple API to complete this simple template application. This demo mainly uses the API of package navigation.

      +

      In the root directory of this demo project, there are three defined ODF template documents, "Navigation-ODT-Templating.odt", "Navigation-ODP-Templating.odp" and "Navigation-ODS-Templating.ods", and one configuration file, "consume-data.properties". Run NavigationForODF.java, and then in the root directory of this demo project you can find three generated ODF documents, "Navigation-ODT-Generated.odt", "Navigation-ODP-Generated.odp" and "Navigation-ODS-Generated.ods", which contain the information of "consume-data.properties". In these ODF documents, the consume item details are shown as table and chart.

      +

      Please notice the differences of ODT, ODP, ODS template document. In ODT and ODS template documents, the chart could be automatically generated by the ODF editor according to the data of table, and in this demo the data of chart comes from the column of ConsumeItem and Total Expense($). But in ODP template documents, the chart can not be automatically generated by the table, in fact, the chart in ODP template document is created manually through the function "insert chart" of openoffice, and the type of second column must be numeric. In addition, please notice the cell value of ODS document, the cell value has character type and numeric type, for example, ‘5,000 represents character type and 5,000 represents numeric type, and we could see that the different point is the single quotation marks before 5,000.

      Code Introduction

      -

      First, load the key-value in the file "consume-data.properties" into the instance of Properties, and put ConsumeItem as key and TotalExpenseOfItem as value to the instance of HashMap for navigating ODP document template.
      -

      +

      First, load the key-value in the file "consume-data.properties" into the instance of Properties, and put ConsumeItem as key and TotalExpenseOfItem as value to the instance of HashMap for navigating ODP document template.

      public void loadConsumeData(String filepath) throws Exception {
      -    InputStream is = new FileInputStream(filepath);
      -    properties.load(is);
      -    is.close();
      -    // put ConsumeItem as key and TotalExpenseOfItem as value to map
      -    Enumeration<String> enu = (Enumeration<String>) properties.propertyNames();
      -    while (enu.hasMoreElements()) {
      -        String key = (String) enu.nextElement();
      -        if (key.contains("ConsumeItem")) {
      -            String consumeItem = properties.getProperty(key);
      -            String totalExpenseOfItem = properties.getProperty("TotalExpenseOfItem"
      -                                        + key.charAt(key.length() - 1));
      -            map.put(consumeItem, totalExpenseOfItem);
      +    InputStream is = new FileInputStream(filepath);
      +    properties.load(is);
      +    is.close();
      +    // put ConsumeItem as key and TotalExpenseOfItem as value to map
      +    Enumeration<String> enu = (Enumeration<String>) properties.propertyNames();
      +    while (enu.hasMoreElements()) {
      +        String key = (String) enu.nextElement();
      +        if (key.contains("ConsumeItem")) {
      +            String consumeItem = properties.getProperty(key);
      +            String totalExpenseOfItem = properties.getProperty("TotalExpenseOfItem"
      +                                        + key.charAt(key.length() - 1));
      +            map.put(consumeItem, totalExpenseOfItem);
               }
           }
       }
       
      -

      Then, introduce how to navigate the template documents and generate the ODF documents.
      -

      -

      Navigate ODT document template
      -

      -

      Load "Navigation-ODT-Templating.odt" and get the instance of TextDocument. Then traverse the instance of Properties, use the API of TextNavigation and TextSelection to complete the replacement of template document as the line 10-14. Please notice the line 17 and 18, make sure that the chart is shown rightly when open the generated document, so is navigating ODP and ODS document template. At last, generate "Navigation-ODT-Generated.odt" as the line 19.
      -

      +

      Then, introduce how to navigate the template documents and generate the ODF documents.

      +

      Navigate ODT document template

      +

      Load "Navigation-ODT-Templating.odt" and get the instance of TextDocument. Then traverse the instance of Properties, use the API of TextNavigation and TextSelection to complete the replacement of template document as the line 10-14. Please notice the line 17 and 18, make sure that the chart is shown rightly when open the generated document, so is navigating ODP and ODS document template. At last, generate "Navigation-ODT-Generated.odt" as the line 19.

      public void navigateODT() throws Exception {
      -    Iterator it = properties.entrySet().iterator();
      -    System.out.println("Navigate ODT document: Navigation-ODT-Templating.odt");
      -    TextDocument textdoc = (TextDocument) TextDocument.loadDocument("Navigation-ODT-Templating.odt");
      +    Iterator it = properties.entrySet().iterator();
      +    System.out.println("Navigate ODT document: Navigation-ODT-Templating.odt");
      +    TextDocument textdoc = (TextDocument) TextDocument.loadDocument("Navigation-ODT-Templating.odt");
           TextNavigation search;
      -    while (it.hasNext()) {
      -        Map.Entry entry = (Map.Entry) it.next();
      -        String key = (String) entry.getKey();
      -        String value = (String) entry.getValue();
      -        search = new TextNavigation(key, textdoc);
      -        while (search.hasNext()) {
      -            TextSelection item = (TextSelection) search.nextSelection();
      -            item.replaceWith(value);
      +    while (it.hasNext()) {
      +        Map.Entry entry = (Map.Entry) it.next();
      +        String key = (String) entry.getKey();
      +        String value = (String) entry.getValue();
      +        search = new TextNavigation(key, textdoc);
      +        while (search.hasNext()) {
      +            TextSelection item = (TextSelection) search.nextSelection();
      +            item.replaceWith(value);
               }
           }
      -    // remove ObjectReplacements/ and Thumbnails/
      -    textdoc.getPackage().removePackageDocument("ObjectReplacements/");
      -    textdoc.getPackage().removePackageDocument("Thumbnails/");
      -    textdoc.save("Navigation-ODT-Generated.odt");
      -    System.out.println("...\nNavigation is over, and Navigation-ODT-Generated.odt is generated");
      +    // remove ObjectReplacements/ and Thumbnails/
      +    textdoc.getPackage().removePackageDocument("ObjectReplacements/");
      +    textdoc.getPackage().removePackageDocument("Thumbnails/");
      +    textdoc.save("Navigation-ODT-Generated.odt");
      +    System.out.println("...\nNavigation is over, and Navigation-ODT-Generated.odt is generated");
       }
       
      -

      Navigate ODP document template
      -

      -

      Unlike the ODT document, the chart of ODP document is an embedded document. Before navigate the chart, get the embedded document as the line 2 and 3. The chart comes from a table, and we could change the chart by setting the cell value of the table as the line 13-15. The line 15 uses the Class DefaultCellValueAdapter to update the cell value and value type.
      -

      -
          // set the cell value in the table of embedderdocument
      -    List<Document> embeddedDocuments = pdoc.getEmbeddedDocuments();
      -    Document embeddedDocument = embeddedDocuments.get(0);
      -    Table table = embeddedDocument.getTableList().get(0);
      +

      Navigate ODP document template

      +

      Unlike the ODT document, the chart of ODP document is an embedded document. Before navigate the chart, get the embedded document as the line 2 and 3. The chart comes from a table, and we could change the chart by setting the cell value of the table as the line 13-15. The line 15 uses the Class DefaultCellValueAdapter to update the cell value and value type.

      +
          // set the cell value in the table of embedderdocument
      +    List<Document> embeddedDocuments = pdoc.getEmbeddedDocuments();
      +    Document embeddedDocument = embeddedDocuments.get(0);
      +    Table table = embeddedDocument.getTableList().get(0);
           String consumeItem;
           String totalExpenseOfItem;
      -    int index = 0;
      -    Iterator<String> it = map.keySet().iterator();
      -    while (it.hasNext()) {
      -        index++;
      -        consumeItem = (String) it.next();
      -        totalExpenseOfItem = (String) map.get(consumeItem);
      -        table.getColumnByIndex(0).getCellByIndex(index).setDisplayText(consumeItem);
      -        table.getColumnByIndex(1).getCellByIndex(index).setDisplayText(totalExpenseOfItem, new DefaultCellValueAdapter());
      +    int index = 0;
      +    Iterator<String> it = map.keySet().iterator();
      +    while (it.hasNext()) {
      +        index++;
      +        consumeItem = (String) it.next();
      +        totalExpenseOfItem = (String) map.get(consumeItem);
      +        table.getColumnByIndex(0).getCellByIndex(index).setDisplayText(consumeItem);
      +        table.getColumnByIndex(1).getCellByIndex(index).setDisplayText(totalExpenseOfItem, new DefaultCellValueAdapter());
           }
       
      -

      Navigate ODS document template
      -

      -

      Unlike the ODT document, use the Class CellSelection to complete the replacement. Class CellSelection is the subclass of Class TextSelection. Use the method "advancedReplaceWith" to update the cell value and value type.
      -

      -
          search = new TextNavigation(key, ssdoc);
      -    while (search.hasNext()) {
      -        CellSelection item = (CellSelection) search.nextSelection();
      -        item.advancedReplaceWith(value, new DefaultCellValueAdapter());
      +

      Navigate ODS document template

      +

      Unlike the ODT document, use the Class CellSelection to complete the replacement. Class CellSelection is the subclass of Class TextSelection. Use the method "advancedReplaceWith" to update the cell value and value type.

      +
          search = new TextNavigation(key, ssdoc);
      +    while (search.hasNext()) {
      +        CellSelection item = (CellSelection) search.nextSelection();
      +        item.advancedReplaceWith(value, new DefaultCellValueAdapter());
           }
       
      -

      Download
      -

      +

      Download

      Powered by Simple API version 0.3.5.
      -You can download the code of this demo from here.
      -

      +You can download the code of this demo from here.