Create custom report in 4.0.2

Ask general questions here.
LeonidB
Posts: 1
Joined: Sun Feb 10, 2013 2:37 pm

Create custom report in 4.0.2

Post by LeonidB » Sun Feb 10, 2013 2:49 pm

Hello,

We have displayed additional chart of test modules while have been working with Ranorex3. Now, after upgrade to 4.0.2, we would like to preserve this feature. Because the xls/html templates changed in Ranorex4, I tried to create new custom template and change Ranorex4.xsl and View.rxlog. I added new 'div' called 'testModulesPie' to the xsl (see attached) and copied function ShowChart in the rxlog (see the attached). The result is obviously far from expected.
Can you assist me with this? It worked perfectly in Ranorex3, what has to be done to fix this in Ranorex4?

Thanks a lot,
Leonid.
Attachments
newreport.zip
(176.83 KiB) Downloaded 210 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Create custom report in 4.0.2

Post by Support Team » Mon Feb 11, 2013 1:46 pm

Hello Leonid,

you have to change your xslt variables to tag attributes because the javascript works a different in 4.X. Surround both pie-charts with a div tag to display them side-by-side.

Regards,
Florian
Ranorex Team
<!-- PIECHART -->	
<div>	<!-- surrounding div to fix visual apperance -->

	<div id="testCasesPie" style="height:180px;width:280px; position:relative;  margin: -180px 0 0 330px; right: 0;">
		<xsl:attribute name="totalsuccesscount">
			<xsl:value-of select="@totalsuccesscount" />
		</xsl:attribute>
		<xsl:attribute name="totalfailedcount">
			<xsl:value-of select="@totalfailedcount" />
		</xsl:attribute>
		<xsl:attribute name="totalblockedcount">
			<xsl:value-of select="@totalblockedcount" />
		</xsl:attribute>
	</div>

  <div id="testModulesPie" style="height:180px;width:280px; position:relative;  margin: -180px 0 0 280px; right: 0;"> <!-- adjusted margin so both charts fit on screen -->
	<xsl:attribute name="successModules" > <!-- changed variable to attribute so values are recognized by javascript -->
	  <xsl:value-of select ="count(.//activity[(@type='test module') and @result='Success'])"/>
	</xsl:attribute>
	<xsl:attribute name="failedModules" >
	  <xsl:value-of select ="count(.//activity[(@type='test module') and @result='Failed'])"/>
	</xsl:attribute>
	<xsl:attribute name="ignoredModules" >
	  <xsl:value-of select ="count(.//activity[(@type='test module') and @result='Ignored'] )"/>
	</xsl:attribute>
  </div>
</div>
.
Image