Generate report within toolkit
Brian Donahue
Posts: 6,590 Bronze 1
Hi Steve,
Like I said in the previous post about this, there is no method on any
of the toolkit objects that will produce a report. This is done in the
actual program's UI layer rather than down in the Engine, so you'd have to
write your own code to produce the report.
Creating an HTML report is probably the easiest option, since less
people understand RTF (and even fewer understand Word!). You have to convert
the database differences to XML, then transform the XML into HTML using an
XSL template.
I've attached an example that you can use to create an HTML report with
the SQLCompare Engine. It uses the XSL file that ships with Red Gate SQL
Bundle, aptly called SQLCompareReportTemplate.xsl', that you will need to
copy into the same folder as your executable.
There are some differences between this HTML report and the commercial
version -- mainly that it does not try to match lines of SQL: it merely
displays the SQL side-by-side. This is because the code for matching the
lines of SQL is proprietary. (Sorry!)
If anyone has any comments about the code, feel free to post them!
Regards,
Brian Donahue
Red Gate Technical Support
Like I said in the previous post about this, there is no method on any
of the toolkit objects that will produce a report. This is done in the
actual program's UI layer rather than down in the Engine, so you'd have to
write your own code to produce the report.
Creating an HTML report is probably the easiest option, since less
people understand RTF (and even fewer understand Word!). You have to convert
the database differences to XML, then transform the XML into HTML using an
XSL template.
I've attached an example that you can use to create an HTML report with
the SQLCompare Engine. It uses the XSL file that ships with Red Gate SQL
Bundle, aptly called SQLCompareReportTemplate.xsl', that you will need to
copy into the same folder as your executable.
There are some differences between this HTML report and the commercial
version -- mainly that it does not try to match lines of SQL: it merely
displays the SQL side-by-side. This is because the code for matching the
lines of SQL is proprietary. (Sorry!)
If anyone has any comments about the code, feel free to post them!
Regards,
Brian Donahue
Red Gate Technical Support
This discussion has been closed.
Comments