Set Sort Order Dynamically

Is it possible to set the sort order of a report dynamically?
In other words, change the columns that make up the sort order.

For example, one time I run the report, I want it sorted by customer number. The next time I run it, I want it sorted by Customer Name. The next time, I want it sorted by Sales Region, and then by Customer Name.

Is it possible to set the sort order dynamically? If so, how?

Comments

  • edited 4:43PM
    change sort order via script (in frx file) :

    1, suppose you have 2 textobject, text1 and text2 in databand
    2. text1 bound to column [AccCode] and text2 bound to column [AccName]
    3. create click event
         private void Text1_Click(object sender, EventArgs e)
        {
          DataBand abc = (DataBand)Data1;
          abc.Sort.Clear();
          abc.Sort.Add(new Sort("[MainReport.AccCode]"));
          Report.Refresh();      
        }
    
         private void Text2_Click(object sender, EventArgs e)
        {
          DataBand abc = (DataBand)Data1;
          abc.Sort.Clear();
          abc.Sort.Add(new Sort("[MainReport.AccName]"));
          Report.Refresh();      
        }
    
  • edited 4:43PM
    Thanks, ipong, that works great!
  • edited 4:43PM
    ipong wrote: »
    change sort order via script (in frx file) :

    1, suppose you have 2 textobject, text1 and text2 in databand
    2. text1 bound to column [AccCode] and text2 bound to column [AccName]
    3. create click event
         private void Text1_Click(object sender, EventArgs e)
        {
          DataBand abc = (DataBand)Data1;
          abc.Sort.Clear();
          abc.Sort.Add(new Sort("[MainReport.AccCode]"));
          Report.Refresh();      
        }
    
         private void Text2_Click(object sender, EventArgs e)
        {
          DataBand abc = (DataBand)Data1;
          abc.Sort.Clear();
          abc.Sort.Add(new Sort("[MainReport.AccName]"));
          Report.Refresh();      
        }
    

    Tks u, i try
    customize Email Template Magento 2 - Enable Canonical Meta Tag Magento 2 - Magento 2 Odoo

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.