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 3:10AM
    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 3:10AM
    Thanks, ipong, that works great!
  • edited 3:10AM
    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