Index: sansguiframe/src/sans/guiframe/data_processor.py
===================================================================
--- sansguiframe/src/sans/guiframe/data_processor.py	(revision 83eb1b52f95c95d3b925d4a6b1acfde90aa38c2f)
+++ sansguiframe/src/sans/guiframe/data_processor.py	(revision 8523a1f2f369a776e0152818a679ca6c6847bdfd)
@@ -22,5 +22,4 @@
 FUNC_DICT = {"sqrt": "math.sqrt",
              "pow": "math.sqrt"}
-
 
 
@@ -74,4 +73,6 @@
         self.panel = panel
         self.col_names = []
+        self.data_inputs = {}
+        self.data_outputs = {}
         self._cols = 50
         self._rows = 51
@@ -164,15 +165,19 @@
         self.panel.set_yaxis(y=self.axis_value, label=self.axis_label)     
             
-    def set_data(self, data):
+    def set_data(self, data_inputs, data_outputs):
         """
         Add data to the grid
         """
-        if data is None:
-            data = {}
-        if  len(data) > 0:
+        if data_outputs is None:
+            data_outputs = {}
+        self.data_outputs = data_outputs
+        if self.data_inputs is None:
+            data_inputs = {}
+        self.data_inputs = data_inputs
+        
+        if  len(self.data_outputs) > 0:
             self._cols = self.GetNumberCols()
             self._rows = self.GetNumberRows()
-            self.data = data
-            self.col_names = data.keys()
+            self.col_names = self.data_outputs.keys()
             self.col_names.sort() 
             nbr_user_cols = len(self.col_names)
@@ -182,5 +187,5 @@
                 self.AppendCols(new_col_nbr, True)
             #Add more rows to the grid if necessary  
-            nbr_user_row = len(self.data.values())
+            nbr_user_row = len(self.data_outputs.values())
             if nbr_user_row > self._rows + 1:
                 new_row_nbr =  nbr_user_row - self._rows 
@@ -188,15 +193,17 @@
             # add data to the grid    
             row = 0
-            for index  in range(nbr_user_cols):
-                col = index
+            col = 0
+            cell_col = 0
+            for col_name in  self.col_names:
                 # use the first row of the grid to add user defined labels
-                self.SetCellValue(row, col, str(self.col_names[index]))
-            col = 0
-            for value_list in self.data.values():
-                row = 1
-                for index in range(len(value_list)):
-                    self.SetCellValue(row, col, str(value_list[index]))
-                    row += 1
+                self.SetCellValue(row, col, str(col_name))
                 col += 1
+                cell_row =  1
+                value_list = self.data_outputs[col_name]
+                
+                for value in value_list:
+                    self.SetCellValue(cell_row, cell_col, str(value))
+                    cell_row += 1
+                cell_col += 1
             self.AutoSize()
            
@@ -331,10 +338,9 @@
         self.enable_close_button()
         
-    def set_data(self, data):
-        if data is None:
+    def set_data(self, data_inputs, data_outputs):
+        if data_outputs is None or data_outputs == {}:
             return
-            
         grid = GridPage(self, panel=self.parent)
-        grid.set_data(data)  
+        grid.set_data(data_inputs, data_outputs)  
         self.AddPage(grid, "")
         pos = self.GetPageIndex(grid)
@@ -368,5 +374,6 @@
 
 class GridPanel(SPanel):
-    def __init__(self, parent, data=None, *args, **kwds):
+    def __init__(self, parent, data_inputs=None,
+                 data_outputs=None, *args, **kwds):
         SPanel.__init__(self, parent , *args, **kwds)
         self.vbox = wx.BoxSizer(wx.VERTICAL)
@@ -378,5 +385,6 @@
                            (self.plotting_sizer)])
         self.parent = parent
-        self._data = data
+        self._data_inputs = data_inputs
+        self._data_outputs = data_outputs
         self.x = []
         self.y  = []
@@ -393,9 +401,9 @@
         self.SetSizer(self.vbox)
         
-    def set_data(self, data):
+    def set_data(self, data_inputs, data_outputs):
         """
         """
         if self.notebook is not None:
-            self.notebook.set_data(data)
+            self.notebook.set_data(data_inputs, data_outputs)
         
     def set_xaxis(self, label="", x=None):
