Micro Focus QTP (UFT) Forums
Creating or Renaming Column of DataTable at RunTime. - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: Creating or Renaming Column of DataTable at RunTime. (/Thread-Creating-or-Renaming-Column-of-DataTable-at-RunTime)



Creating or Renaming Column of DataTable at RunTime. - Girish_Pai - 08-20-2009

Dear All,

I have created a sheet in data table(Run time). But I am not able rename the columns of Sheet.

Is there method to rename column, run time?... Please help me out...

Thanks and Regards

Girish Pai.


RE: Creating or Renaming Column of DataTable at RunTime. - Saket - 08-20-2009

Hi Girish,

How did you added the script? You can name a sheet at the time of adding it runtime
DataTable.AddSheet <<sheetname>>


RE: Creating or Renaming Column of DataTable at RunTime. - supputuri - 08-20-2009

Hi Girish_Pai,

Yes, we can use AddParameter method to add/rename the column name.

Code:
Datatable.GetSheet("NewSheetName").AddParameter "DesiredColName",""

Let me know if you need any more info.


RE: Creating or Renaming Column of DataTable at RunTime. - Saket - 08-20-2009

very sorry Girish,

I misleaded and dont how I assumed that you have asked for renaming the sheet.
defintely you can rename a column using AddParameter method


RE: Creating or Renaming Column of DataTable at RunTime. - Girish_Pai - 08-20-2009

Thank you... I am able to work on it... Thank you very much.


RE: Creating or Renaming Column of DataTable at RunTime. - udaymusunuri - 11-15-2011

how can add this column in place of column header i.e replacing column header "A"


RE: Creating or Renaming Column of DataTable at RunTime. - ravi.gajul - 11-15-2011

Code:
DataTable.Getsheet("<sheetname>").Addparameter "<columnname>","value"