|
View previous topic :: View next topic |
Author |
Message |
RRing
Joined: 16 Aug 2006 Posts: 39
|
Posted: Thu Jan 31, 2008 6:00 pm Post subject: Adding Variables for reports |
|
|
I am trying to create a report and need to combine 2 variables together to get a final result for uptime. Example, %FolderAverage_AliveTime% + %FolderAverage_UnknownTime% . I am new at creating reports and am trying to do this in Custom HTML, But am totally lost. Trying for a report with following fields
Folder - Alive+Unknown - Dead - PassedTest+UnknownTest - Dead
Do you have more detailed examples on how I can do this? Thank you |
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Fri Feb 01, 2008 6:01 am Post subject: Re: Adding Variables for reports |
|
|
RRing wrote: | I am trying to create a report and need to combine 2 variables together to get a final result for uptime. Example, %FolderAverage_AliveTime% + %FolderAverage_UnknownTime%. | It is posible to add variables using Java script and document.writefunction. For example, to calculate PassedTest+UnknownTest value you place the following code somewhere in "Folder Title" tab of "HTML Report tepmplate" window :
Code: | <SCRIPT type="text/javascript">
var passed_tests = %FolderTotal_PassedTests% + %FolderTotal_UnknownTests%;
document.write("<TR><TD>Total Passed tests : </TD><TD>"+passed_tests+"</TD></TR>");
</script> | Of course it is just an exampe, and you may specify any HTML tags as parameter for document.write function.
However, it is almost impossible to add %FolderAverage_AliveTime% and %FolderAverage_UnknownTime%. These variables represent time, so to add two time variables you should convert them to date using Date object of Javascript. You may try if you want.
RRing wrote: | I am new at creating reports and am trying to do this in Custom HTML, But am totally lost. Trying for a report with following fields
Folder - Alive+Unknown - Dead - PassedTest+UnknownTest - Dead | You may try to add the following code into in "Folder Title" tab of "HTML Report tepmplate" window of certain "Custom HTML" report:
Code: | <SCRIPT type="text/javascript">
alive_var = %FolderAverage_AliveRatio% + %FolderAverage_UnknownRatio%;
passed_var = %FolderTotal_PassedTests% + %FolderTotal_UnknownTests%;
document.write("<tr><td><b>%Folder% 126</td><td>"+alive_var+"</td><td>%FolderAverage_DeadRatio%</td><td>"+passed_var+"</td><td>%FolderTotal_FailedTests%</td></tr>");
</script> |
Regards,
Max |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|