Ticket T604959
Visible to All Users

How to log Export and Print Preview Actions by the Audit Trail module

created 7 years ago

[DevExpress Support Team: CLONED FROM T518215: AuditTrail - How to show the change history for the current object in a separate form instead of a nested ListView]
how to add to audit list view export and print preview action buttons ?

Answers approved by DevExpress Support

created 7 years ago

Hello Sławomir,

Consider the following implementation plan:

  1. Locate and access required Controllers and their Actions:
    Concepts > Extend Functionality > Built-in Controllers and Actions
    Concepts > Extend Functionality > Customize Controllers and Actions
    2. Handle the Action's Execute or ActionBase > ExecuteCompleted events.
  2. Create custom audit items: Concepts > Extra Modules > Audit Trail Module Overview > Customize the Audit Trail System (Add Custom Data to the Audit Log)

Let me know once you have had an opportunity to research and test these solutions in your project.

    Show previous comments (1)
    Dennis Garavsky (DevExpress) 7 years ago

      My solution idea was to handle the events of the ExportController > ExportAction  object and then log custom audit entries. Please attach a sample showing your implementation attempts and describe your current difficulties so that we can assist you further.

      JK JK
      Jacek Kosinski 7 years ago

        i have controller with popupaction
        where I want display audit records for current object::

        C#
        private void popupWindowAuditKlienci_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e) { ListView lv = Application.CreateListView(Application.CreateObjectSpace(typeof(AuditDataItemPersistent)), typeof(AuditDataItemPersistent), true); GroupOperator criteria = new GroupOperator(GroupOperatorType.And); criteria.Operands.Add(new BinaryOperator("AuditedObject.TargetType", ((XPObjectSpace)ObjectSpace).Session.GetObjectType(View.CurrentObject))); criteria.Operands.Add(new BinaryOperator("AuditedObject.TargetKey", XPWeakReference.KeyToString(ObjectSpace.GetKeyValue(View.CurrentObject)))); lv.CollectionSource.Criteria["ByTargetObject"] = criteria; e.View = lv; }

        …and when I run this I get list f audit entries, but I can't export this list to excel or pdf  like on standard listView

        Dennis Garavsky (DevExpress) 7 years ago

          Thank you for removing the ambiguity from your question, because originally I thought that the problem is to get the Export and Print Preview Actions to be logged in the same Audit Trail log.
          I've answered your UI customization question separately: How to display the Export and other Actions in a popup ListView

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.