Manipulating a cubequery via javascript

Hi all,
I'm trying to manipulate a cubequery section via javascript within an interactive reporting document (version 11.1.1.2).
Docs are quite terse and I wasn't able to find an Object Model Map, the snippets of code are one line long and quite useless as a guide.
I have a cube with a Scenario dimension with 2006,2007 etc as children.
I can add Scenario to rows or columns of the query, but I have not found the right instruction to add a single children of the top level member to rows or columns.
Has anyone a working piece of code or, even better, a detailed description of the CubeQuery object (and of his components)?
TIA & best wishes
Gianluca

SOLVED
to add 3 members from the scenario dimension in the columns of the cubequery you can use:
ActiveDocument.Sections["Q personalizzata"].Columns.RemoveAll();
ActiveDocument.Sections["Q personalizzata"].Columns.Add("Scenario");
ActiveDocument.Sections["Q personalizzata"].Columns["Scenario"].FindAndAdd("2006",1,true,true);
ActiveDocument.Sections["Q personalizzata"].Columns["Scenario"].FindAndAdd("2007",1,true,true);
ActiveDocument.Sections["Q personalizzata"].Columns["Scenario"].FindAndAdd("2008",1,true,true);
ActiveDocument.Sections["Q personalizzata"].Columns["Scenario"].MemberSelectors["Scenario"].DisableSelection = true;
for the rows substitutes Columns with Rows
2006,2007 and 2008 are children of Scenario
apparently the top level member of the dimension has to be always present in the QueryLabel, but can be disabled if you don't need it in the results
BTW the second parameter in the FindAndAdd method could be substituted by the constant bqOlapMemberSelector, unfortunately if you use the constant instead of the value 1, you get an error message stating that the constant is not defined
Gianluca

