zoukankan      html  css  js  c++  java
  • Export to Microsoft Excel On a Dynamics AX Form With Multiple Data Sources【转】

    AX 2012 now makes it really easy to output to Excel from a form. Quite simply all you need to do is add a Command button to the form and link it to the command Export to Microsoft Excel. This is great for list pages or any form with a single data source.

    However you will find that when several data sources are used on a single form then Ax will output the data from the first data source on the form rather than from the specific data source  that the user is selecting when the Export to Microsoft Excel button is clicked.

    Even if you add multiple Export to Microsoft Excel buttons and set the data source individually on the button groups you will still find that the output to Excel is from the first data source of the form.

    Now the user can get around this by using CTRL – T from any given grid to export that datasource to Excel but a lot of users may not find it easy to remember which hot key to use.

    After a bit of hunting around I have found an easy solution to this issue.

    Simply override the Clicked method of the Command button control by calling element.selectControl as shown below: –

    void clicked()
    {
        element.selectControl(Grid); // The "Grid" argument is the name of the grid
                                     // that you want to export from
     
        super();
    }

    By keeping track of which grid the user is selecting (override the form datasource Active() methods for example) you can control which grid is exported to Excel.

    原文地址:http://www.k3technical.com/export-to-microsoft-excel-on-a-form-with-multiple-data-sources/

  • 相关阅读:
    循环
    pl/sql小结
    poi编程
    Activiti工作流面试相关知识!
    工作流学习——Activiti流程变量五步曲
    工作流学习——Activiti流程实例、任务管理四步曲
    工作流学习——Activiti流程定义管理三步曲
    工作流学习——Activiti整体认识二步曲
    工作流学习——重要概念扫盲篇一步曲
    Activiti工作流数据库表详细介绍(23张表)
  • 原文地址:https://www.cnblogs.com/bjdc/p/6797280.html
Copyright © 2011-2022 走看看