Custom report template

Ask general questions here.
UgaAga
Posts: 69
Joined: Thu Mar 15, 2012 2:11 pm

Custom report template

Post by UgaAga » Wed Feb 12, 2014 4:13 pm

Hi,
how is it possible to write the error message of a test iteration into its header?
I modified the xsl by

<xsl:if test=".//item[@level='Error']">
<span class="message"> - <xsl:value-of select=".//item[@level='Error']"/></span>
</xsl:if>

Now the error message will be shown in the header of the iteration but also in the header of the parent iterations. How will the message be written only into the corresponding iteration?

Many thanks

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Custom report template

Post by Support Team » Thu Feb 13, 2014 5:18 pm

Hi,
In order to write the error message to the header of the test iteration insert your code at following position within your *.xsl-file :

Code: Select all

<xsl:if test="./datarow/field">
	<div class="datarow">
		<xsl:apply-templates select="./datarow"/>
						
		<xsl:if test=".//item[@level='Error']">
  <span class="message"> - <xsl:value-of select=".//item[@level='Error']"/></span>
		</xsl:if>   

  </div>
		</xsl:if>
Regards,
Robert

UgaAga
Posts: 69
Joined: Thu Mar 15, 2012 2:11 pm

Re: Custom report template

Post by UgaAga » Wed Feb 19, 2014 11:51 am

Hi Robert,
thanks for your answer, but i would like to write the error message to the title of each iteration. Sorry that didn't make that clearer.

Best regards

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Custom report template

Post by Support Team » Wed Feb 19, 2014 4:56 pm

Hi UgaAga,

Nothing to worry about. Please add your code add the following position to your *.xsl file:
<li class="{@result} iteration" id="iteration{@rid}">  
			<h2 class="{@result}" onclick="OnLoadContentDynamic('{@rid}','iteration',this);">
				<span class="ui-status-icon"></span>
				<xsl:choose>
					<xsl:when test="@type='test case iteration'">Iteration: </xsl:when>
					<xsl:otherwise>Repeat: </xsl:otherwise>
				</xsl:choose>
				<xsl:value-of select="./@iteration"/>
				
					<xsl:if test=".//item[@level='Error']">
						<span class="message"> - <xsl:value-of select=".//item[@level='Error']"/></span>
      
					</xsl:if>
The report should look somehow like this, after you inserted the code:
CustomizedReport.png
Regards,
Robert
You do not have the required permissions to view the files attached to this post.

UgaAga
Posts: 69
Joined: Thu Mar 15, 2012 2:11 pm

Re: Custom report template

Post by UgaAga » Wed Feb 19, 2014 5:56 pm

Hi,
ok but in this case the error message will also be shown in the header of the parent iteration. This isn't what i would like to have. How can is it possible to prevent this?

Bye

UgaAga
Posts: 69
Joined: Thu Mar 15, 2012 2:11 pm

Re: Custom report template

Post by UgaAga » Tue Mar 04, 2014 10:58 am

...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Custom report template

Post by Support Team » Wed Mar 05, 2014 4:12 pm

Hello,

Unfortunately we cannot provide a solution for this issue since it is a highly customized solution and it diverges too far from our support field. Thank you for your understanding.

Regards,
Robert

UgaAga
Posts: 69
Joined: Thu Mar 15, 2012 2:11 pm

Re: Custom report template

Post by UgaAga » Fri Mar 07, 2014 3:50 pm

No problem i found the solution on my own

<xsl:if test="./activity/item[@level='Error'] or ./activity/activity[@type='test module' or @type='module group']//item[@level='Error']">
<span class="message"> - <xsl:value-of select=".//item[@level='Error']"/></span>
</xsl:if>