Similar Messages

  • Manipulating a shuttle via javascript

    I'm sure someone will have done this but a quick trawl has not uncovered anything.
    I have a requirement that when a particular radio button is selected, a shuttle list is reset to only one specific value.
    Does this sound like something someone may have fathomed out before please?
    Phil

    Hi,
    I made a function to get my shuttle values :
    function get_shuttle_values(item_name) {     
         var enfants = document.getElementById(item_name+'_LEFT').childNodes;
         var liste = '';
         for (var i=0; i<enfants.length; i++) {
              if (enfants.nodeName == 'OPTION')
                   liste = liste + enfants[i].value + ':';
         if (liste.length != 0)
              liste = liste.substr(0,liste.length-1);
         return liste;
    It returns a ':' separated list of all values stored in the LEFT textarea.
    It's not what you want, but if this code can help you...
    Regards.
    Yann.

  • Uploading a File with AppleScript via JavaScript

    Hi everybody,
    being new to AppleScripting and JavaScripting I'm faced with the following problem:
    Is it possible to make AppleScript to input the path for a file to be uploaded via JavaScript? If yes, what should be the correct Path Format and how to wrap it up the JavaScript action into AppleScript? I've tried a few comands but to no success.
    On the webpage in question, there's a "Choose" button, that is defined as follows:
    <input type=​"file" class=​"gwt-FileUpload" name=​"swfFile">​
    I've been trying to use the following syntax:
    do JavaScript "document.getElementsByName('swfFile')[0].value('Macintosh HD:Users:myaccount:Desktop:Scrapbook:!动画.swf')" in document 1
    as well as this one, where the Path is definitelly understood by shellscript:
    do JavaScript "document.getElementsByName('swfFile')[0].value('/Users/myaccount/Desktop/Scrap book/!动画.swf')" in document 1
    The name of the file is (and must remain) in chinese, but for testing purposes I have also tried files with english names, without success.
    Currently I'm using a solution with JavaScript comand:
    do JavaScript "document.getElementsByName('swfFile')[0].click()" in document 1
    to click the finder  window to browse for the file, and manipulating  keystrokes by using System Events to find the right file, but it's not  infallible with a number of files and it's hardly an ellegant sollution.
    Any idea what I'm doing wrong?
    Cheers!

    @twtwtw
    the do JavaScript "document.forms[0].submit()" command didn't work, so I kept the original way of submitting by clicking the button. The submitting part works, but not the input file part.
    That's the code I used
        tell application "Safari"
            do JavaScript "document.getElementById('gwt-uid-13').value='on'" in document 1
            do JavaScript "document.forms[0].elements['swfFile'].value=" & "'" & SWFFilePath & "'" in document 1
            do JavaScript "document.getElementsByClassName('gwt-SubmitButton')[0].click()" in document 1  
            delay 1
        end tell
    with SWFFilePath set as the POSIX path as well as the default file format
    Macintosh HD:Users:myaccount:Desktop:Scrapbook:!动画.swf'
    but it did not work.
    If you've got the time, feel free to upload an .swf. The service is free and the server delats uploaded files after 15 min. (if you don't have any, you may try an empty .txt file instead - it won't get converted, but the point is just to get it into the input box).
    In the meantime, I'll have a look at adayzdone's suggestion. It's not perfect (the downside being that it requires the window to be active, so I can't run the script in the background or with my screensaver & password on), but it's still more reliable than my sollution with navigating arrowkeyes.

  • How to get elements in a multi-value field via javascript?

    The following will set variables.variable1 to variables.variable2 when the "Script Link" component is clicked...
    <Field>
    <Display class='Javascript'>
    <String>
    function myScript() {
    el=getElement(document.mainform,"variables.variable1");
    el2=getElement(document.mainform,"variables.variable2");
    el.value=el2.value;
    </String>
    </Display>
    </Field>
    <Field name='Script Link'>
    <Display class='Link'>
    <Property name='URL'>
    <String>javascript:myScript();submitCommand(document.mainform,%20'Recalculate');</String>
    </Property>
    </Display>
    </Field>
    My issue is, if variables.variabl2 is a list / multivalued, i get errors trying to traverse through the "array".
    How can i read and set an a list element via javascript function above? I've tried things like get() , and variables.variable2[0] .
    any help would be appreciated....
    is there an API somewhere i can reference?

    Hi,
    thanks for your reply!
    If I have the parameters in the URL and use the method GET it works all right.
    but I need the method to be POST. I suppose, I have the wrong way identifying the parameter name
    This is from VB
    varTarget = "http://localhost:9090/gm/getData" ' getData is my servlet
    xmlSendStr = "SQLStmt=SELECT TCPD_Cars.* From TCPD_Cars WHERE (((TCPD_Cars.CarIdent)=45));"
        xmlHttp.Open "POST", varTarget, True   'True means asynchronous
        xmlHttp.Send xmlSendStrthis is part of my Servlet
         protected void doPost(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              response.setContentType("text/html");
              PrintWriter writer  = response.getWriter();
              String SQLStmt = request.getParameter("SQLStmt") ;
            //make the database query and get the returns
            writer.println(GetSQLData(SQLStmt));
            //close the write
            writer.close();                    
         }I would appreciate any suggestions

  • Firefox 3.6 crashes or hangs when setting an iframe src to a pdf via javascript. 3.5 works fine

    Firefox hangs or crashes when setting iframe src to a pdf via javascript. Works fine in all previous versions of Firefox. This is using the most recent version of Adobe Reader 9.
    == This happened ==
    Every time Firefox opened
    == I upgraded to Firefox 3.6

    More info:
    Seems to be the same issue as this
    [http://support.mozilla.com/en-US/forum/1/585926#threadId622326]
    and this
    [http://support.mozilla.com/en-US/forum/1/585926?forumId=1&comments_threshold=0&comments_parentId=585926&comments_offset=20&comments_per_page=20&thread_style=commentStyle_plain#threadId659555]

  • Flash inserted via Javascript not working in IE.

    I am having issues viewing flash that has been inserted via
    javascript in Internet Explorer. I had to uninstall my flash about
    a week ago. I've since reinstalled flash and reinstalled flash
    player for all my browsers. All flash shows where it hasn't been
    inserted via javascript (ie. youtube.com) but javascript flash is
    not showing at all in IE. Firefox is working fine. Any help in
    resolving this issue for IE would be greatly appreciated.
    Duncan

    I'm having the same exact problem. I've uninstalled,
    reinstalled, the works. Flash works great in my alternate browser,
    Opera, but not with IE.

  • How can I add a watermark via JavaScript that includes the current datestamp?

    Part of my daily work process here is to scan in a huge stack of inbound mail. I then OCR the scans, delete the blank pages, and add a watermark. I've got a batch process set up for the first two steps, but I can't make a watermark for the datestamp itself and need to do so via JavaScript, but I have a luddite-level understanding of it.
    As of right now, these are my settings I'm using to add the datestamp:
    What I want to do is run a script to do the same thing and insert the current date where I have mm-dd-yy currently, but I don't have the first clue of where to start. Any help you could offer would be hugely appreciated

    You can use the doc.addWatermarkFromText() method as a JavaScript step in an Action.
    for example
    var dt = new Date();
    var stoday = (dt.getMonth() + 1) + '-' + dt.getDate() + '-' + dt.getFullYear();
    this.addWatermarkFromText({
    cText: "Deposit\r" + stoday,
    nTextAlign: app.constants.align.right,
    nHorizAlign: app.constants.align.right,
    nVertAlign: app.constants.align.top,
    nHorizValue: -72, nVertValue: -72
    See the SDK Help files for information on what all the parameters do.

  • Firefox 4.0 support for printing embedded PDF files in iFrames via JavaScript

    I recently upgraded to Firefox 4.0 and can no longer print embedded PDF documents contained in an iFrame.
    My company's web application has several pages which load PDF files from a Servlet into an iFrame. The pages in question all have "Print" buttons which when clicked executes a JavaScript function to obtain reference to the iframe containing the PDF, place it into focus() (e.g., frames['pdfdoc'].focus();), and invoke print() (e.g., frames['pdfdoc'].print();). There are no errors, or exceptions caught when the JavaScript function is invoked, but the "Print" button is no longer operational.
    Does Firefox 4.0 no longer support iFrames? The issue goes away if I revert back to ver 3.6.16

    I have same issue for printing embedded PDF files in iFrames via JavaScript in Firefox 5.0.
    In previous versions it was working fine. But not in Firefox 4.0/5.0.
    Is there any solution for this problem?

  • Apply watermark and then apply Flattener Preview via JavaScript

    Hello all,
    I have a bunch of PDF files which were generated from InDesign.
    Currently I am applying a watermark to all the PDFs in Acrobat XI and then a flattener preview to all of the PDFs manually one PDF at a time.
    I want to make a script which does all this.
    I also tried the Action panel, but it didn't automate the flattener preview part.
    I am comfortable with JavaScript and scripting in general.
    Any help or a pointer to resources will be appreciated.
    Thanks and regards.

    Thanks for replying.
    The flattener preview is located under "Print Production" panel. Where one can configure the text flattening options, among many other settings.
    I want to flatten the text (convert it to outlines) via JavaScript as you have suggested.
    Please suggest any sample code.
    Thanks and regards.

  • Stop player via javascript.

    I am opening a flash player into a floating div. Works almost
    perfect, except that when I close the div, the movie contines to
    play. I can hear it even though I cannot see it. Is there a way to
    stop the movie from playing via javascript when I click on the
    div's "close" button?

    hello there
    look for ExternalInterface class on flash's documentation.
    basicly it allows you to define functions in JS that call
    functions inside flash and vise versa

  • Problem obtaining BitmapData for a canvas via Javascript

    Hi,
    For my web application I have one HTML button, which is outside of flash application shown on the same page. Via Flex application I've declared callback function to be called by Javascript in this way:
    ExternalInterface.addCallback("cbProcessButton", processButton);
    For HTML button I have this:
    <input id="bSave" name="button" type="submit" value="Save" onclick="getSWF('${application}').cbProcessButton();" />
    And inital lines of processButton function (which is Flex function) are defined as this:
              var bitmapData:BitmapData = new BitmapData(canvas.width, canvas.height, false, 0xFFFFFF);
              bitmapData.draw(canvas);
              var jpgEncoder:JPEGEncoder = new JPEGEncoder(85);
              var jpgStream:ByteArray = jpgEncoder.encode(bitmapData);
    Now I have problem here. If I call that processButton in this way for my canvas via Javascript - then I get length of jpgStream as 32654 bytes and after save into a file - that jpg file cannot be shown properly.
    But if I call the same processButton via a Flex button, which is placed inside my Flex - I get jpgStream in my case of length 33074 bytes and after save to a file - could normally show it later.
    I'm using Flex Builder 3 with Flex sdk 3.5.0.12683 installed and later show everything/work via Flash Player v10,1,53,64 installed on WinXP.
    Is it known bug/limitation of BitmapData usage in such Javascript scenario? Or is it bad sdk/Flash Player? Are you able to reproduce such in your environment?
    I'm really going out of my mind to understand why lengths of encoded data in 2 cases are different. Of course I know about that 2176 Error for other situations dealing with Flex UI, but here I don't get it - so I assume my Javascript scenario is allowed by Adobe so far.
    Any help would be highly appreciated.
    Andrejus

    Thanks very much, Everybody. Here is something that works. This is based on all the inputs provided by you guys. Many thanks.
    <table>
    <td width="3%" align=right></td>
    <td align=left valign=top> <b>Existing Notes:</td>
    <TD><textarea name="existing" wrap="hard" cols="70" rows="10" onkeypress
    ="validateSize(this, 2000)" onchange="validateSize(this, 2000)" READONLY>
    <%
    int logSize = actionLog.size();
    if (logSize > 0) {
    for (int j=logSize-1; j >=0; j--){
    DealStatusAction dsa = (DealStatusAction)actionLog.get(j);
    String actionNm = dsa.getActionName();
    String actionDate = dsa.getActionDate().toString() + "";
    String memo = dsa.getMemo();
    String actionPerformer = ((dsa.getLastName() == null || dsa.get
    FirstName() ==null)?"":(dsa.getFirstName() + " " + dsa.getLastName()));
    String datePerf = actionDate + " " + actionPerformer;
    %>
    <%=datePerf%>
    <%=actionNm%>
    <%=memo%>
    <%
    %>
    </textarea>
    </TD>
    </table>

  • Accessing Properties of Individual Tool Buttons via JavaScript

    Hi all!
    I am new to both this forum and scripting Acrobat so please excuse me if the question sounds naive.
    I am trying to find a way to access the properties of individual tool buttons via JavaScript (if there is one). I could not find it yet in JS API Reference. If anybody can help me or direct me to the right way, I will greatly appreciate that.
    For example, in 'Comment & Markup' toolbar one can right-click and change the 'Tool Default Properties' of various markup tools like Highlighter, Line, Rectangle etc. Is it possible to access these properties through JavaScript so that buttons can be added for dynamically changing these? Hope this makes sense!
    Thanks in advance for your interest and help.
    John.

    Hi Andy, thanks for the answer. It was pretty simple - I just added an authorization scheme to the report column, wehre the javascript is executed. Christof

  • The status bar is blocking my content, is there a way to disable it via Javascript and the likes?

    I'm working on a site that requires a bottom footer in a fixed position, with a control button on the left hand side, my problem is, that the `new` status bar area covers this section for quite some time whilst it's requesting data, or waiting for the server, is there a way to disable it via JavaScript or some sort? It seems kind of silly for a status bar to cover your content (no offence), the old way was much nicer, sure it used more screen space, but atleast it didn't assume things. I just couldn't find a solution anywhere else, other than to move the button. :)

    You can use this extension to hide the pop-up that shows the URL of a link on hover and other data that previously appeared on the Status bar.
    *Status-4-Evar: https://addons.mozilla.org/en-US/firefox/addon/status-4-evar/
    Add code to userChrome.css below the @namespace line.
    *http://kb.mozillazine.org/userChrome.css
    *http://kb.mozillazine.org/Editing_configuration
    <br />
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    #statusbar-display { display:none!important; }
    </nowiki></pre>

  • SaveAs and maintain "optimized for web view" via javascript???

    I am trying to do a SaveAs via javascript, but I need to maintain the linearized (optimized for web view) state of the PDF.
    I would get this via the SaveAs menu item, but I need to do it silently and rename the file (replace _H.pdf with .pdf).
    Is there anything that I can read that will help me do this? I have looked through the API reference, AcrobatUsers.com, web search, etc.
    Or, if it cannot be done, stop me now.
    Here is what I am doing currently wtih help from this forum.
    XXX_DoSaveLoRes = app.trustedFunction(function()
    app.beginPriv();
    this.saveAs(this.path.replace(/\_H.pdf$/i,"") + ".pdf");
    app.endPriv();
    Thanks,

    I don't think it can be done.

  • I used firefox 3.6.14 on windows 7 x64 (firxfox x32). I found a problem when I develop my website and alert data or value via javascript , firefox hang (not response) every time. What's happend? How to solve is problem?

    I used firefox 3.6.14 on windows 7 x64 (firxfox x32). I found a problem when I develop my website and alert data or value via javascript , firefox hang (not response) every time. What's happend? How to solve is problem?
    Thank you for help
    Lohkaeo

    Oops - for some reason, this problem now seems to have gone away. May have had something to do with Flash. I'll keep my fingers crossed.

Maybe you are looking for