Facility Control

 View Only
  • 1.  Button labels and excel

    Posted 10-27-2014 23:18
    I am trying to create a control page where the button label test will be driven by an excel spreadsheet.

    This spreadsheet will have agenda item numbers in one column and the item test in the next. This spread sheet would drive the text in the lower 3rds thru xpression as well.

    In the end pressing a button (labeled with the item number) would load that item text to a template in a preview window. where it can be checked before it is taken to air.

    Any help would be appreciated.


  • 2.  RE: Button labels and excel

    Posted 10-28-2014 03:00
    Dashboard does not support the use of excels. It does take in XML files though, as does Xpression. Renaming the buttons is relatively simple once you get the texts, it is accomplished through the use of the ogscript.rename('[id]', '[name]') method. id is the text you put into the id of the button or anything else in dashboard. name is the value to be assigned.

    #DashBoard


  • 3.  RE: Button labels and excel

    Posted 10-28-2014 17:56

    Hi George.

    Here is a fairly complete example that loads 3 columns from an Excel spreadsheet saved in "XML Spreadsheet 2003" format. it loads the columns into a table and creates a list of buttons using column 2 as their text.

    Not Loaded
    
                param.col1
    
                param.col2
    
                param.col3
    
                //ASSUME EXCEL DOCUMENT IS SAVED IN "XML Spreadsheet 2003" FORMAT
    
    var xmlDocument = ogscript.parseXML('excel.xml');
    
    var rows = ogscript.runXPath('//*[local-name()=\'Row\']', xmlDocument);//Row
    
    var col1 = new Array();
    
    var col2 = new Array();
    
    var col3 = new Array();
    
    ogscript.debug('Returned ' + rows.getLength() + ' rows');
    
    for (var i = 0; i < rows.getLength(); i++)
    
    {
    
       var cells = ogscript.runXPath('./*&#91;local-name()=&#92;'Cell&#92;'&#93;', rows.item(i));//Cell
    
       if (cells.getLength() >= 3)
    
       {
    
          col1&#91;i&#93; = cells.item(0).getTextContent(); //column 1
    
          col2&#91;i&#93; = cells.item(1).getTextContent(); //column 2
    
          col3&#91;i&#93; = cells.item(2).getTextContent(); //column 3
    
       }
    
    }
    
    params.setAllValues('param.col1', col1);
    
    params.setAllValues('param.col2', col2);
    
    params.setAllValues('param.col3', col3);
    
    //Create choice constraint for 'selecton button'
    
    var choiceConstraint = params.createIntChoiceConstraint(col2);
    
    params.replaceConstraint('param.selection', choiceConstraint);
    
                true
    
                50
    
                   var selection = this.getValue();
    
    if (selection >= 0)
    
    {
    
       var itemText = params.getValue('param.col3', selection);
    
       if (itemText != null)
    
       {
    
          params.setValue('param.selectedItemText', 0, itemText);
    
       }
    
    }

    #DashBoard