Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Exporting XML from table crashes QV OCX

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.

                axQlikOCX1.OpenDocument(@"SimpleTest.qvw");

                QlikView.TableBox tb = axQlikOCX1.ActiveDocument.GetSheetObject("TB01") as QlikView.TableBox;

                tb.ExportXml(@"DepositLine.xml");


I am using 11.20 SR 5 32-bit on Win 7.


Any help or pointer would be very much appreciated.


Thanks,

Wei


1 Solution

Accepted Solutions
fkeuroglian
Partner - Master
Partner - Master

Wei

i attached and example to export directly to XML format, it is faster and improve the permonce

View solution in original post

7 Replies
fkeuroglian
Partner - Master
Partner - Master

Hi,  i attached an example

i put a boton and create a macro to export to excel, that could be a way to do it

good luck!

Fernando

Not applicable
Author

Hi Fernando,

Thanks for the quick response. Two questions-

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.

Thanks,
Wei

fkeuroglian
Partner - Master
Partner - Master

Hi , Wei

1:  the edit modulo pop up because you have to select one option in the editor module, i attached a picture please see and check that you have select the same that i put in blue.

2: i understand that you have to do it automatically, but you coul do a triger that execute this macro automaticaly and you dont have to do it manualy with a button.

please let me know if you need something

good luck!

Fernando

Not applicable
Author

Thanks Fernando.

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?

Thanks,
Wei

fkeuroglian
Partner - Master
Partner - Master

Wei

i attached and example to export directly to XML format, it is faster and improve the permonce

Not applicable
Author

Thanks.

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.

fkeuroglian
Partner - Master
Partner - Master

Your welcome Wei

it is rare , could be some permisions? of something of that?

if you want please check this response like usefull or correct!

thank you and good luck!!