How to export specific tables/rows as HTML and HTML plain reports

Applies to
ApexSQL Data Diff

Summary
This article describes HTML and HTML plain reports in ApexSQL Data Diff.

ApexSQL Data Diff provides comprehensive and customizable HTML and HTML plain reports that can be set to correspond to a set of specific conditions.

Description
Before moving to mentioned reports, there are a couple of options that can be set for the exporting reports. To do so, click the Options button from the Home tab in the main window:

In the General tab, under the Script header section, the Author and Legal options can be set for all reports, by entering the author name and some legal (company) information:

One more thing that can be set is the export folder location. This option can be found under the Output tab and the export folder can be changed here:

HTML plain report

Once the comparison process is finished and the results are shown in the Main grid, all tables with differences can be selected, along with the corresponding rows. By default, all objects/rows are checked in the Main grid.

By selecting the desired table, the corresponding rows are shown in the Data difference pane, in which they can be individually checked/unchecked, in order to get the desired results in the report:

Additionally, it’s possible to select only missing/different/additional rows, depending on the desired outcome.

For example, if there is a need to export only additional rows:

  1. Uncheck all rows in the All rows tab:

  2. Switch to the Additional tab and check all additional rows:

Once the desired tables/rows are checked, click the Export button from the Home tab and select the HTML plain report:

After the HTML plain report is selected, the following window will be shown:

Options in this window are divided in two groups:

  1. Objects to export:

    1. Different – export different objects
      1. Checked only – export only different objects that are checked in the Main grid
    2. Equal – export equal objects

  2. Include:

    1. Data comparison options – show information in report about data comparison options that are used

    2. Info on objects to export – show information in the report about an object which objects types are included (different, equal, checked only)

    3. Different data rows – show information in report about data for different rows in table format
      1. Checked rows only – export only data rows that are checked in the Data difference pane

    Since only specific tables/rows need to be exported, the same options are checked as in the screenshot above and the OK button is clicked. Once the report is generated it will be opened in a default browser.

    As shown on the screenshot below, the HTML plain report consists of four sections: Header, Data comparison options, Report option selections, and Data comparison results:

    In the Header section, there is an information about servers\databases that are compared, along with a report date when it’s created, and author and legal information that was mentioned in the beginning. The Data comparison options section contains information about options that were checked in the comparison process. In the Report option selection section are shown which object types are checked for exporting. If any option in the Data comparison options section and in the Report option selection section was checked, it will be marked with an X.

    In the last section, the Data comparison results are showing table name and schema, how many rows there is in source/destination, how much of them are equal/not equal, and how much of them are in source only/destination only.

    Each table name is linked to its corresponding table with rows that were checked for exporting. If a table name is clicked, it will navigate to the appropriate table in the report, which will show all rows with differences:

    HTML report

    The main difference between HTML report and HTML plain report, is that HTML report has an interactive way of navigation through the report. It allows to expand/collapse the Data comparison results and data for individual objects, which allows better user experience and easier usage.

    The way for getting the specific tables/rows exported in HTML report is the same as for HTML plain report. Once the desired tables/rows are checked, click the Export button and choose the HTML report:

    The exporting options are the same as for HTML plain report:

    Once the HTML report is created, at first look, there is not too much difference with an HTML plain report, but at the bottom, there is an expandable button for the Data comparison section:

    If Data tables are expanded, it will show the same Data table as in HTML plain report. The only difference is that table with different data rows will be shown only if a table name is clicked and the expandable button next to the Data is clicked:

    To see other tables with different data rows, just click the desired table name in the Data tables table, and it will be shown below.

    Q: How do I include different data rows in HTML and HTML plain reports?

    A: When creating HTML and/or HTML plain reports check the Different data rows option in the HTML report options window.

    Q: Can I export only one table with a couple of rows in these reports?

    A: Yes, just uncheck all tables from the Main grid, check the desired table and its corresponding rows in the Data difference pane.

    Q: Can I change the default location where these reports are created?

    A: Yes, you can change it if you click the Options button, from the Home tab of the Main window, switch to the Output tab, and change the Export folder location.

    Q: What is a difference between HTML and HTML plain reports?

    A: The main difference between these two reports is that HTML report doesn’t load different data rows when it’s created and therefore it’s generated faster than HTML plain report. Different data rows are shown only when a table is clicked in the Data comparison results section of the HTML report.

    Q: Can I export only different data rows without any other options included?

    A: Yes, if you uncheck in the HTML report options window the Equal objects, along with the Data comparison options and Info on objects to export, and check the Different objects (with Checked only, if needed) and Different data rows (with Checked rows only, if needed) report will contain only tables with different data rows.