KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Adding Variables for reports

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Reports
View previous topic :: View next topic  
Author Message
RRing



Joined: 16 Aug 2006
Posts: 39

PostPosted: Thu Jan 31, 2008 6:00 pm    Post subject: Adding Variables for reports Reply with quote

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
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Fri Feb 01, 2008 6:01 am    Post subject: Re: Adding Variables for reports Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Reports All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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

KS-Soft Forum Index