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 9:52PM
    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

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.