SpagoBI Javascript SDK - Parameters not working

261 Views Asked by At

I am using sbisdk-all-production.js to integrate SpagoBI cockpit in external web-app.
Following is the code snippet I am using to load cockpit in web-app:

var url = Sbi.sdk.api.getDocumentUrl({  
            documentLabel: 'cockpit__xxxxxx'  
            // The document label.  
            , executionRole: '/spagobi/user'  
            , parameters: {par_clientId : 3}  
            , displayToolbar: false  
            , displaySliders: false  
            , height: '600px'  
            , width: '100%'  
            , iframe: {  
                style: 'border: 0px;'  
            }  
        });
document.getElementById('spagoCockpitIframe').src = url;

Cockpit is getting displayed.
But when parameters are passed through JavaScript api Sbi.sdk.api.getDocumentUrl then parameters are getting ignored.
I am stuck over this issue since 3 days. Can anyone give some pointers?

1

There are 1 best solutions below

1
MMAARR On

You can try to write the following

parameters: {'PARAMETERS': 'par_clientId=3'}

Example

var url = Sbi.sdk.api.getDocumentUrl({  
  documentLabel: 'cockpit__xxxxxx', 
  executionRole: '/spagobi/user', 
  parameters: {'PARAMETERS': 'par_clientId=3'},
  displayToolbar: false,  
  displaySliders: false, 
  height: '600px',
  width: '100%',
  iframe: {
    style: 'border: 0px;'  
  }  
});

document.getElementById('spagoCockpitIframe').src = url;