@@ -488,5 +496,5 @@
         """
         self.notebook = Notebook(parent=self)
-        self.notebook.set_data(self._data)
+        self.notebook.set_data(self._data_inputs, self._data_outputs)
         self.grid_sizer.Add(self.notebook, 1, wx.EXPAND, 0)
        
@@ -582,9 +590,9 @@
         
 class GridFrame(wx.Frame):
-    def __init__(self, parent=None, data=None, id=-1, 
+    def __init__(self, parent=None, data_inputs=None, data_outputs=None, id=-1, 
                  title="Batch Results", size=(700, 400)):
         wx.Frame.__init__(self, parent=parent, id=id, title=title, size=size)
         self.parent = parent
-        self.panel = GridPanel(self, data)
+        self.panel = GridPanel(self, data_inputs, data_outputs)
         menubar = wx.MenuBar()
         self.SetMenuBar(menubar)
@@ -616,8 +624,8 @@
         self.panel.add_column()
         
-    def set_data(self, data):
-        """
-        """
-        self.panel.set_data(data)
+    def set_data(self, data_inputs, data_outputs):
+        """
+        """
+        self.panel.set_data(data_inputs, data_outputs)
       
       
@@ -626,5 +634,5 @@
     Allow to select where the result of batch will be displayed or stored
     """
-    def __init__(self, parent, data=None, file_name="",
+    def __init__(self, parent, data_inputs, data_outputs, file_name="",
                  details="", *args, **kwds):
         """
@@ -639,5 +647,9 @@
         self.file_name = file_name
         self.details = details
-        self.data = data
+        self.data_inputs = data_inputs
+        self.data_outputs = data_outputs
+        self.data = {}
+        for item in (self.data_outputs, self.data_inputs):
+            self.data.update(item)
         self.flag = 1
         self.SetSize((300, 200))
@@ -646,5 +658,5 @@
         self.save_to_file = None
         self._do_layout()
-
+    
     def _do_layout(self):
         """
@@ -710,5 +722,6 @@
         """
         if self.flag == 1:
-            self.parent.open_with_localapp(self.data)
+            self.parent.open_with_localapp(data_inputs=self.data_inputs,
+                                            data_outputs=self.data_outputs)
         elif self.flag == 2:
             self.parent.open_with_externalapp(data=self.data, 
@@ -762,5 +775,5 @@
             data["index"+str(i)] = [i/j, i*j, i, i+j]
             
-        frame = GridFrame(data=data)
+        frame = GridFrame(data_outputs=data, data_inputs=data)
         frame.Show(True)
     except:
Index: sansguiframe/src/sans/guiframe/gui_manager.py
===================================================================
--- sansguiframe/src/sans/guiframe/gui_manager.py	(revision dc79cfc77b9b1e5b981ee4c0a825c799bb2cb5b2)
+++ sansguiframe/src/sans/guiframe/gui_manager.py	(revision 8523a1f2f369a776e0152818a679ca6c6847bdfd)
@@ -287,5 +287,6 @@
         self.setup_custom_conf()
     
-    def on_set_batch_result(self, data, plugin_name):
+    def on_set_batch_result(self, data_outputs, data_inputs=None,
+                             plugin_name=""):
         """
         Display data into a grid in batch mode and show the grid
@@ -301,15 +302,16 @@
         file_name = self._default_save_location + str(file_name)
         #Need to save configuration for later 
-        frame = BatchOutputFrame(parent=self, data=data, 
+        frame = BatchOutputFrame(parent=self, data_outputs=data_outputs, 
+                                 data_inputs=data_inputs,
                                 file_name=file_name,
                                 details=details)
         frame.Show(True)
     
-    def open_with_localapp(self, data):
+    def open_with_localapp(self, data_inputs, data_outputs):
         """
         Display value of data into the application grid
         :param data: dictionary of string and list of items
         """
-        self.batch_frame.set_data(data)
+        self.batch_frame.set_data(data_inputs, data_outputs)
         self.batch_frame.Show(True)
         
@@ -349,4 +351,5 @@
         buffer = fd.read()
         lines = buffer.split('\n')
+        fd.close()
         column_names_line  = ""
         index = None
