Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamics AX qlikview Ocx embeded control (auto refresh data)

Good afternoon

Have you a tutorial on how to use the quikview ocx control.

In particular how to automatically refresh the data from outside (in this case AX.)

I would like to be able to automatically upload the data into the control rather than having to do a reload.

of

OLEDB

CONNECT TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Retail;Data Source=RIVER-SQL1\QA;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=ROV-RIV-WSDHIL;Use Encryption for Data=False;Tag with column collation when possible=False];

SQL

OLEDB

CONNECT TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Retail;Data Source=RIVER-SQL1\QA;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=ROV-RIV-WSDHIL;Use Encryption for Data=False;Tag with column collation when possible=False];

SQL

OLEDB

CONNECT TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Retail;Data Source=RIVER-SQL1\QA;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=ROV-RIV-WSDHIL;Use Encryption for Data=False;Tag with column collation when possible=False];

SQL

SELECT *

FROM Retail.dbo."qlik_customers";

SELECT *

FROM Retail.dbo."qlik_products";

SELECT *

FROM Retail.dbo."qlik_orders";



thanks

David

2 Replies
Not applicable
Author

I have a sort of Part answer for Dynamic ax form with qlikview ocx on it

on the init method of the form --load the quickview doc into the OCX control

public void init()
{
super();
activex.OpenDocument("c:\\qlik_sales.qvw");
}

Then refresh the data by calling the controls relaod method (from a button on the form)

void clicked()
{
com doc;

super();
doc=activex.ActiveDocument();
doc.reload();
}

What I really want to do is advoid having to go out all around the houses using oledb and sql to get my data.

I would like to stream it directly into the ocx control from AX

is this possible?

thanks

David

Not applicable
Author

The only other way I can think of would be to use the Document.DynamicUpdateCommand method to add/update your data in your tables. You'll need to have an already existing data model though, as you won't be able to create or alter tables with this method. Here are the 3 examples from the QV api guide:

sub Update
SET Result = ActiveDocument.DynamicUpdateCommand ("UPDATE * SET Discount = if(Discount >= 35, 0, if (City='Stockholm', Discount + 5, Discount + 2)) WHERE Country = 'SE'")
if Result = false then
MsgBox Result.ErrorMessage
end if
end sub

sub Insert
SET Result = ActiveDocument.DynamicUpdateCommand ("INSERT INTO * (Country, City) VALUES (DK, Copenhagen), (NO, Oslo)")
if Result = false then
MsgBox Result.ErrorMessage
end if
end sub

sub Delete
SET Result = ActiveDocument.DynamicUpdateCommand ("DELETE FROM CITY WHERE IsNull (Discount)")
if Result = false then
MsgBox Result.ErrorMessage
end if
end sub