| Author | 
                
                  Topic   | 
                
                
                 
                 
                 
                 
                 
                                 | 
               
              
                | 
                 xhzeng 
                 
                
                Germany 
                2 Posts  | 
                
                  
                    
                      
                       Posted - 02/11/2003 :  04:33:17 AM
                        
                        
                        
                        
                        
                      
  | 
                     
                    
                       Hi all,
  I tried to make some functions to import a file into a worksheet, the worksheet object is related to a Graph object, i.e. it provides data to the Graph. The data file is created by other MathCad. I hope the curve in the Graph will change corresponding to the change of data in the worksheet.
  the following is my main idea: 1. Open data file(e.g data.txt); 2. declare a worksheet and attach a exsiting worksheet object to it; 3. insert those data from data.txt into the worksheet; Up to now, it works pretty well, it really imported the data to the worksheet. The problem is,  after the data was imported into the worksheet, the curve in the Graph was missing.
  Is there anything else I should do to take care of the Graph object?
  Thanks a lot.
  Richard
 
  | 
                     
                   
                 | 
               
              
                | 
                 easwar 
                 
                
                USA 
                1965 Posts  | 
                
                  
                    
                      
                       Posted - 02/11/2003 :  09:46:30 AM
                        
                        
                        
                        
                        
                      
  | 
                     
                    
                       Hi Richard,
  Was your graph already set up? Was there a data plot assignment in the graph layer from your worksheet? If that is the case, you may just need to add a rescale command. If that is not the case, you may have to add code to add a data plot to the layer etc. You should look at the GraphLayer class for more documentation on this. You could also post your code here and have someone suggest what more to add to it.
  Easwar OriginLab.
    | 
                     
                    
                        | 
                     
                   
                 | 
               
              
                | 
                 xhzeng 
                 
                
                Germany 
                2 Posts  | 
                
                  
                    
                      
                       Posted - 02/11/2003 :  11:27:52 AM
                        
                        
                        
                        
                        
                      
  | 
                     
                    
                       Hi Easwar,
  Thank you very much!
  I have resolved that problem. The reason is I didnt convert the data from string to numeric. e.g.  string price = "123.50"; wk.SetCell(0, 0, price); (Wrong!) we.SetCell(0, 0, atof(price)); (Correct!)
  Richard
  | 
                     
                    
                        | 
                     
                   
                 | 
               
              
                |   | 
                
                  Topic   | 
                
                
                 
                 
                 
                 
                 
                 | 
               
             
           | 
         
       
     |