# Help with InRoads Cross Section Evaluation Report

Good Morning

I’m trying to understand why my custom InRoads XSL report is not generating the result for the Cross Slope value when compared to what I come up with by hand calculation.  Can someone take a look at this please and see what I’m missing… please?

I am trying to create a report that publishes the elevation of the left edge-of-travelway, centerline, and the right edge-of-travelway, also I want it to publish the cross slope of the left travelway and the right travelway and these values would be provided per cross section interval.

I have been able to customize the Evaluation report “Cross Section Points” to return the ‘cross-slope’ percentage by adding a JavaScript function, but this math function that I’ve created always produces an result that is consistently off by 0.06%, is there a rounding issue with JavaScript “toFixed” method?  I have no idea why this function I created is producing a result that is consistently off by this amount.  Is there anyone out there with time to check this out?

This is my custom JavaScript function, (which is at the end of my custom stylesheet)

```...
</xsl:template>
<msxsl:script implements-prefix="inr" language="JScript">
<![CDATA[
// This function derives the slope between the CL point
// and the edge of travelway point both of which are at
// existing ground elevation.
function DeterimeSlope(clelev, etwelev, offset)
{
slope = 0;
elevdiff = Math.abs(clelev - etwelev);
// var slope = (Math.abs(elevdiff / offset) * 100).toFixed(2);
slope = (Math.abs(elevdiff / offset) * 100);
return slope + "%";
}
]]></msxsl:script>
</xsl:stylesheet>```

The raw.xml file that has the cross section information in it is “RPT1A0D.xml”, and my custom stylesheet is “MDOT_CrossSectionPoints_WTR_working.xsl”.

This is what my custom report output looks like:

