Survey Tabulation > Extending UNICOM Intelligence Reporter > Creating an export component > Testing the Export component
 
Testing the Export component
The UNICOM Intelligence Reporter - Survey Tabulation Export Wizard creates two files in the Test Files folder in the Visual Studio Solution Explorer, to facilitate testing your export component:
TestExport.htm
TestTables.xml
TestExport.htm
TestExport.htm is an HTML page that invokes your export component so that you can test its user interface and run it with some sample data. Your export component appears on the drop-down list of available export components along with the standard Excel, HTML, PowerPoint, Text and Microsoft Word export components. If you have modified an existing component, the modified version will be picked up when you replace the original .dll file with your modified version.
The TestExport.htm file includes a PropertiesXml button that shows the contents of the current Properties.xml file for the export project. This reflects the current internal values of the properties, and can be used to verify that the settings entered in the user interface have been saved properly.
TestExport.htm is useful for testing your export component with some sample data, without having to use UNICOM Intelligence Reporter or UNICOM Intelligence Reporter - Survey Tabulation. You can also customize the TestExport.htm file if desired.
TestTables.xml
TestTables.xml contains sample UNICOM Intelligence Reporter - Survey Tabulation output that you can use to test the exporting functionality of your component. The TestExport.htm file automatically uses this file to run the export. If required, you can replace this file with your own file of test data.
Using your own test data
You may want to use your own data to test the export component; in this case, you can generate more XML files using UNICOM Intelligence Professional Tables Option or UNICOM Intelligence Reporter - Survey Tabulation.
Here is an example of a script that you can use to generate test data:
Dim TableDoc
Dim Table
Set TableDoc = CreateObject("TOM.Document")
'enter your test dataset and table specification, for example:
TableDoc.DataSet.Load("[INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\Data\XML\museum.mdd")
Set Table = TableDoc.Tables.AddNew("Table1", "age * gender", "Basic table")
Table.SortColumn = "gender{Base}"
TableDoc.Populate()
WriteToFile(TableDoc, "c:\TestTables.xml")
Function WriteToFile(a_TableDoc, filename)
  Dim fso, file
  set fso = CreateObject("Scripting.FileSystemObject")
  set file = fso.CreateTextFile(filename, True, false)
  file.WriteLine(a_TableDoc.GetTablesXml())
  file.Close()
End Function
Testing the Export component
1 Open the TestExport.htm file using your browser.
2 Select the new or modified export component from the list of components.
3 Change any of the options you want to test.
4 Click the Export button to run the export.
5 Click the Properties.Xml button to see the effect of any changes you made to properties settings.
See also
Creating an export component