3 Replies Latest reply: Jan 20, 2015 9:46 PM by Wanki Jeon RSS

    C# - Ocx doesn't launch macro when opening(trigger)



      I noticed that actually the macro which should be triggered when the QlikView document is being opened via OCX, actually doesn't get triggered.


      I'm modifying variables from QlikView document, which are successful in C#


      public void SetVariables(IDictionary<string, object> parameters)


                  foreach (KeyValuePair<string, object> p in parameters)


                      Variable v = qvReport.Variables(p.Key);

                      if (v != null)


                              //Console.WriteLine("Before modification content : " + v.GetContent().String);

                              v.SetContent(p.Value.ToString(), true);

                              //Console.WriteLine("Current content : " + v.GetContent().String);

                              variables = null;






      But, when I do a




      or simply open my QlikView document and it actually should trigger on PostReload or OnOpen, the macro isn't being executed in the background.


      Even after modifying my document, I try to open it again, the same result, it doesn't execute the macro.


      Is it possible to make all macro's from QlikView document to be executed with the Ocx?


      I know that probably I won't get any reply, like my previous 4 different post concerning the Ocx, so I don't understand why my company paid a lots of money for support and I never get any reply here when I post a question concerning the Ocx...

        • Re: C# - Ocx doesn't launch macro when opening(trigger)

          Even if I try in my code:




          And I see the Edit Module appear and execute the macro by myself, it still doesn't update the graphs correctly via C# while using the Ocx.


          I really tried all possible ways I could so far, but macros aren't being executed when I open the documents, or via C# manipulate that it should open the Edit Module and manually do the trigger myself.

          • Re: C# - Ocx doesn't launch macro when opening(trigger)



            When I do a





            And I open myself the report, then for the first time, my event is being triggered by myself, but not when I do:


                             qvReport = axQlikOCX1.OpenDocument(filepath, "", ""); // should trigger all macros OnOpen


            It actually should launch all macros which are in the OnOpen, but it doesn't. If I launch QlikView by myself without the OCX, it is being done correctly.


                            qvReport.Load(configuration.QVFile); // open my qvw file

                            qvReport.SetVariables(configuration.VariableParameters); //change the variables + reload+ save (ok, but it change change graphs, so the save won't be done on the updated infos, but still on old once)

                            qvReport.Load("E:/tmp.qvw"); //reopen the changed qvw file


            Even tried to take the original file and saveAs and to use the saveAs.

            But, it never changes the graphs... Is it coming from the OCX? Because when I open my QlikView document, the variables have in fact changed and the graphs are being changed since the OnOpen is being triggered, but the graphs aren't changed when I run it from the OCX in .NET