Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
310
Exporting Data from an UltraGrid
posted

Hi,

Is there any easy way of exporting all data from an UltraGrid programmatically? I have been toying with ...Object.Export and although QTP does not error on that line, it's not saving anything; I have tried various parameters such as filename etc as detailed in the NetAdvantage help (which is much more useful than the TestAdvantage help!) but I can't seem to quite nail it. Do you have any suggestions?

The reason I want to do this is that I have a grid that changes dynamically every time a field is changed on a form and as such there is no set number of sibling rows, and as trying to navigate an unknown number of sibling rows is proving a nightmare through QTP, I've decided to dump the grid to excel and use the Excel Object Model to do the work, which I'm much more familiar with!

 Best regards, Ryan

  • 6729
    Offline posted

    Hi Ryan,

    You need an "UltraGridExcelExporter" object to export grid content to an Excel file. Here is how its done in VS (using C#)

                    ExcelExporter = new Infragistics.Win.UltraWinGrid.ExcelExport.UltraGridExcelExporter();
                    ExcelExporter.Export(ultraGrid1,"FilterRows.xls");

    I'm not sure how (or even if its possible to) do this in QTP.

    For the original problem, if you can explain a little more I can try to provide a code snip-it that might help you.

     

    Regards,

    Ammar