Assign event to memoview at runtime using VB6
keturpatel
India
I had posted same question in Fast-report studio forum, but did not got answer, so re-posting here.
[topic="9158"]Original post[/topic]
I'm trying to add event to memoview at runtime, but cannot find way to assign event.
I'm using VB6 and creating report at runtime with several memoviews.
I have added script to report object, which has some variables and procedures.
Now i want to assign one of script procedure to obp event of memoview in report.
but cant find way to do so. my fastreport version is 4.9
Here is sample vb6 code i am using :
Here in above code,
I want to assign Procedure MemoView1OnBeforePrint as event handler for MemoView1's OnBeforePrint
I need something like MyMemoview.EventHandler.OnBeforePrint = "MemoView1OnBeforePrint"
Please help me.
Thanks in advance.
[topic="9158"]Original post[/topic]
I'm trying to add event to memoview at runtime, but cannot find way to assign event.
I'm using VB6 and creating report at runtime with several memoviews.
I have added script to report object, which has some variables and procedures.
Now i want to assign one of script procedure to obp event of memoview in report.
but cant find way to do so. my fastreport version is 4.9
Here is sample vb6 code i am using :
   Â
      sTemp = "var xTotDay  :Double;" & _
                      vbCrLf & _
                      vbCrLf & _
            "procedure MemoView1OnBeforePrint(Sender: TfrxComponent);" & vbCrLf & _
            "begin" & vbCrLf & _
            "    xTotDay := 1234;
            "    MemoView1.Text := FormatFloat('0.00',xTotDay);" & vbCrLf & _
            "end;" & _
                      vbCrLf & _
                      vbCrLf & _
            "begin" & vbCrLf & _
            "      " & vbCrLf & _
            "end."
    MyTfrxReport.Script.ClearScript
    MyTfrxReport.ScriptLanguage = "PascalScript"
    MyTfrxReport.ScriptText = sTemp
Here in above code,
I want to assign Procedure MemoView1OnBeforePrint as event handler for MemoView1's OnBeforePrint
I need something like MyMemoview.EventHandler.OnBeforePrint = "MemoView1OnBeforePrint"
Please help me.
Thanks in advance.