Format reports?

Carl DCarl D Posts: 4
edited March 16, 2006 1:37PM in SQL Compare Previous Versions
We have a database that is so out of synch that when I try to generate a report with sqlcompare it produces a html file that is 45MB, and cannot load in InternetExplorer. I tried generating rtf, but that turned out to be 715MB and Word cannot open it.

Is there any way to configure the report format so that I could just generate a summary?

Thanks,

Carl

Comments

  • Hi,

    That means the database is very very large. and have many descrepencies.

    You can divide the reports on the basisi of objects selections or relation of exist in both DB or different or only in one.



    T. kato
  • The database is fairly large (~700 tables). I realize that there are a lot of differences, that's the problem.

    I have already filtered the diff to exclude items that are equivalent. That's not what I'm asking for. It would be nice to format the report to produce a one line summary for each object (just like diff). The report output options are too limited.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi Carl,

    Do you mean a report that doesn't include the SQL code (that you can see when you expand a difference/expand all)? This is certainly possible if you're not squeamish about manipulating the XSL template in the SQL Bundle folder (sqlcomparereporttemplate.xsl).

    If you replace this file with this content, you should only see object names and status:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
                    version="1.0">
    	<xsl:template match="/">
    		<head>
    			<TITLE>SQL Compare Report</TITLE>
    			<script language="javascript">
    				
    				var m_sExpIDs;
    				m_sExpIDs='';
    
    				function ShowAllChildren(sExpIDs,bExpand){
    					
    					var i, tdElement,divname,sExpID;
    					
    					sExpID='';
    
    					for (var i=0; i!=sExpIDs.length; i++)
    					{
    						if(sExpIDs.substring(i,i+1) != "#")
    						{
    							sExpID = sExpID + sExpIDs.substring(i,i+1);
    						}
    						else
    						{
    							tdElement = document.all('Exp' + sExpID);
    							divname = eval('Div' + sExpID + '.style');
    						
    							if(bExpand == -1)
    								{
    								divname.display = '';
    								tdElement.innerText = '-';
    								}
    							else
    								{
    								divname.display = 'none';
    								tdElement.innerText = '+';
    								}
    							sExpID = ""
    							}
    					}
    
    				}
    
    				function ShowChild(sExpID){
    					var divname,tdElement;
    					
    					tdElement = document.all('Exp' + sExpID);
    					divname = eval('Div' + sExpID + '.style');
    				
    					if(divname.display == 'none')
    						{
    							divname.display = '';
    							tdElement.innerText = '-';
    						}
    					else		
    						{
    							divname.display = 'none';
    							tdElement.innerText = '+';
    						}
    				}
    			</script>
    			<style>
    				body
    				{
    				    FONT-FAMILY: Arial, Helvetica, sans-serif;
    				    FONT-SIZE: 8pt;
    				    FONT-STYLE: normal
    				}
    				a
    				{
    				    FONT-SIZE: 8pt;
    				    COLOR: blue;
    				    FONT-FAMILY: Arial, Helvetica, sans-serif;
    				    TEXT-DECORATION: none
    				}
    				a:hover
    				{
    				    COLOR: red;
    				    TEXT-DECORATION: underline
    				}
    				td
    				{
    				    FONT-FAMILY: Arial, Helvetica, sans-serif;
    				    FONT-SIZE: 8pt
    				}
    				.even
    				{
    				    BACKGROUND-COLOR: #eeeeee;
    				    COLOR: #0000FF
    				}
    				.odd
    				{
    				    BACKGROUND-COLOR: #cccccc;
    				    COLOR: #0000FF
    				}
    				.dbotitle
    				{
    				    BACKGROUND-COLOR: #6600CC;
    				    COLOR: white
    				}
    				.screqual
    				{
    				    BACKGROUND-COLOR: white;
    				    COLOR: black
    				}
    				.scrunequal
    				{
    				    BACKGROUND-COLOR: white;
    				    COLOR: green
    				}
    				.scrrightonly
    				{
    				    BACKGROUND-COLOR: white;
    				    COLOR: red
    				}
    				.scrleftonly
    				{
    				    BACKGROUND-COLOR: white;
    				    COLOR: blue
    				}
    				.hint
    				{
    				    FONT-SIZE: 8pt;
    				    COLOR: blue;
    				    FONT-FAMILY: Arial, Helvetica, sans-serif
    				}
    			</style>
    			<!--<link rel="stylesheet" href="main.css"> -->
    		</head>
    		
    		<body bgcolor="#fafae6" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    		<center><h1>SQL Compare Report</h1></center>
    		
    		<h4>Databases</h4>
    		<h5><xsl:apply-templates select="//root/databases/database[@id=1]"/></h5>
    		<h5><xsl:apply-templates select="//root/databases/database[@id=2]"/></h5>
    		<h5><xsl:apply-templates select="//root/databases"/></h5>
    			<table>
    				<tr>
    					<td>|</td>
    					<td>			
    						<a class="hint" href="javascript:ShowAllChildren(m_sExpIDs,-1)">Expand All</a>
    					</td>
    					<td>|</td>
    					<td>			
    						<a class="hint" href="javascript:ShowAllChildren(m_sExpIDs,0)">Collapse All</a>
    					</td>
    					<td>|</td>
    				</tr>
    			</table>
    			<table width="100%">
    				<xsl:apply-templates select="root/differences"/>
    			</table>
    			<table>
    				<tr>
    					<td>|</td>
    					<td>			
    						<a class="hint" href="javascript:ShowAllChildren(m_sExpIDs,-1)">Expand All</a>
    					</td>
    					<td>|</td>
    					<td>			
    						<a class="hint" href="javascript:ShowAllChildren(m_sExpIDs,0)">Collapse All</a>
    					</td>
    					<td>|</td>
    				</tr>
    			</table>
    			</body>
    	</xsl:template>
    	
    	<!--Database name retrieve-->
    	<xsl:template match="database">
    		<xsl:value-of select="description"/>
    	</xsl:template>
    	
    	<!--Database name retrieve-->
    	<xsl:template match="databases">
    		<xsl:value-of select="timestamp"/>
    	</xsl:template>
    	
    	<!--table title section-->
    	<xsl:template match="differences">
    		<tr class="dbotitle">
    			<td></td>
    			<td>Type</td>
    			<td>Name</td>
    			<td align="middle">Status</td>
    		</tr>
    		<xsl:apply-templates />
    	</xsl:template>
    
    	<!--difference lines section-->
    	<xsl:template match="difference">
    		<tr>
    			<td></td>
    			<td><xsl:value-of select="objecttype" /></td>
    			<td><xsl:value-of select="name" /></td>
    			
    			<td align="middle" style="width:3em">
    				<xsl:choose>
    					<xsl:when test="action[.='OnlyIn1']"><![CDATA[->]]></xsl:when>
    					<xsl:when test="action[.='OnlyIn2']"><![CDATA[<-]]></xsl:when>
    					<xsl:when test="action[.='Different']"><![CDATA[<>]]></xsl:when>
    					<xsl:otherwise><![CDATA[==]]></xsl:otherwise>
    				</xsl:choose>
    			</td>				
    
    			
    		</tr>
    		<tr>
    			<td colspan="6">	
    				<div style="DISPLAY: none">
    					<xsl:attribute name="id">Div<xsl:value-of select="@id"/></xsl:attribute>
    						
    				</div>
    			</td>
    		</tr>
    	</xsl:template>
    
    	<!--script comparison title line section-->
    	<xsl:template match="comparestrings">
    		<xsl:apply-templates />
    	</xsl:template>
    
    	<!--script comparison left only line section-->
    	<xsl:template match="comparestring[action='leftonly']">
    		<tr class="scrleftonly">
    			<td><xsl:value-of select="leftstring"/></td>
    			<td style="width:3em"><![CDATA[->]]></td>
    			<td></td>	
    		</tr>
    	</xsl:template>
    
    	<!--script comparison right only line section-->
    	<xsl:template match="comparestring[action='rightonly']">
    		<tr class="scrrightonly">
    			<td></td>
    			<td  style="width:3em"><![CDATA[<-]]></td>
    			<td><xsl:value-of select="rightstring"/></td>	
    		</tr>
    	</xsl:template>
    
    	<!--script comparison unequal line section-->
    	<xsl:template match="comparestring[action='different']">
    		<tr class="scrunequal">
    			<td><xsl:value-of select="leftstring"/></td>
    			<td style="width:3em"><![CDATA[<>]]></td>
    			<td><xsl:value-of select="rightstring"/></td>	
    		</tr>
    	</xsl:template>
    			
    	<!--script comparison equal line section-->	
    	<xsl:template match="comparestring[action='equal']">
    		<tr class="screqual">
    			<td><xsl:value-of select="leftstring"/></td>
    			<td style="width:3em"><![CDATA[==]]></td>
    			<td><xsl:value-of select="rightstring"/></td>	
    		</tr>
    	</xsl:template>
    </xsl:stylesheet>
    
  • Exactly what I'm looking for!

    Thanks
Sign In or Register to comment.