Topic
  • 3 replies
  • Latest Post - ‏2012-11-20T08:15:16Z by SystemAdmin
SystemAdmin
SystemAdmin
6195 Posts

Pinned topic cognos incompatible with dojo css

‏2012-11-07T07:17:48Z |
Experts,

I tried to implement a dojo tree to show the organization hierarchy for chosen as a query condition of cognos report. The tree can be shown in a drop-down button at the top of the report. Everything works fine, the report get correct data by the select value. But once I click the next page of the report, the whole page doesn't show correctly, the font size became smaller and the tree disappeared.

I am new to the cognos. Please kindly give advise.

Great thanks!
Updated on 2012-11-20T08:15:16Z at 2012-11-20T08:15:16Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    6195 Posts

    Re: cognos incompatible with dojo css

    ‏2012-11-20T03:05:18Z  
    Hi,

    Maybe you can upload a test project which can reproduce your issue here. It would help us locate your problem. =)

    If there is any db operations, you can replace them with some static test data.

    Regards,

    Smyle
  • SystemAdmin
    SystemAdmin
    6195 Posts

    Re: cognos incompatible with dojo css

    ‏2012-11-20T08:12:15Z  
    Hi,

    Maybe you can upload a test project which can reproduce your issue here. It would help us locate your problem. =)

    If there is any db operations, you can replace them with some static test data.

    Regards,

    Smyle
    Thanks for your reply.

    The content of the HTML component in a report is:

    ==============================================================
    <style type="text/css">
    @import "/p2pd/dojo15/dijit/themes/tundra/tundra.css";
    </style>

    <script type="text/javascript"
    djConfig="parseOnLoad: true, isDebug: true"
    src="/p2pd/dojo15/dojo/dojo.js"></script>

    <script type="text/javascript">
    dojo.require("dojo.parser");
    dojo.require("dijit.Dialog");
    dojo.require("dijit.form.DropDownButton");

    dojo.require("dojo.data.ItemFileReadStore");
    dojo.require("dijit.Tree");

    dojo.require("dojo.io.script");

    var treeStore;
    var treeModel;
    var myTree;
    // The parameters to pass to xhrGet, the url, how to handle it, and the callbacks.
    var jsonpArgs = {
    url: "http://localhost:8080/test/Report.txt",
    callbackParamName: "callback",
    content: {
    type: "org"
    },
    load: function(treeData){
    // Set the data from the search into the viewbox in nicely formatted JSON
    var itemData1 = treeData;

    treeStore = new dojo.data.ItemFileReadStore({
    data: itemData1
    });

    treeModel = new dijit.tree.ForestStoreModel({
    store: treeStore,
    rootId: 'rootID',
    rootLabel: 'SiChuan',
    query: {name : '999999999999'}
    });

    // Look up the node we'll stick the text under.
    myTree = new dijit.Tree({
    model: treeModel,
    showRoot: false,
    id: 'objTree',
    label: 'SiChuan',
    onClick: onTreeItemSelected
    });

    myTree.placeAt("treeContainer");
    myTree.startup();
    },
    error: function(error){
    alert("An unexpected error occurred: " + error);
    }
    };

    function onTreeItemSelected(item) {
    dojo.byId('orgBtn_label').innerHTML = treeStore.getLabel(item);
    var form = getFormWarpRequest();
    form._textEditBoxPBranchTree.value = item.name;
    dijit.popup.getTopPopup().onExecute();
    };

    function initOrgTree(){
    dojo.io.script.get(jsonpArgs);
    }
    dojo.ready(initOrgTree);
    </script>


    Org

    ==============================================================

    You can see that I use a tooptips to dynamically show the org tree, once the org is selected,
    assign the value to a report condition field named "PBranchTree":

    var form = getFormWarpRequest();
    form._textEditBoxPBranchTree.value = item.name;

    You can use the above code in any sample report, as long as there are enough data in the report and you can use the "next page".

    Actually, the DropDownButton can not be show correctly once the "next page" clicked. You can to show the tree value by comment the init function :

    //dojo.ready(initOrgTree);

    And I also attached the data for you to show what I wanted. (make url: "http://localhost:8080/test/Report.txt" works)

    =====================================================================
    dojo.io.script.jsonp_dojoIoScript1._jsonpCallback({
    identifier: 'name',
    label: 'label',
    items: [{
    name: '999999999999',
    label: 'SiChuan Cooperation',
    children: [{
    name: 'D00000000000',
    label: 'SiChuanCooperation',
    children: [{
    name: 'DSCCD0000000',
    label: 'Cd Branch',
    children: [{
    name: 'xxxxxx010101',
    label: 'Cd Branch Lo'
    },
    {
    name: 'xxxxxx010102',
    label: 'Cd Branch Qings'
    },
    {
    name: 'xxxxxx010201',
    label: 'Cd Branch Yingy'
    },
    {
    name: 'xxxxxx020101',
    label: 'Cd Branch Hangk'
    },
    {
    name: 'xxxxxx030101',
    label: 'Cd BranchShuangl'
    },
    {
    name: 'xxxxxx040101',
    label: 'Cd Branch Inte'
    }]
    }]
    },
    {
    name: 'S00000000000',
    label: 'Shifang branch',
    children: [{
    name: 'SSCDYX030101',
    label: 'Shifang branch Local'
    },
    {
    name: 'yyyyyy030102',
    label: 'Shifang branchQings'
    },
    {
    name: 'yyyyyy030201',
    label: 'Shifang branchYingy'
    },
    {
    name: 'yyyyyy030202',
    label: 'Shifang branchyongzh'
    },
    {
    name: 'yyyyyy030203',
    label: 'Shifang branchshigu'
    }]
    }]
    }]
    })
    =====================================================================

    Appreciate your further comments!

    Attachments

  • SystemAdmin
    SystemAdmin
    6195 Posts

    Re: cognos incompatible with dojo css

    ‏2012-11-20T08:15:16Z  
    Hi,

    Maybe you can upload a test project which can reproduce your issue here. It would help us locate your problem. =)

    If there is any db operations, you can replace them with some static test data.

    Regards,

    Smyle
    Attached the source code in file here