Stump the Panel » End Users and Information Workers

Visual Status Field

(10 posts)
  1. DWM
    Member

    I've duplicated the script for the calculated field called "Visual Status" that was shown on the 6/29 Dashboard Indicator ScreenCast. I keep getting a sytax error -- Can you possibly tell me where I'm wrong on this?

    =”<DIV Style=’background-color:#CC0000;’><DIV style=’background-color:#333333;
    width:”&([% Complete]*100) & “%;’> </DIV></DIV>”

    I have the " % Complete" field already added as well.

    Thanks in advance for your time and assistance.

    Posted 1 week ago #
  2. See if this does it for you:
    =CONCATENATE(="<DIV Style='background-color:#CC0000;'><DIV style='background-color:#333333; width:",([% Complete]*100), "%;'> </DIV></DIV>")

    Posted 1 week ago #
  3. david m
    Member

    Thank you for the reply Eric. I tried your solution and got: "The formula contains a syntax error or is not supported."

    Can you offer a plan "B" that I might try?

    Thanks again.

    Posted 3 days ago #
  4. Whoops, try removing the = after the opening parenthisis. Sorry about that.

    =CONCATENATE("<DIV Style='background-color:#CC0000;'><DIV style='background-color:#333333; width:",([% Complete]*100), "%;'> </DIV></DIV>")

    Posted 3 days ago #
  5. david m
    Member

    Hello Eric,

    That Worked! -- Thank You so much. Now I can work on the CEWP script.

    Hopefully that will go with no problems. If not I hope you don't mind if I ask for your assistance again.

    Very Best Regards

    David

    Posted 3 days ago #
  6. Not a problem, I've deployed the solution so I can assist if needed.

    Posted 3 days ago #
  7. david m
    Member

    Hello Eric,
    I'm going to take you up on your offer. And Thank You.
    I've got the "visual Status" column up ( as above).
    I've loaded up the following script in the CEWP source Editor:

    <script type=”text/javascript”>
    //ORIGINAL CONCEPT, CHRISTOPHE HUMBERT
    //
    // Convert HTML text to Graph in SharePoint Calculated Column
    // Author: Christophe Humbert
    // Site: http://pathtosharepoint.wordpress.com/
    // Feedback and questions: [email protected]
    //
    var theTDs = document.getElementsByTagName(“TD”);
    var 1=0;
    var TDContent = “ “;
    while (1 < the TDs.length)
    {
    try
    {
    TDcontent = the TDs [1] . innerText | | the TDs [1] . textContent;
    if ((TDContent.indexOf(“<DIV”) == 0) && (TDcontent.indexOf
    (“</DIV>”) >= 0)) {
    theTDs [1] . innerHTML = TDContent;
    }
    }
    catch (err) { }
    1=1+1;
    }
    </script>

    <script type=”text/javascript”>
    // TURN OFF FILTERING – PAUL GRENIER
    //
    // Turn Off Filtering Capabilities in Specific Columns
    // Author: Paul Grenier, AutoSponge, Administrator: Stump the Panel
    // Site: http://autosponge.spaces.live.com/default.aspx
    // Feedback and questions:
    http://www.endusersharepoint.com/STP/topic.php?id=345&page=2
    //
    _spBodyOnLoadFunctionNames.push(“filterOff”);

    function filterOff ( ) {
    var a = [‘Visual Status’ , ‘High Priority’];
    var tags = document.getElementsByTagName(“TABLE”) ;
    for (var 1=0; 1 < tags.length; 1++) {
    if (tags [1] . textContent) {
    var name = tags [1] . textContent;
    }else{
    var name = tags[1] . innerText; //for IE
    }
    if (name in oc(a)){
    tags[1] .setAttribute(“Filterable”,”FALSE”);
    }
    }
    }
    function oc(a)
    {
    var o = {};
    for(var 1=0;1<a.length;1++)
    {
    o[a[1]]=’’;
    }
    return o;
    }
    </script>

    and I'm showing text on my list still (no graph).

    If possible, can you take a moment to see if my script is correct or is there something else I need to add?

    Thank You so much.

    dave m.

    Posted 3 days ago #
  8. That script doesn't look anything like the text2html script I have. I've looked at my implementation and have the following:

    <script type="text/javascript">
    //make a fn for reuse
    $.calcHTML = function() {
    //loop through TDs moving text node to html
    $("td.ms-vb2,td[id$='Calculated'],td.ms-stylebody,td.ms-formbody").filter(":contains(<DIV)").each(function(){
    $(this).html($(this).text());
    });
    };
    //call calcHTML on DOM ready for ungrouped rows
    $(function() {
    $.calcHTML();
    if (showpreview1) { //check for preview script
    $("td.ms-vb-title").bind("mouseover", function(){
    showpreview1(this);
    $.calcHTML();
    });
    }
    });
    //replace ExpGroupRenderData, call calcHTML for grouped rows
    function ExpGroupRenderData(htmlToRender, groupName, isLoaded) {
    $("#tbod"+groupName+"_").attr("isloaded",isLoaded).html(htmlToRender).show("fast",$.calcHTML());
    }
    </script>

    Posted 3 days ago #
  9. david m
    Member

    Hi Eric,

    Again, thanks for the reply - its great working with you. I applied the script you sent and am still getting text only.

    Is this script for: "How to Convert HTML text to Graph in SharePoint Calculated Column"?

    Thanks

    Dave M

    Posted 3 days ago #
  10. david m
    Member

    Hello Eric,

    I THINK I GOT IT!!!

    Couldn't have done it without you.

    Thank you so much.

    Dave M

    Posted 3 days ago #

RSS feed for this topic

Reply

You must log in to post.