Sample html

From Agility
Jump to: navigation, search
<?xml version="1.0" encoding="utf-8"?>
<export>
  <configuration>
    <separator>,</separator>
    <textquote>"</textquote>
	<newline>\r\n</newline>
	<encoding>UTF8</encoding>
  </configuration>
  <contents>
    <const>
	<![CDATA[
"<html>
<head>
<title>Export To Html Sample - Number of Work Orders Raised (Last 6 months)</title>

<script src='http://softsols.dynalias.com/libjs/jquery/jquery-1.6.min.js' type='text/javascript'></script>
<script src='http://softsols.dynalias.com/libjs/highcharts/js/highcharts.js' type='text/javascript'></script>

		<style type='text/css'>

body 
{
	background-color: #aaaaaa;
}

table
{
	background-color: #555555;
	margin-left: 40px;
	margin-bottom: 20px;
}

.table_title
{
	background-color: #ffbbbb;
}

.table_header
{
	background-color: #ffbbbb;
}

.rowA
{
	background-color: #ddddff;
}

.rowB
{
	background-color: #bbbbff;
}

tr.rowB:hover
{
	background-color: #ffffbb;
}

tr.rowA:hover
{
	background-color: #ffffbb;
}

td, th 
{
	font-family: Verdana;
	font-size: 10pt;
}

td.error
{
	color: #ff0000;
}

td.warning
{
	color: #ffff00;
}

td.information
{
	color: #0000ff;
}

h1, h2, h3, h4, h5, h6
{
	font-family: Verdana;
}

h4
{
	background-color: #aaffaa;
	border: 1px solid #555555;
	padding: 3px 3px 3px 3px;
	margin-left: 20px
}

h3
{
	background-color: #ffffbb;
	border: 1px solid #555555;
	padding: 3px 3px 3px 3px;
}


</style>
</head>
<body>
<h3>
	Export To Html Sample - Number of Work Orders Raised (Last 6 months) <br>
	Report Date: " + Now() + "
</h3>
"
]]>
	</const>
	
	<const>
<![CDATA[
"
<br />
<div id='container-1' style='width: 100%; height: 400px'></div>
Warning! Highcharts library is free for personal, non profit and testing usage only.
<br /><br />

<script type='text/javascript'>
var chart1;
$(document).ready(function() {
   var options = {
      chart: {
         renderTo: 'container-1',
         defaultSeriesType: 'column'
      },
      title: {
         text: 'Number of Work Orders Raised'
      },
      subtitle: {
         text: 'Last 6 months'
      },
      xAxis: {
         categories: [
         ]
      },
      yAxis: {
         min: 0,
         title: {
            text: 'Work orders count'
         }
      },
      legend: {
         layout: 'vertical',
         backgroundColor: '#FFFFFF',
         align: 'left',
         verticalAlign: 'top',
         x: 100,
         y: 70,
         floating: true,
         shadow: true
      },
      tooltip: {
         formatter: function() {
            return ''+
               this.x +': '+ this.y;
         }
      },
      plotOptions: {
         column: {
            pointPadding: 0.2,
            borderWidth: 0
         }
      },
           series: [ {
			name: 'Breakdowns',
			data: [] 
		   }, {
		   	name: 'PPMs',
			data: [] 
		   }, {
		   	name: 'AdHock',
			data: [] 
		   }
		   ]
   };
"
]]>
	</const>
	<foreach table="JobStats" datacontext="query"  database="sxp">
		<queryfilter>
<![CDATA[
"
select 
	datepart(year, woJob.startDate) as JobYear,
	datepart(month, woJob.StartDate) as JobMonth,
	(cast(datepart(month, woJob.StartDate) as nvarchar(2)) + '/' + right(datename(year, woJob.StartDate),2)) as PeriodName,
	sum(
		case when syJobType.IsBreakDown = 1 then 1 else 0
		end) as NumberOfBreakdowns,
	SUM(
		case when syJobType.IsBreakDown = 0 and wojob.AssetStdJobID is not null then 1 else 0
		end) as NumberOfPPMs,
	SUM(
		case when syJobType.IsBreakDown = 0 and wojob.AssetStdJobID is null then 1 else 0
		end) as NumberOfAdHock
from woJob 
	inner join syJobType on woJob.JobTypeID = syJobType.jobTypeID
	where wojob.startDate >= dateadd(month, -6, getdate())
	group by 
		datepart(year, woJob.startDate), 
		datepart(month, woJob.StartDate),
	(cast(datepart(month, woJob.StartDate) as nvarchar(2)) + '/' + right(datename(year, woJob.StartDate),2))
order by JobYear, JobMonth
"
]]>
		</queryfilter>
		<data>
		<![CDATA[
"
			options.xAxis.categories.push('" + JobStats.PeriodName +"')
			options.series[0].data.push(parseInt(" + JobStats.NumberOfBreakdowns + "));
			options.series[1].data.push(parseInt(" + JobStats.NumberOfPPMs + "));
			options.series[2].data.push(parseInt(" + JobStats.NumberOfAdHock + "));
			
"
		]]>
		</data>
	</foreach>

	
	<const>
<![CDATA[
"
	chart1 = new Highcharts.Chart(options);
});
	
	</script>
"
]]>
    </const>
	
	<const>
<![CDATA[
"
<table cellspacing='1'>
	<tr class='table_header'>
	<th>Work Order</th>
	<th>Equipment Code</th>
	<th>Description</th>
	<th>Type</th>
	<th>Status</th>
	<th>Priority</th>
	<th>Start</th>
	<th>Due</th>
	</tr>
"
]]>
    </const>
	

    <foreach table="woJob" datacontext="database" classname="DataBO.ProcessMngt.JobBO">

      <dbfilter>woJob.StartDate >=  DATEADD(NOW(), 'MONTH', -6) order by woJob.StartDate</dbfilter>

      <filter datarowstate="Added,Modified,Deleted,Unchanged"></filter>
		<data>
		<![CDATA[
		"<tr class='rowA'>
		<td>" + HtmlEncode(woJob.JobCode) + "</td>
		<td>" + HtmlEncode(pmAsset.Code) + "</td>
		<td>" + HtmlEncode(woJob.FullDescription)+ "</td>
		<td>" + HtmlEncode(syJobType.Code)+ "</td>
		<td>" + HtmlEncode(syJobStatus.Description)+ "</td>
		<td>" + HtmlEncode(syPriority.Code)+ "</td>
		<td>" + HtmlEncode(woJob.StartDate)+ "</td>
		<td>" + HtmlEncode(woJob.DueDate)+ "</td>
		</tr>
		"
		]]>
		</data>
    </foreach>
    <const>
    <![CDATA[
"
</table>
"
	]]>
	</const>
	
	
	<const>
<![CDATA[
"</body>
</html>
"	
]]>
    </const>
	
  </contents>
</export>