Register  Login  
  May 18, 2012  
Forum    
Forum Minimize
 
ForumForumDiscussionsDiscussionsSQL Tips and Tr...SQL Tips and Tr...SGSV & Google-o-meterSGSV & Google-o-meter
Previous Previous
 
Next
 Disabled
New Post
 1/26/2011 9:14 AM
 

It's possible to use SGSV to create a dynamic "google-o-meter". Here's some sample code:

select '<img src="http://chart.apis.google.com/chart?chs=300x250&cht=gom&chd=t:'+CAST(datediff(d,'1/1/2011',getdate())*100/datediff(d,'1/1/2011','6/19/2011') as VARCHAR)+'&chxt=x,y&chxl=0:|Today+('+CAST(datediff(d,'1/1/2011',getdate())*100/datediff(d,'1/1/2011','6/19/2011')as VARCHAR)+'%)|1:|Started|Complete&chtt=||Completion+Status&chts=0000FF,20">' from portals where portalid = 1

Set the module to decode HTML so the the HTML is presented correctly. In this example, a calculation is performed to determine how much time has elasped between a start and end date. The query returns one record, but in this case it is a dummy return (i.e. no value) however the HTML executes a call to the google charting tool. Normally, this tool wants a single number however by concatenating the calcuation in the HTML string, a dynamic report is possible.

For background on the charting characteristics, refer to the Google Chart API page. Thought this might be of interest to folks.

New Post
 1/26/2011 6:35 PM
 

Sweet! -- I had played with this a bit, but got busy with real life and didn't get a chance to make it work.

Thank you for sharing - I have given you a 30 day subscription that will expire on March 1,2011

I hope to have v5.10 out by Feb 7th. - will include Client Side Sorting using JQuery!! Stay tuned.

Paul.

Previous Previous
 
Next
 Disabled
ForumForumDiscussionsDiscussionsSQL Tips and Tr...SQL Tips and Tr...SGSV & Google-o-meterSGSV & Google-o-meter

Print  

  Home | Blog | Forum | Subscriptions | Free Modules | Videos   Page generated in 0.0469914 seconds.
  Copyright 2010 by TressleWorks   Terms Of Use | Privacy Statement