3733.RPT1A0D.xml
```<?xml version="1.0" encoding="iso-8859-1"?>
<InRoads productName="Bentley InRoads Suite V8i (SELECTseries 2)" productVersion="08.11.07.630" outputGridScaleFactor="1.000000" inputGridScaleFactor="1.000000" linearUnits="Imperial" angularUnits="Degrees" commandName="Cross Section Report">
<CrossSectionSet setID="3" setName="Ex-XSlope-Test" alignmentOID="{D97B6FD8-920B-40F1-8F03-6019AEFF8978}" alignmentName="Ex-XSlope-Test">
<CrossSectionStations>
<Station internalStation="0.000050" externalStationName="" externalStation="0.000050"/>
<CrossSectionSurfaces>
<CrossSectionSurface name="LIDAR existing conditions x-sections only" type="0">
<CrossSectionPoints>
<CrossSectionPoint type="CrossSectionPoint" northing="735900.301651" easting="1692702.904343" offset="-11.999981" elevation="614.927381" flag="Begin"/>
<CrossSectionPoint type="ExistingCenterline" northing="735891.301331" easting="1692710.841234" offset="0.000019" elevation="615.997065"/>
<CrossSectionPoint type="CrossSectionPoint" northing="735882.301012" easting="1692718.778125" offset="12.000019" elevation="615.343766" flag="End"/>
</CrossSectionPoints>
</CrossSectionSurface>
</CrossSectionSurfaces>
</CrossSectionStation>
<Station internalStation="10.000000" externalStationName="" externalStation="10.000000"/>
<CrossSectionSurfaces>
<CrossSectionSurface name="LIDAR existing conditions x-sections only" type="0">
<CrossSectionPoints>
<CrossSectionPoint type="CrossSectionPoint" northing="735906.915708" easting="1692710.404559" offset="-12.000000" elevation="614.804465" flag="Begin"/>
<CrossSectionPoint type="ExistingCenterline" northing="735897.915389" easting="1692718.341450" offset="-0.000000" elevation="615.947748"/>
<CrossSectionPoint type="CrossSectionPoint" northing="735888.915069" easting="1692726.278342" offset="12.000000" elevation="615.303967" flag="End"/>
</CrossSectionPoints>
</CrossSectionSurface>
</CrossSectionSurfaces>
</CrossSectionStation>
<Station internalStation="20.000000" externalStationName="" externalStation="20.000000"/>
<CrossSectionSurfaces>
<CrossSectionSurface name="LIDAR existing conditions x-sections only" type="0">
<CrossSectionPoints>
<CrossSectionPoint type="CrossSectionPoint" northing="735913.529784" easting="1692717.904825" offset="-12.000000" elevation="614.718334" flag="Begin"/>
<CrossSectionPoint type="ExistingCenterline" northing="735904.529465" easting="1692725.841717" offset="-0.000000" elevation="615.924367"/>
<CrossSectionPoint type="CrossSectionPoint" northing="735895.529145" easting="1692733.778608" offset="12.000000" elevation="615.238414" flag="End"/>
</CrossSectionPoints>
</CrossSectionSurface>
</CrossSectionSurfaces>
</CrossSectionStation>
<Station internalStation="30.000000" externalStationName="" externalStation="30.000000"/>
<CrossSectionSurfaces>
<CrossSectionSurface name="LIDAR existing conditions x-sections only" type="0">
<CrossSectionPoints>
<CrossSectionPoint type="CrossSectionPoint" northing="735920.143861" easting="1692725.405092" offset="-12.000000" elevation="614.723170" flag="Begin"/>
<CrossSectionPoint type="ExistingCenterline" northing="735911.143541" easting="1692733.341983" offset="-0.000000" elevation="615.876978"/>
<CrossSectionPoint type="CrossSectionPoint" northing="735902.143221" easting="1692741.278875" offset="12.000000" elevation="615.211808" flag="End"/>
</CrossSectionPoints>
</CrossSectionSurface>
</CrossSectionSurfaces>
</CrossSectionStation>
<Station internalStation="40.000000" externalStationName="" externalStation="40.000000"/>
<CrossSectionSurfaces>
<CrossSectionSurface name="LIDAR existing conditions x-sections only" type="0">
<CrossSectionPoints>
<CrossSectionPoint type="CrossSectionPoint" northing="735926.757937" easting="1692732.905358" offset="-12.000000" elevation="614.767253" flag="Begin"/>
<CrossSectionPoint type="ExistingCenterline" northing="735917.757617" easting="1692740.842250" offset="0.000000" elevation="615.852620"/>
<CrossSectionPoint type="CrossSectionPoint" northing="735908.757297" easting="1692748.779141" offset="12.000000" elevation="615.191458" flag="End"/>
</CrossSectionPoints>
</CrossSectionSurface>
</CrossSectionSurfaces>
</CrossSectionStation>
<Station internalStation="50.000000" externalStationName="" externalStation="50.000000"/>
<CrossSectionSurfaces>
<CrossSectionSurface name="LIDAR existing conditions x-sections only" type="0">
<CrossSectionPoints>
<CrossSectionPoint type="CrossSectionPoint" northing="735933.372013" easting="1692740.405625" offset="-12.000000" elevation="614.832509" flag="Begin"/>
<CrossSectionPoint type="ExistingCenterline" northing="735924.371693" easting="1692748.342516" offset="0.000000" elevation="615.782411"/>
<CrossSectionPoint type="CrossSectionPoint" northing="735915.371373" easting="1692756.279408" offset="12.000000" elevation="615.134286" flag="End"/>
</CrossSectionPoints>
</CrossSectionSurface>
</CrossSectionSurfaces>
</CrossSectionStation>
<Station internalStation="60.000000" externalStationName="" externalStation="60.000000"/>
<CrossSectionSurfaces>
<CrossSectionSurface name="LIDAR existing conditions x-sections only" type="0">
<CrossSectionPoints>
<CrossSectionPoint type="CrossSectionPoint" northing="735939.986089" easting="1692747.905891" offset="-12.000000" elevation="614.887480" flag="Begin"/>
<CrossSectionPoint type="ExistingCenterline" northing="735930.985769" easting="1692755.842783" offset="0.000000" elevation="615.764136"/>
<CrossSectionPoint type="CrossSectionPoint" northing="735921.985449" easting="1692763.779674" offset="12.000000" elevation="615.090532" flag="End"/>
</CrossSectionPoints>
</CrossSectionSurface>
</CrossSectionSurfaces>
</CrossSectionStation>
<Station internalStation="70.000000" externalStationName="" externalStation="70.000000"/>
<CrossSectionSurfaces>
<CrossSectionSurface name="LIDAR existing conditions x-sections only" type="0">
<CrossSectionPoints>
<CrossSectionPoint type="CrossSectionPoint" northing="735946.600165" easting="1692755.406158" offset="-12.000000" elevation="614.867040" flag="Begin"/>
<CrossSectionPoint type="ExistingCenterline" northing="735937.599845" easting="1692763.343049" offset="0.000000" elevation="615.721052"/>
<CrossSectionPoint type="CrossSectionPoint" northing="735928.599525" easting="1692771.279941" offset="12.000000" elevation="615.035679" flag="End"/>
</CrossSectionPoints>
</CrossSectionSurface>
</CrossSectionSurfaces>
</CrossSectionStation>
<Station internalStation="80.000000" externalStationName="" externalStation="80.000000"/>
<CrossSectionSurfaces>
<CrossSectionSurface name="LIDAR existing conditions x-sections only" type="0">
<CrossSectionPoints>
<CrossSectionPoint type="CrossSectionPoint" northing="735953.214241" easting="1692762.906424" offset="-12.000000" elevation="614.853820" flag="Begin"/>
<CrossSectionPoint type="ExistingCenterline" northing="735944.213921" easting="1692770.843316" offset="0.000000" elevation="615.711238"/>
<CrossSectionPoint type="CrossSectionPoint" northing="735935.213602" easting="1692778.780207" offset="12.000000" elevation="615.116099" flag="End"/>
</CrossSectionPoints>
</CrossSectionSurface>
</CrossSectionSurfaces>
</CrossSectionStation>
<Station internalStation="90.000000" externalStationName="" externalStation="90.000000"/>
<CrossSectionSurfaces>
<CrossSectionSurface name="LIDAR existing conditions x-sections only" type="0">
<CrossSectionPoints>
<CrossSectionPoint type="CrossSectionPoint" northing="735959.828317" easting="1692770.406691" offset="-12.000000" elevation="614.915867" flag="Begin"/>
<CrossSectionPoint type="ExistingCenterline" northing="735950.827997" easting="1692778.343582" offset="0.000000" elevation="615.684421"/>
<CrossSectionPoint type="CrossSectionPoint" northing="735941.827678" easting="1692786.280473" offset="12.000000" elevation="615.071944" flag="End"/>
</CrossSectionPoints>
</CrossSectionSurface>
</CrossSectionSurfaces>
</CrossSectionStation>
<Station internalStation="99.999950" externalStationName="" externalStation="99.999950"/>
<CrossSectionSurfaces>
<CrossSectionSurface name="LIDAR existing conditions x-sections only" type="0">
<CrossSectionPoints>
<CrossSectionPoint type="CrossSectionPoint" northing="735966.442343" easting="1692777.906935" offset="-11.999977" elevation="614.938506" flag="Begin"/>
<CrossSectionPoint type="ExistingCenterline" northing="735957.442024" easting="1692785.843826" offset="0.000023" elevation="615.632356"/>
<CrossSectionPoint type="CrossSectionPoint" northing="735948.441704" easting="1692793.780717" offset="12.000023" elevation="614.966179" flag="End"/>
</CrossSectionPoints>
</CrossSectionSurface>
</CrossSectionSurfaces>
</CrossSectionStation>
</CrossSectionStations>
</CrossSectionSet>
```

1050.MDOT_CrossSectionPoints_WTR_working.xsl

Any Help would be Greatly Appreciated, Thanks,