Sjenkins Posted August 17, 2007 Report Share Posted August 17, 2007 Testing DEMO. [:S] Instead of having 4 digital gadgets I wanted to create one gadget with four InnerDigitalPanels.. I can do so but how do I set the value of each? I want each inner gadget to be a different SQL select statement.. Quote Link to comment Share on other sites More sharing options...
JuanC Posted August 17, 2007 Report Share Posted August 17, 2007 Unfortunately the only way to "bind" individual properties (in this case InnerDigital values but it really applies to other properties as well) requires Powershell although there is a trick that will allow you to use the PowerGadgets Creator UI later to customize the visual attributes. 1) Write a powershell script that collects the data you need from different SQL statements into an object. This will be your data layer :-) $count = (invoke-sql -Server YourServerName -Database YourDatabaseName -SQL "SELECT Count(*) as MyCount FROM Movies").MyCount$quantity = (invoke-sql -Server YourServerName -Database YourDatabaseName -SQL "SELECT SUM(Quantity) as Quantity FROM Movies").Quantity $obj = new-object System.Objectadd-member -inputobject $obj -membertype NoteProperty -Name Count -value $countadd-member -inputobject $obj -membertype NoteProperty -Name Quantity -value $quantity$obj 2) Create a PowerGadgets template (not a PGF) with as many inner gauges as needed. Note that to move an inner gauge you will need to set its Layout.Target to AnchorPoint so that you can move it around using Layout.AnchorPoint out-gauge -config 3) Pipe the data returned by your script to a gauge that uses the previously saved template C:\Scripts\dbdata.ps1 | out-gauge -value Count -template InnerDigital -InnerGauges_0_DigitalPanel_Value {$_.Quantity} If you already use Powershell at this point you can customize your template and possibly save the previous command in a separate script. If you want to use PGF files so that you can simply double click and run, you can use the following trick - Run the gauge command and press "Ctrl-C" when the gadget window has the focus- Run the Powergadgets Creator and press "Ctrl-V" a new gadget will be added that uses powershell as the data provider and has the additional links between the inner digital and the extra properties- Remove the empty item present in your gadget (Edit - Previous) and then (Edit - Delete) You can see an explanation of this feature on this blog post Regards, JuanC Quote Link to comment Share on other sites More sharing options...
Sjenkins Posted August 17, 2007 Author Report Share Posted August 17, 2007 cool thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.