I have a simple QVW, containing one table box with about 30 columns. What I am trying to do is to export the data in that table to an XML file via the OCX interface. It seems that if the size of the data in the table is somewhat big (the attached sample has 32,776 rows), QV OCX will crash (bad,because then my app also crashes).
I've tried to manually export via the standalone QlikView (load this QVW in qv.exe, right click on the table box, select export, and choose xml type), and it exported just fine. The resulting xml file is about 42 mb. However, if I use the following simple lines of code to do the same programmatically, the app crashes at the last line.
QlikView.TableBox tb = axQlikOCX1.ActiveDocument.GetSheetObject("TB01") as QlikView.TableBox;
I am using 11.20 SR 5 32-bit on Win 7.
Any help or pointer would be very much appreciated.
1. I opened your example, and when I clicked on the button, the edit module window popped up. Was this by design? I don't think so, based on the action setting you put in the button (run macro -> CallExample), but want to double check ...
2. The application I am writing is supposed to automate the exporting of data to XML, without any manual step, so even if this approach worked, I still need to find ways to programmatically trigger the button click from OCX, so that the process will run without human attendance.
I got the macro working, and was able to hook it into a trigger. While it works, the performance is extremely slow, especially comparing with ExportXML function via OCX (when it works). The performance may be because of the interaction with Excel, and since I don't really need the data in Excel, is there any other function I can use in macro to export the data to XML directly?
Re: Re: Re: Exporting XML from table crashes QV OCX
It's interesting how ExportXML API works when it's executed in macro but crashes when it's executed via OCX (embedded in my .net app). I was able to get it to work, as long as I open the qvw in standalone QlikView first. If I tried to trigger it somehow from my .net app, it crashes. As an example, I took the latest SimpleText.qvw, open it via OCX, and triggers a button click (BU01, which is the button labeled "xml"), my app crashes. But, if I open that same qvw in QlikView, and click on the same button, the export works just fine.