Execute MenuItem

Dear all,
I need to automate the comment enabling ("Comments->Enable for commenting in Adobe Reader") using Acrobat 8.0 in windows(operating system).  Kindly help me how to automate that process through javascript or vbscript without manual interaction.
I used the below code:-
app.execMenuItem("Annots:ReaderEnable");
After execution of the above code the "Save As" window appered. But i dont know how to control that window through programmatically. Kindly advice me how to solve this through coding.
Thanks

You can automate this with the Adobe LiveCycle Reader Extensions ES software:
http://www.adobe.com/products/livecycle/readerextensions/

Similar Messages

  • How to change annotation's appearance  when printing the annotation under Adobe Reader?

      I'm developping a plugin under SDK 7.0 for Adobe Reader  . I have two problems.
      1)I will change annotation's appearance  when printing the annotation. How to do under Adobe Reader?
        Uunder Adobe Arobat,I use PDRegisterAnnotHandler to register GetPrintAppearance,but PDRegisterAnnotHandler does not work under Adobe Reader.
      2)Under Adobe Reader ,app.execMenuItem doesnt work.How to execute menuItem using JavaScript under Adobe Reader?
    Please Help,had better give me sample,thank.

    app.execMenuItem most certainly does work with Reader - what problems are you running into trying to use it?
    As for developing Reader plug-ins - yes, some of the SDK methods aren't available to Reader.  If you want to change the appearance of an annotation in Reader, you would need to acquire the Cos object of that annotation and modify its appearance dictionary manually.

  • Error while executing the midlet ----pleasehelp

    Hi everyone,
    I am new to webservices, I am trying to execute a webservice from a midlet. Iam getting the below error.
    java.lang.NoClassDefFoundError: org/kxmlrpc/XmlRpcClient
         at kxmlrpc_demo.commandAction(+49)
         at javax.microedition.lcdui.List.callKeyPressed(+80)
         at javax.microedition.lcdui.Display$DisplayAccessor.keyEvent(+198)
         at javax.microedition.lcdui.Display$DisplayManagerImpl.keyEvent(+11)
         at com.sun.midp.lcdui.DefaultEventHandler.keyEvent(+121)
         at com.sun.midp.lcdui.AutomatedEventHandler.keyEvent(+210)
         at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+178)
    Below is my midlet code.
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.io.*;
    import java.io.*;
    import java.util.*;
    import org.kxmlrpc.*;
    public class MyMidlet extends MIDlet implements CommandListener {
         private List list;
         private Command exitCommand;
         private String[] menuItems;
         private Display display;
         private Alert response;
         private XmlRpcClient xmlrpc;
         private Vector params, xmlArray;
         public MyMidlet() {
              // Initialize the User Interface
              menuItems = new String[] { "Timestamp", "Randomizer", "AddressBook" };
              list = new List("Select a service", List.IMPLICIT, menuItems, null);
              exitCommand = new Command("Exit", Command.EXIT, 1);
              response = new Alert("Service Return", null, null, AlertType.INFO);
              response.setTimeout(Alert.FOREVER);
              // Add commands
              list.addCommand(exitCommand);
              list.setCommandListener(this);
              // obtain a reference to the device's UI
              display = Display.getDisplay(this);
         }// end MyMidlet()
         public void startApp() {
              display.setCurrent(list);
         }// end startApp()
         public void pauseApp() {
         }// end pauseApp()
         public void destroyApp(boolean bool) {
              // clean up
              list = null;
              exitCommand = null;
              display = null;
         }// end destroyApp
         public void commandAction(Command com, Displayable dis) {
              if (dis == list && com == List.SELECT_COMMAND) {
                   switch (list.getSelectedIndex()) {
                   case 0:
                        try {
                             xmlrpc = new XmlRpcClient(
                                       "<a href=http:// www.wsjug.org/servlet/XmlRpcServlet EUDORA=AUTOURL> http:// www.wsjug.org/servlet/XmlRpcServlet/a>");
                             params = new Vector();
                             String serverTime = (String) xmlrpc.execute(
                                       "sysTime.getSystemTime", params);
                             response.setString(serverTime.toString());
                             display.setCurrent(response);
                        } catch (Exception ex) {
                             response.setString(ex.toString());
                             ex.printStackTrace(); // DEBUG
                             display.setCurrent(response);
                        }// end try/catch
                        break;
                   case 1:
                   case 2:
                        response.setString("Please download the full sample code");
                        display.setCurrent(response);
                        break;
                   }// end switch( list.getSelectedIndex() )
              } else if (com == exitCommand) {
                   destroyApp(true);
                   notifyDestroyed();
              }// end if( dis == list &&
              com = List.SELECT_COMMAND;
         }// end CommandAction( Command, Displayable )
    }// end MyMidlet
    I think the problem here is with the kxml.jar file which I have placed every where I find the lib folder. Could anyone please tell me where to exactly place the kxml.jar file?
    I am using Myeclipse IDE.
    Please help.
    Thanks in advance.
    Regards,
    Bharat Kumar

    Hi Vamsi.
    The exactly erro refers to a problems when you try upgrade from these version to 11.5.10.
    Can you read this note and apply solution? The note refers a patch, but the problem is the same.
    After Patch 4334965, adstrtal.sh & adstpall.sh is failing with errors [ID 360046.1]
    BR Rafael Ceolim

  • Swap task flow in dynamic region from menuitem in menubar

    Hello,
    I have a dynamic region and two task flows. I have action listeners that swap the task flows into the dynamic regions. When these action listeners are tied to buttons, everything works as expected, but if i attach them to menuitems on a menubar, despite the fact the the listener is executed (based on log file debugging), the task flow in the region does not change.
    Can anyone please give me an idea why, and exactly how someone can swap a task flow in a dynamic region from a menuitem.
    I'm using Jdeveloper 11.1.1.0.1
    Thanks
    Edited by: fakintoy on Apr 22, 2009 3:45 PM
    Edited by: fakintoy on Apr 22, 2009 3:46 PM
    Edited by: fakintoy on Apr 22, 2009 4:06 PM

    Hi,
    My guess is that the region is not added to the list of partial targets. Add a partialTrigger on the region pointing on the menu item.
    p.s. Code snippet would really help to get a more precise answer here
    Regards,
    ~ Simon

  • Executing an actionlistener in separate class

    Hi all,
    This is my first question on the Java forum. Hope I express myself clearly and I hope that someone can help me.
    I have created two classes (i.e. modified files that I found in Java books) - one which creates the user interface using JFrame (a text field and menu structure) and a second class which is basically the action listener for when the "menuFileLoad" button is pressed in the application.
    I would like to move the code for all "actionlisteners" to separate classes to make the code more transparent.
    I've moved the code for the action listener for the "menuFileLoad" button to the separate class "alistener".
    The code compiles well, but the action in the alistener class is not performed. It should put "Another text" in a text field. For test purposes, I've also put
    "System.out.println ("dada");" in the action listener and this is executed well.
    Has it something to do with the accessibility of the "TextField" ?
    This is the class that builds up the GUI
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.Object;
    import java.awt.Container;
    import javax.swing.JFileChooser;
    * Sample application using Frame.
    * @author
    * @version 1.00 08/09/10
    public class Getstring_ArrayFrame extends Frame {
         * The constructor.
         public TextField text = new TextField(20);
         public Getstring_ArrayFrame() {
            MenuBar menuBar = new MenuBar();
            Menu menuFile = new Menu();
            MenuItem menuFileExit = new MenuItem();
            MenuItem menuFileLoad = new MenuItem();
            MenuItem menuFileParse = new MenuItem();
            Menu menuFileTwo = new Menu();
            MenuItem menuFileDo = new MenuItem();
            menuFile.setLabel("File");
            menuFileExit.setLabel("Exit");
            menuFileLoad.setLabel("Load");
            menuFileDo.setLabel("Import Tool");
            menuFileParse.setLabel("Parse");
            menuFileTwo.setLabel("Tools");
            add(text);
            // Add action listener.for the menu button
            menuFileExit.addActionListener
                new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        Getstring_ArrayFrame.this.windowClosed();
    // DIT IS HEM - DE EERSTE ECHTE ACTION LISTENER
           menuFileLoad.addActionListener (new alistener ());
               // new ActionListener() {
                 //   public void actionPerformed(ActionEvent e) {
                   // text.setText ("Eerste tekstje, joepie. Misschien nu nog den xml erbij krijgen");
                   // text.setBackground(Color.black);
                   // text.setForeground(Color.white);
    menuFileParse.addActionListener
                new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                    text.setText ("Opnieuw een tekstje, met tevens ook al een nieuwe knop.");
                    //text.setBackground(Color.black);
                    // text.setForeground(Color.white);
            menuFile.add(menuFileExit);
            menuFile.add(menuFileLoad);
            menuFile.add(menuFileParse);
            menuFileTwo.add(menuFileDo);
            menuBar.add(menuFile);
            menuBar.add(menuFileTwo);
            setTitle("Getstring_Array");
            setMenuBar(menuBar);
            setSize(new Dimension(400, 400));
            // Add window listener.
            this.addWindowListener
                new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
                        Getstring_ArrayFrame.this.windowClosed();
         * Shutdown procedure when run as an application.
        protected void windowClosed() {
             // TODO: Check if it is safe to close the application
            // Exit application.
            System.exit(0);
    }==> This is the alistener class
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.Object;
    import java.awt.Container;
    import javax.swing.JFileChooser;
    public class alistener implements ActionListener {
         TextField text = new TextField(20);
    public alistener () {
    public void actionPerformed(ActionEvent e) {
                  System.out.println ("dada");
                   text.setText ("Another text.");
                   text.setBackground(Color.black);
                   text.setForeground(Color.white);
    }

    I don't know AWT, just Swing, but it appears that your listener needs a reference to the GUI which may be passed perhaps in the Listener's constructor, and the GUI needs public methods to allow the listener to change things -- but to limit this ability so as not to compromise encapsulation. This should work the same with AWT For instance:
    import java.awt.Color;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JComponent;
    import javax.swing.JTextField;
    public class SwingTest
      private JPanel mainPanel = new JPanel();
      private JTextField textfield = new JTextField(20);
      public SwingTest()
        textfield.setEditable(false);
        JButton testListenerBtn = new JButton("Test Listener");
        testListenerBtn.addActionListener(new SwingTestListener(this));
        mainPanel.add(textfield);
        mainPanel.add(testListenerBtn);
      // public methods to allow the listener to change things,
      // but limit this ability to only what we want to let it change
      public void textfieldSetText(String text)
        textfield.setText(text);
      public void textSetBackground(Color color)
        textfield.setBackground(color);
      public void textSetForeGround(Color color)
        textfield.setForeground(color);
      public JComponent getComponent()
        return mainPanel;
      private static void createAndShowUI()
        JFrame frame = new JFrame("SwingTest");
        frame.getContentPane().add(new SwingTest().getComponent());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      public static void main(String[] args)
        java.awt.EventQueue.invokeLater(new Runnable()
          public void run()
            createAndShowUI();
    import java.awt.Color;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    public class SwingTestListener implements ActionListener
      private SwingTest swingtest;
      public SwingTestListener(SwingTest swingtest)
        this.swingtest = swingtest;
      public void actionPerformed(ActionEvent arg0)
        swingtest.textfieldSetText("This Listener works!");
        swingtest.textSetBackground(Color.black);
        swingtest.textSetForeGround(Color.white);
    }Edited by: Encephalopathic on Nov 5, 2008 12:27 AM

  • Execute Saved Query in Business One

    Hi,
        We have the following functionality in one of our addons :
    User can associate saved queries in B1 with any window in B1 and execute via a right click menu.
    this is how we have written code to do this:
    1. user clicks menu to exeute query from any window (e.g. BP window)
    2. addon "programatically" scans the menu name under Tools >> Queries >> User Queries >> User defined Categories till it gets to the menu name specified
    3. Gets the menu id of the query and fires a menu click event.
    As you may know already the menu id's "User Defined Categories" in B1  change dynamically every time a user logs in. Majority of the time the menu id for user categories is a 6-9 digit positive number.
    However sometimes one of the user categories is a 10 digit -ve number. In this case the logic that we I have laid out above breaks when it gets to the user category with the -ve menu id. When this happens,  the final result is that the query is not executed and the user cannot see the results.
    This has been a recent development that I have seen only on 2007 environments. On some machines this never happens and on some it happens very rarely (1 in 25-30 times the user logs on). But recently we came across a machine (one of our test machines where this happens 1 in 3 times when the user logs on).
    We have tried to recreate this -ve 10 digit menu id by prorgamtically adding it to the menu structure via the xml file but the menu id does not show up in the SAP menus.
    So I m hoping you can help me with 2 things:
    1. Ideas on how get a query's menu id differently than the logic I laid out above.
    2. This looks like an SAP issue since it doesnt let me add the menus via the UI API. any thoughts on that?
    I really appreciate if anyone can help me out with this.
    Thanks,
    Gopal

    Gopal>
    We use the following code to get to a specific query based on is id in the database (The code use a few wrapped UI and DI-methods but I think you will understand)
    B1Recordset rsUserQueryData = new B1Recordset("SELECT T0.QName, T1.CatName FROM OUQR T0 JOIN OQCN T1 ON T0.QCategory = T1.CategoryId WHERE T0.IntrnalKey = '" + targetMenuUidOrParam + "'");
                                if (rsUserQueryData.RecordCount > 0)
                                    string name = rsUserQueryData.GetValueAsString("QName");
                                    string category = rsUserQueryData.GetValueAsString("CatName");
                                    B1MenuItem miUserqueries = B1MenuItem.GetMenuItem(SBO.ID.Topmenu.Tools.Queries.UserQueries._UID);
                                    for (int i = 0; i < miUserqueries.SubMenus.Count; i++)
                                        if (miUserqueries.SubMenus.Item(i).String == category)
                                            B1MenuItem categoryHeader = new B1MenuItem(miUserqueries.SubMenus.Item(i));
                                            for (int j = 0; j < categoryHeader.SubMenus.Count; j++)
                                                if (categoryHeader.SubMenus.Item(j).String == name)
                                                    B1MenuItem.ActivateMenuItem(categoryHeader.SubMenus.Item(j).UID);
                                                    return;
                                    Notification.StatusbarError(Language.GetString("MI_ERROR"));
    >Yatsea Li
    It is not correct that you only can add your own menus into the Module menuitem... You can place new menuitems anywhere in the menu-structure... Only limitation is that you can't add a new root menuitem (on level with File, Edit...)

  • MenuBar component - probs with menuitem heights

    Hi all,
    I'm new here and relatively new to Flash - I hope my question
    doesn't seem too silly for pros ;)
    I posted my problem in the ActionScript.org Forums but didn't
    get an answer so please excuse my cross-posting...
    In my application (fla-file executed as projector) I want to
    include a menubar with different menuitems, submenus etc. I have a
    xml-file with some menuitems and add some menuitems dynamically
    during runtime. That works so far: my menubar is visible with the
    menuitems it should have. (BTW (if that's important): I use the
    Sample-Theme.)
    Since the application should be used by older people or
    handicapped persons, I have to use a bigger fontSize than the
    default 10pt. But when I change the fontSize, the cellheights of
    the menuitems are too small (tails of the letters aren't
    displayed).
    So how can I change the height of the menuitems that
    everything is displayed correctly?
    Any suggestions? Did anybody have the same or a similar
    problem before and knows how to solve it or to work around?
    If there are any questions just ask...
    Perhaps you can find a mistake in my code below (it's not my
    original code because the menu is created dynamically with xml, but
    I don't think that my problem is dependent on that part ):
    ---

    You might want to ask on the Flash Builder forum.

  • Executing saved query in B1

    Hi,
       Is it possible to execute a saved query in B1 or a formatted search from an addon.
    Appreciate your help.
    Gopal

    1. Every saved query get a menuitem... See Tools > Queries > User Queries (These are menuitems are dynamic but it might work)
    2. Regarding formatted searches you can activate a formatted search by setting focus of the field containing the search and make a send-keys (sboApplication.SendKeys("+");)

  • Adding actionlistener to menuItem

    hi...i'm trying to add an actionListener to a menuItem. i looked at the tutorial on "how to use menus" but i cant seem to execute the menuitem. here's my code...
    public class Controller implements ActionListener
        GUI gui;
        public Controller(GUI g)
            gui = g;
            gui.menuItem.addActionListener(this);
        public void actionPerformed(ActionEvent e)
            gui.menuItem = (JMenuItem)(e.getSource());
            if (gui.menuItem.getText().equals("New Database"))
                System.out.println("Hello");
    }where the class GUI is where the menItems have been added to the menus. i'm just trying out for one menuItem first but i wont get the "hello" printed on the screen...can someone give me some assistance on this given that i havent used JMenuItems before...thx in advance...

    As carnickr said we really need the source from GUI to be able to help you more. Even without looking at GUI it's apparent that you're methodology is lacking. Depending on design and requirements I can think of many different ways you might need to handle menu item actions. I can't think of a single one that would involve comparing the text, which is what you're doing.
    First of all, adding a listener to a public field of a different class is inherently the product of a flawed design or bad design itself. Your code should look more like this:
    JMenuItem newDatabase = new JMenuItem("New Database");
    JMenuItem openDatabase = new JMenuItem("Open Database");
    JMenuItem closeDatabase = new JMenuItem("Close Database");
    ActionListener listener = new ActionListener() {
         public void actionPerformed(ActionEvent e) {
              if (e.getSource() == newDatabase) {
                   System.out.println("New database clicked");
              } else if (e.getSource() == openDatabase) {
                   System.out.println("Open database clicked");
              } else fi (e.getSource() == closeDatabase) {
                   System.out.println("Close database clicked");
    newDatabase.addActionListener(listener);
    openDatabase.addActionListener(listener);
    closeDatabase.addActionListener(listener);Obviously an anonymous class is not always appropriate. The important thing here is that you're comparing the reference to see if it's the same Object, not trying to compare the text. If you post GUI and a little more about what you're trying to do we can try and give you some pointers on how to design it better.

  • Bean executed twice - while calling and exiting the web page

    Hi,
    I have a .jsp file that displays the backend data table contents using a DataTable tag. When the page containing this is selected, this executes the bean and displays the results. This is fine. But when we exit from that page and go to the next page (that is select a menu to go to the next page), the bean in the first page is getting executed again (during the exit of that page). Not sure why the bean is executed during the exit of the page. Can you please help me understand this.
    Thanks
    Aish

    Hi Baluc,
    Thanks for responding. I am using JSF and RichFaces for my development. I am using their menuitem to display the menus and the navigation is controlled by menuItem component of jsf. Just by selecting a menu Item, I navigate to the screen. I need to read and find out if that menuItem submits the form.
    Even in submitting a form, why would a program commands are executed while exiting that program before going to the new program? (why sqls are run again the existing program before moving on to the new program) Please help me in understanding this concept.
    Thanks
    Aish

  • Menuitems

    created a common menu with menuitems in it. adding this to the Dialog it works fine. but when added the same to the JFrame. when clicked o nthe menu item nothing happens.
    any suggessions what should I check for ? Thanks.

    the popup menu is visible only thing is that the action on it is not getting executed.
    any suggestions?

  • Error while executing a DTP

    Hi All ,
    I got  an error while executing a DTP. Short Dump analysis points this error. :   DBIF_REPO_SQL_ERROR.
    Please provide in your valuable inputs to resolve this error.
    Thank & Regards,
    Rohit Garg

    This error comes majorly when you have a deadlock in  your code. Check ST22 if you have any short dump corresponding to it and see the source code where it is getting stuck.
    If you find this dump explaining table space issue, then contact Basis, they will be able to help you with table space problem.
    Edited by: Deepmala Agarwal on Aug 18, 2009 7:40 AM

  • Built-in: Execute procedure - delete statement

    Hi,
    I am trying to delete rejected invoices from AP_INVOICES_INTERFACE and AP_INVOICE_LINES_INTERFACE tables each time form is opened. I am not developer so I have not access to form design, but I am allowed to use forms personalization, however I am really suprised by behaviour of this.
    Below code is triggered when form is opened:
    delete from ap_invoice_lines_interface where invoice_id in (select invoice_id from ap_invoices_interface where (source = 'INTERCOMPANY2' or source = 'AGENCY COMMISSIONS') and description like '%Agency%Commissions%' and org_id = 63 and status = 'REJECTED')
    and second proc:
    delete from ap_invoices_interface where (source = 'INTERCOMPANY2' or source = 'AGENCY COMMISSIONS') and description like '%Agency%Commissions%' and org_id = 63 and status = 'REJECTED'
    I had to put them in separate actions as I was receiving error when I had them in one statement together, however this is completly different story. My problem is that althought these invoices are not visible when I open Quick Invoices form (this is were personalization is applied), when I go to other form showing interface invoices, but without this personalization I still can see them. I had similar problem when I was actually executing update statement, however when I have chosen to create invoices with Payables Open Interface (when did not and closed the form values were going back to previous state) it was updating the values to the ones changed.
    Anyone has any idea what is wrong here?

    I just want to delete (or remove) it from the VO. Data for this VO is not on the database.
    The function is doing what I want it to do (delete from the VO), its just always deleting the first row, versus the selected row. I select the command button next on a column next to an item further down in the list and it deletes the first row. The problem is setting the selected row to be removed - I thought setting the current row would be taken care of by the SelectListener?
    selectionState="#{bindings.MyIspListView1.collectionModel.selectedRow}"
    selectionListener="#{bindings.MyIspListView1.collectionModel.makeCurrent}"

  • Dynamic CRM 2013 Online how to execute Report, generate PDF and email

    Dear All,
    I am using Dynamic CRM 2013 online. For quote, I have workflow and Dialogue processes for review process. On approval, I want the system to generate a PDF of quote report, attach the PDF and email it to the Customer.
    Better I would like, When approver, clicks on the approve button, the system should auto generate a PDF of quote report, attach the PDF and email it to the Customer, without any further input from the user. If its not possible, I may have to put button on
    quote form.
    I am using the attached code, but facing various issues.
    1. Under prepare the SOAP Message coding part, I am not sure what should be the below URL for CRM 2013 Online?
    xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
    2. What should be the emailid here? Is it Recepient Contact id(Guid) ?
    var emailid = resultXml.selectSingleNode("//CreateResult").nodeTypedValue;
    alert("emailid" + emailid.toString());
    3. Using this code, not able to create Entity for "ActivityMimeAttachment", I am getting newEntity as undefined.
    Below is the code I am using. Please check and help me out, where I am going wrong. Let me know if any better way to implement it. At present, I have put one button on quote form, on click event, below code will get executed.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title></title>
    <script type="text/javascript">
    var Xrm;
    if (window.opener) { Xrm = window.opener.Xrm; }
    else if (window.parent) { Xrm = window.parent.Xrm; }
    function getReportingSession() {
    var reportName = "Quotation_Report"; //set this to the report you are trying to download
    var reportId = "7C39D18F-1DC6-E311-8986-D89D6765B238"; //set this to the guid of the report you are trying to download
    var recordid = Xrm.Page.data.entity.getId();
    // recordid = recordid.substring(1, 37); //getting rid of curly brackets
    alert(recordid);
    var pth = Xrm.Page.context.getServerUrl() + "/CRMReports/rsviewer/reportviewer.aspx";
    var retrieveEntityReq = new XMLHttpRequest();
    retrieveEntityReq.open("POST", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    retrieveEntityReq.send("id=%7B" + reportId + "%7D&uniquename=" + Xrm.Page.context.getOrgUniqueName() + "&iscustomreport=true&reportnameonsrs=&reportName=" + reportName + "&isScheduledReport=false");
    var x = retrieveEntityReq.responseText.indexOf("ReportSession=");
    var ret = new Array();
    ret[0] = retrieveEntityReq.responseText.substr(x + 14, retrieveEntityReq.responseText.indexOf("&", x) - x - 14); //the session id
    x = retrieveEntityReq.responseText.indexOf("ControlID=");
    ret[1] = retrieveEntityReq.responseText.substr(x + 10, retrieveEntityReq.responseText.indexOf("&", x) - x - 10); //the control id
    return ret;
    function createEntity(ent, entName, upd) {
    var jsonEntity = JSON.stringify(ent);
    var createEntityReq = new XMLHttpRequest();
    var ODataPath = Xrm.Page.context.getServerUrl() + "XRMServices/2011/OrganizationData.svc";
    createEntityReq.open("POST", ODataPath + "/" + entName + "Set" + upd, false);
    createEntityReq.setRequestHeader("Accept", "application/json");
    createEntityReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    createEntityReq.send(jsonEntity);
    var newEntity = JSON.parse(createEntityReq.responseText).d;
    alert("new entity" + newEntity);
    return newEntity;
    function createAttachment() {
    var params = getReportingSession();
    var recordid = Xrm.Page.data.entity.getId();
    alert("recordid " + recordid);
    var orgName = Xrm.Page.context.getOrgUniqueName();
    var userID = Xrm.Page.context.getUserId();
    //create email record
    // Prepare the SOAP message.
    var xml = "<?xml version='1.0' encoding='utf-8'?>" +"<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'" +
    " xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'" +
    " xmlns:xsd='http://www.w3.org/2001/XMLSchema'>" +
    "<soap:Header>" +
    "</soap:Header>" +
    "<soap:Body>" +
    "<Create xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>" +
    "<entity xsi:type='email'>" +
    "<regardingobjectid type='quote'>" + recordid + "</regardingobjectid>" +
    "<subject>" + "Email with Attachment4" + "</subject>" +
    "</entity>" +
    "</Create>" +
    "</soap:Body>" +
    "</soap:Envelope>";
    // Prepare the xmlHttpObject and send the request.
    var xHReq = new ActiveXObject("Msxml2.XMLHTTP");
    xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
    xHReq.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/crm/2007/WebServices/Create");
    xHReq.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
    xHReq.setRequestHeader("Content-Length", xml.length);
    xHReq.send(xml);
    // Capture the result
    var resultXml = xHReq.responseXML;
    // alert("resultXml " + resultXml);
    // Check for errors.
    var errorCount = resultXml.selectNodes('//error').length;
    if (errorCount != 0) {
    alert("ERROR");
    var msg = resultXml.selectSingleNode('//description').nodeTypedValue;
    alert(msg);
    var emailid = resultXml.selectSingleNode("//CreateResult").nodeTypedValue;
    alert("emailid" + emailid.toString());
    //var emailid = userID;
    var post = Object();
    post.Body = encodePdf(params);
    var email = new Array();
    email[0] =new Object();
    email[0].id = emailid;
    email[0].entityType ='email';
    post.Subject ="File Attachment";
    post.AttachmentNumber = 1;
    post.FileName ="Report.pdf";
    post.MimeType ="application/pdf";
    post.ObjectId = Object();
    post.ObjectId.LogicalName ="email";
    post.ObjectId.Id = email[0].id;
    post.ObjectTypeCode ="email";
    alert(post.ObjectId.Id);
    createEntity(post,"ActivityMimeAttachment", "");
    alert("created successfully");
    email.Subject = "Your Order";
    //Set The current order as the Regarding object
    email.RegardingObjectId = {
    Id: Xrm.Page.data.entity.getId(), //Get the current entity Id , here OrderId
    LogicalName: Xrm.Page.data.entity.getEntityName()//Get the current entity name, here it will be “salesOrder”
    //Create Email Activity
    SDK.JScriptRESTDataOperations.Create(email, "Email", EmailCallBack, function (error) { alert(error.message); });
    // Email Call Back function
    function EmailCallBack(result) {
    email = result; // Set the email to result to use it later in email attachment for retrieving activity Id
    var activityPartyFrom = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyFrom.PartyId = {
    Id: customerId, // id of entity you want to associate this activity with.
    LogicalName: "contact"
    // Set the "activity" of the ActivityParty
    activityPartyFrom.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity).
    activityPartyFrom.ParticipationTypeMask = { Value: 2 }; // 2 means ToRecipients
    // Create the from ActivityParty for the email
    SDK.JScriptRESTDataOperations.Create(activityPartyFrom, "ActivityParty", ActivityPartyFromCallBack, function (error) { alert(error.message); });
    var activityPartyTo = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyTo.PartyId = {
    Id: ownerId, // id of entity you want to associate this activity with.
    LogicalName: "systemuser"
    // Set the "activity" of the ActivityParty
    activityPartyTo.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity). activityPartyTo.ParticipationTypeMask = { Value: 1 }; // 1 means Sender
    // Create the from ActivityParty
    SDK.JScriptRESTDataOperations.Create(activityPartyTo, "ActivityParty", ActivityPartyToCallBack, function (error) { alert(error.message); });
    //ActivityParty From Callback
    function ActivityPartyFromCallBack(result) {
    //ActivityParty To Callback
    function ActivityPartyToCallBack(result) {
    var StringMaker = function () {
    this.parts = [];
    this.length = 0;
    this.append = function (s) {
    this.parts.push(s);
    this.length += s.length;
    this.prepend = function (s) {
    this.parts.unshift(s);
    this.length += s.length;
    this.toString = function () {
    return this.parts.join('');
    var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    function encode64(input) {
    var output = new StringMaker();
    var chr1, chr2, chr3;
    var enc1, enc2, enc3, enc4;
    var i = 0;
    while (i < input.length) {
    chr1 = input[i++];
    chr2 = input[i++];
    chr3 = input[i++];
    enc1 = chr1 >> 2;
    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
    enc4 = chr3 & 63;
    if (isNaN(chr2)) {
    enc3 = enc4 = 64;
    else if (isNaN(chr3)) {
    enc4 = 64;
    output.append(keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4));
    return output.toString();
    var bdy = new Array();
    var bdyLen = 0;
    function concat2Bdy(x) {
    bdy[bdyLen] = x;
    bdyLen++;
    function encodePdf(params) {
    bdy = new Array();
    bdyLen = 0;
    var retrieveEntityReq = new XMLHttpRequest();
    var pth = Xrm.Page.context.getServerUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + params[0] + "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + params[1] + "&OpType=Export&FileName=Public&ContentDisposition=OnlyHtmlInline&Format=PDF";
    retrieveEntityReq.open("GET", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.send();
    BinaryToArray(retrieveEntityReq.responseBody);
    return encode64(bdy);
    </SCRIPT>
    <SCRIPT type=text/vbscript>
    Function BinaryToArray(Binary)
    Dim i
    ReDim byteArray(LenB(Binary))
    For i = 1 To LenB(Binary)
    byteArray(i-1) = AscB(MidB(Binary, i, 1))
    concat2Bdy(AscB(MidB(Binary, i, 1)))
    Next
    BinaryToArray = byteArray
    End Function
    </SCRIPT>
    </head>
    <body>
    <input type="button" onclick="createAttachment();" value="Attach Report" />
    </body>
    </html>
    Thanks. and waiting for your valuable comments.
    - Mittal

    Hello,
    Yes, I was able to make my code working as below. Tested on CRM online 2013.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title></title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
    <script type="text/javascript">
    if (typeof (SDK) == "undefined")
    { SDK = { __namespace: true }; }
    SDK.JScriptRESTDataOperations = {
    _context: function () {
    if (typeof GetGlobalContext != "undefined")
    { return GetGlobalContext(); }
    else {
    if (typeof Xrm != "undefined") {
    return Xrm.Page.context;
    else { return new Error("Context is not available."); }
    _getServerUrl: function () {
    var serverUrl = this._context().getServerUrl()
    if (serverUrl.match(/\/$/)) {
    serverUrl = serverUrl.substring(0, serverUrl.length - 1);
    return serverUrl;
    _ODataPath: function () {
    return this._getServerUrl() + "/XRMServices/2011/OrganizationData.svc/";
    _errorHandler: function (req) {
    return new Error("Error : " +
    req.status + ": " +
    req.statusText + ": " +
    JSON.parse(req.responseText).error.message.value);
    _dateReviver: function (key, value) {
    var a;
    if (typeof value === 'string') {
    a = /Date\(([-+]?\d+)\)/.exec(value);
    if (a) {
    return new Date(parseInt(value.replace("/Date(", "").replace(")/", ""), 10));
    return value;
    Create: function (object, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("POST", this._ODataPath() + type + "Set", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 201) {
    successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d);
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send(JSON.stringify(object));
    Retrieve: function (id, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("GET", this._ODataPath() + type + "Set(guid'" + id + "')", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 200) {
    successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d);
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send();
    Update: function (id, object, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("POST", this._ODataPath() + type + "Set(guid'" + id + "')", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.setRequestHeader("X-HTTP-Method", "MERGE");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 204 || this.status == 1223) {
    successCallback();
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send(JSON.stringify(object));
    Delete: function (id, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("POST", this._ODataPath() + type + "Set(guid'" + id + "')", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.setRequestHeader("X-HTTP-Method", "DELETE");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 204 || this.status == 1223) {
    successCallback();
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send();
    RetrieveMultiple: function (type, filter, successCallback, errorCallback) {
    if (filter != null) {
    filter = "?" + filter;
    else { filter = ""; }
    var req = new XMLHttpRequest();
    req.open("GET", this._ODataPath() + type + "Set" + filter, true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 200) {
    successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d.results);
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send();
    __namespace: true
    </script>
    <script type="text/javascript">
    //Create Email and link it with Order as Regarding field
    var Xrm;
    var email = new Object();
    var ownerID = "";
    var CustomerId = "";
    if (window.opener) { Xrm = window.opener.Xrm; }
    else if (window.parent) { Xrm = window.parent.Xrm; }
    //Get ownerid who send email of quotation to customer
    function GetOwnerID() {
    var owner = Xrm.Page.getAttribute("ownerid").getValue();
    ownerID = owner[0].id;
    var ownerName = owner[0].name;
    var entityType = owner[0].entityType;
    GetToEmailGUID();
    //Get customerid who receive email of quotation from owner
    function GetToEmailGUID() {
    var Customer = Xrm.Page.getAttribute('customerid').getValue();
    CustomerId = Customer[0].id;
    var CustomerName = Customer[0].name;
    var entityType = Customer[0].entityType;
    //if CustomerId is type of "Account" then get Primary Contact id of that account
    if (entityType == "account") {
    var contact = Xrm.Page.getAttribute("customerid").getValue();
    if (contact === null) return;
    var serverUrl = Xrm.Page.context.getClientUrl();
    var oDataSelect = serverUrl + "/XRMServices/2011/OrganizationData.svc/AccountSet(guid'" + contact[0].id + "')?$select=PrimaryContactId";
    var req = new XMLHttpRequest();
    req.open("GET", oDataSelect, false);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json;charset=utf-8");
    req.onreadystatechange = function () {
    if (req.readyState === 4) {
    if (req.status === 200) {
    var retrieved = JSON.parse(req.responseText).d;
    CustomerId = retrieved.PrimaryContactId.Id;
    else {
    alert(this.statusText);
    req.send();
    function CreateEmail() {
    GetOwnerID();
    email.Subject = "Email with Report Attachment";
    //Set The current order as the Regarding object
    email.RegardingObjectId = {
    Id: Xrm.Page.data.entity.getId(), //Get the current entity Id , here OrderId
    LogicalName: Xrm.Page.data.entity.getEntityName()//Get the current entity name, here it will be “salesOrder”
    //Create Email Activity
    SDK.JScriptRESTDataOperations.Create(email, "Email", EmailCallBack, function (error) { alert(error.message); });
    // Email Call Back function
    function EmailCallBack(result) {
    email = result; // Set the email to result to use it later in email attachment for retrieving activity Id
    var activityPartyFrom = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyFrom.PartyId = {
    Id: CustomerId, //"79EBDD26-FDBE-E311-8986-D89D6765B238", // id of entity you want to associate this activity with.
    LogicalName: "contact"
    // Set the "activity" of the ActivityParty
    activityPartyFrom.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity).
    activityPartyFrom.ParticipationTypeMask = { Value: 2 }; // 2 means ToRecipients
    // Create the from ActivityParty for the email
    SDK.JScriptRESTDataOperations.Create(activityPartyFrom, "ActivityParty", ActivityPartyFromCallBack, function (error) { alert(error.message); });
    var activityPartyTo = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyTo.PartyId = {
    Id: ownerID, //"79EBDD26-FDBE-E311-8986-D89D6765B238", // id of entity you want to associate this activity with.
    LogicalName: "systemuser"
    // Set the "activity" of the ActivityParty
    activityPartyTo.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity).
    activityPartyTo.ParticipationTypeMask = { Value: 1 }; // 1 means Sender
    // Create the from ActivityParty
    SDK.JScriptRESTDataOperations.Create(activityPartyTo, "ActivityParty", ActivityPartyToCallBack, function (error) { alert(error.message); });
    //ActivityParty From Callback
    function ActivityPartyFromCallBack(result) {
    //ActivityParty To Callback
    function ActivityPartyToCallBack(result) {
    GetReportId('Quotation');
    //Create attachment for the created email
    function CreateEmailAttachment() {
    //get reporting session and use the params to convert a report in PDF
    var params = getReportingSession();
    //Email attachment parameters
    var activitymimeattachment = Object();
    activitymimeattachment.ObjectId = Object();
    activitymimeattachment.ObjectId.LogicalName = "email";
    activitymimeattachment.ObjectId.Id = email.ActivityId;
    activitymimeattachment.ObjectTypeCode = "email",
    activitymimeattachment.Subject = "File Attachment";
    activitymimeattachment.Body = encodePdf(params);
    activitymimeattachment.FileName = "Report.pdf";
    activitymimeattachment.MimeType = "application/pdf";
    //Attachment call
    SDK.JScriptRESTDataOperations.Create(activitymimeattachment, "ActivityMimeAttachment", ActivityMimeAttachmentCallBack, function (error) { alert(error.message); });
    //ActivityMimeAttachment CallBack function
    function ActivityMimeAttachmentCallBack(result) {
    var features = "location=no,menubar=no,status=no,toolbar=no,resizable=yes";
    var width = "800px";
    var height = "600px";
    window.open(Xrm.Page.context.getServerUrl() + "main.aspx?etc=" + 4202 + "&pagetype=entityrecord&id=" + email.ActivityId, "_blank", features);
    // To open window which works in outlook and IE both
    //openStdWin(Xrm.Page.context.getServerUrl() + "main.aspx?etc=" + 4202 + "&pagetype=entityrecord&id=" + email.ActivityId, "_blank", width, height, features);
    //This method will get the reportId based on a report name that will be used in getReportingSession() function
    function GetReportId(reportName) {
    var oDataSetName = "ReportSet";
    var columns = "ReportId";
    var filter = "Name eq '" + reportName + "'";
    retrieveMultiple(oDataSetName, columns, filter, onSuccess);
    function retrieveMultiple(odataSetName, select, filter, successCallback) {
    var serverUrl = Xrm.Page.context.getServerUrl();
    var ODATA_ENDPOINT = "/XRMServices/2011/OrganizationData.svc";
    var odataUri = serverUrl + ODATA_ENDPOINT + "/" + odataSetName + "?";
    if (select) {
    odataUri += "$select=" + select + "&";
    if (filter) {
    odataUri += "$filter=" + filter;
    $.ajax({
    type: "GET",
    contentType: "application/json; charset=utf-8",
    datatype: "json",
    url: odataUri,
    beforeSend: function (XMLHttpRequest) {
    XMLHttpRequest.setRequestHeader("Accept", "application/json");
    success: function (data) {
    if (successCallback) {
    if (data && data.d && data.d.results) {
    successCallback(data.d.results);
    else if (data && data.d) {
    successCallback(data.d);
    else {
    successCallback(data);
    error: function (XmlHttpRequest, errorThrown) {
    if (XmlHttpRequest && XmlHttpRequest.responseText) {
    alert("Error while retrieval ; Error – " + XmlHttpRequest.responseText);
    function onSuccess(data) {
    reportId = data[0].ReportId.replace('{', ").replace('}', ");
    CreateEmailAttachment(); // Create Email Attachment
    //Gets the report contents
    function getReportingSession() {
    var pth = Xrm.Page.context.getServerUrl() + "/CRMReports/rsviewer/reportviewer.aspx";
    var retrieveEntityReq = new XMLHttpRequest();
    var Id = Xrm.Page.data.entity.getId();
    var quotationGUID = Id.replace('{', ""); //set this to selected quotation GUID
    quotationGUID = quotationGUID.replace('}', "");
    var reportName = "Quotation"; //set this to the report you are trying to download
    var reportID = "7C39D18F-1DC6-E311-8986-D89D6765B238"; //set this to the guid of the report you are trying to download
    var rptPathString = ""; //set this to the CRMF_Filtered parameter
    var strParameterXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'><entity name='quote'><all-attributes /><filter type='and'><condition attribute='quoteid' operator='eq' uitype='quote' value='" + quotationGUID + "' /> </filter></entity></fetch>";
    retrieveEntityReq.open("POST", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    rptPathString = "id=%7B" + reportID + "%7D&uniquename=" + Xrm.Page.context.getOrgUniqueName() + "&iscustomreport=true&reportnameonsrs=&reportName=" +
    reportName + "&isScheduledReport=false&p:CRMAF_Filteredquote=" + strParameterXML;
    //remove the part starting from &p:salesorderid if your report has no parameters
    retrieveEntityReq.send(rptPathString);
    var x = retrieveEntityReq.responseText.indexOf("ReportSession=");
    var ret = new Array();
    ret[0] = retrieveEntityReq.responseText.substr(x + 14, retrieveEntityReq.responseText.indexOf("&", x) - x - 14); //the session id
    x = retrieveEntityReq.responseText.indexOf("ControlID=");
    ret[1] = retrieveEntityReq.responseText.substr(x + 10, retrieveEntityReq.responseText.indexOf("&", x) - x - 10); //the control id
    return ret;
    var bdy = new Array();
    var bdyLen = 0;
    function concat2Bdy(x) {
    bdy[bdyLen] = x;
    bdyLen++;
    function encodePdf(params) {
    bdy = new Array();
    bdyLen = 0;
    var retrieveEntityReq = new XMLHttpRequest();
    var pth = Xrm.Page.context.getServerUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + params[0] +
    "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + params[1] +
    "&OpType=Export&FileName=Public&ContentDisposition=OnlyHtmlInline&Format=PDF";
    retrieveEntityReq.open("GET", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.send();
    BinaryToArray(retrieveEntityReq.responseBody);
    return encode64(bdy);
    var StringMaker = function () {
    this.parts = [];
    this.length = 0;
    this.append = function (s) {
    this.parts.push(s);
    this.length += s.length;
    this.prepend = function (s) {
    this.parts.unshift(s);
    this.length += s.length;
    this.toString = function () {
    return this.parts.join('');
    var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    function encode64(input) {
    var output = new StringMaker();
    var chr1, chr2, chr3;
    var enc1, enc2, enc3, enc4;
    var i = 0;
    while (i < input.length) {
    chr1 = input[i++];
    chr2 = input[i++];
    chr3 = input[i++];
    enc1 = chr1 >> 2;
    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
    enc4 = chr3 & 63;
    if (isNaN(chr2)) {
    enc3 = enc4 = 64;
    } else if (isNaN(chr3)) {
    enc4 = 64;
    output.append(keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4));
    return output.toString();
    </script>
    <script type="text/vbscript">
    Function BinaryToArray(Binary)
    Dim i
    ReDim byteArray(LenB(Binary))
    For i = 1 To LenB(Binary)
    byteArray(i-1) = AscB(MidB(Binary, i, 1))
    concat2Bdy(AscB(MidB(Binary, i, 1)))
    Next
    BinaryToArray = byteArray
    End Function
    </script>
    </head>
    <body>
    <input type="button" onclick="CreateEmail();" value="Attach Report" />
    </body>
    </html>
    Thank you,
    Mittal.

  • Report Generation Toolkit Excel Vi's do not run after creating an executable​. What am I missing?

    I have labview 8.5 and Report Generation Toolkit version 1.1.2.   My vi works fine during development. When I make an executable or an installer the excel vi's do not work. I have seen this question posted before but it has always been for earlier revisions and the answers do not seem to apply with 8.5 and 1.1.2. 

    Hello ajh,
    You will have to include Dynamic VIs in the executable you build. The following link has more information:
    http://digital.ni.com/public.nsf/allkb/C38CE3F3054​2D65B86256F0E00740DD8
    Prashant.

Maybe you are looking for