[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Export text for FIXGRID tree nodes  XML
Forum Index -> Development
Author Message
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5519
Offline

(...question came in by mail and is answered through forum...)

During CSV Export/import of FIXGRIDs that are built as tree some cells are still interpreted as a formula - because the node status is pre-pended to then node text with "+" and "-".

How can we export without "+" and "-" - and just export the plain text for the node?


Björn Müller, CaptainCasa GmbH
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5519
Offline

Your tree node implementation extends FIXGRIDTreeItem. Here the tree text for export is assembled in the following method:

Code:
     /**
      * Text that is used when exporting the corresponding tree - e.g. to PDF.
      * In this text the level of the tree node is reflected by prepenging
      * a corresponding number of non-breakable spaces.
      */
     public String getTextForExport()
     {
         String perLevel = "\u00A0\u00A0\u00A0\u00A0";
         String result = "";
         for (int i=0; i<m_level; i++)
             result += perLevel;
         if (m_status == STATUS_CLOSED)
             result += " + "; // space before - otherwise Excel interprets as forumla...
         else if (m_status == STATUS_OPENED)
             result += " - ";  // space before - otherwise Excel interprets as forumla...
         result += getText();
         return result;
     }
 


Just over-write this method in your implementation:

Code:
 public class TreeNode extends FIXGRIDTreeItem
 {
     ...
     public String getTextForExport()
     {
         reteurn getText();
     }
     ...
 }
 


Kind regards! Björn

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team