KB-10 Passing parameters to the trends to make a report


If you are using the latest version of our TrendViewer (as of this writing in the beta download folder with August 15th date or later), the ability to pass URL parameters to configure the trend viewer is available. This can be useful for users that view or want to view the same information on a regular bases. A link can be made to set up the viewer on load so the user does not have to choose the same points and set the date range each time they want to see a specific report. The long time Inetsupervisor users should know about setting up URL parameters to web pages, but I will go over it again for newer user.




URL parameters are a string of ampersand(&) delimited variables, and there associated values, that can be added to the end of a web page address(link). These vars, if the web page knows what to do with them, can configure or modify the web page when it loads. Also as in our case the web page can pass it to an object in the web page such as a flash movie. The start of the string of vars is always a question mark symbol(?) this will tell the web page that variables are coming. The next is to put the parameter name (remember case sensitive) followed by an equal sign(=) then the value of the parameter. If there are more then 1 parameters then an ampersand(&) needs to follow the value and before the next parameter's name, then complete as the first. Do the same for any additional parameter's.




The Trend Viewer will accept 13 configuration parameters:



    ids This is a comma delimited string of Inetsupervisor point id's. When this parameter is passed the viewer will automatically choose the points in the string on load.



    rids This is the same as ids but it will assign the point id's to the right side Y axis. This can be used to overlay trend graphs with different value ranges.



    startoffset This is an number used to specify an amount of days to start the viewer prior to the current date. For instance if you wish to start the selected view for the last 7 days you would enter 7.



    pen1 – pen10 These are comma delimited strings used to define the color, type, and form of the individual pen lines of data. The string must contain the color, in RGB format, then the pen type (available pen types: line(default) , plot, area or column) typed out (case sensitive), then the pen form (available pen forms: curve(default), segment, step, reverseStep, vertical or horizontal) typed out (case sensitive).




Some examples:



When the viewer opens I want to load point 23.



    Open the tree editor



    Drag over the QTrendsById.aspx web page from the sysapp folder.



    Double click to open the properties.



    At the bottom property URL add ?ids=23 to the end of the string



    Save and refresh tree


    When you click the link the viewer will open to point 23 loaded with todays data



    Add points 24 and 67





    Open the tree editor



    Double click to open the properties of the above node.



    Change ?ids=23 to ?ids=23,24,67



    Save and refresh


    Now it loads points 23, 24 and 67





Move point 67 to the right Y axis and load 5 days of data. Same as above, but change ?ids=23,24,67 to ?ids=23,24&rids=67&startoffset=5 Now point 67is attached to the right Y axis and 5 days of data shows


Show point 67 as a blue column type grid, change to ?ids=23,24&rids=67&startoffset=5&pen3=0x0000FF,column,curve Notice that the last parameter is pen3 not pen1 that is because when the points are loaded the viewer loads all the points from ids first then the points from rids, so 67 would be the 3rd series in the line. Not all the parameter's have to be used and they do not need to be in any order, but remember if you are specifying a pen then it has to be color,type,form and all parts of the string need to be there, even if you are using a chart type that requires no information from the form like a plot. These reports can also be linked not only from the tree but also buttons, text, browser favorites, custom flash or any place a web link can be placed.




You can also view a tutorial on using the Trend Viewer on the web

Add Feedback