interactive between report and parent system

Hi,

if i have a report about invoices list and my report viewer is already hosted on my system ,now i want to interactive between displayed report and a form which related to report data , for example i want to double click in some row or line of invoice and a corresponding form should be shown.



thanks

Comments

  • edited 6:10PM
    suppose you want to click Text1 (textobject) and your Main Application is MainApp.exe with namespace = MainApp.

    1. Create a new static class in MainApp
    using System;
    
    namespace MainApp
    {
        public class FRCustomFunction
        {
            public static void MyOpenForm(int id)
            {
                using (Form1 frmPopup = new Form1 (id))
                {
                    frmPopup.ShowDialog();
                }
            }
        }
    }
    

    2. Add reference in your FastReport frx file, include MainApp.exe

    3. For passing parameter to Main Application, you could use Hyperlink.
    Hyperlink.Kind="Custom"
    Hyperlink.Expression="[ReportDatasource.ID]"

    4. Script :
        private void Text1_Click(object sender, EventArgs e)
        {
          TextObject txtBox = sender as TextObject;
          int id = Convert.ToInt32(txtBox.Hyperlink.Value);
          MainApp.FRCustomFunction.MyOpenForm(id);
        }
    

Leave a Comment