Qlik Community

QlikView Extensions

Discussion Board for collaboration on QlikView Extensions.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

ajax to php

Hi Guys!

I try to use a ajax request in QlikView Extension to get a php file.

I get this error message in QlikView when I run the script:

I don't know what the problem is.

I hope someon can help me with this??

I am using:

localhost (Apache)

QlikView Personal Edition

here is my QlikView script.js:

And here is my PHP script on localhost:

And here the result when I use the url with my Browser: (so my Apache is working)

I've tried many different possibilities and I also tried an XMLHttpRequest which doesn`t work.

So I hope somebody out there can help my with this.

Many thanks!

Lars

Tags (2)
1 Solution

Accepted Solutions
Not applicable

Re: ajax to php

So good news i have a working extension.

So here my latest insight on this topic:

1. the code is fine

2. sending data to php (localhost) file is possible (I am now using the XMLHttpRequest method)

3. getting data directly back from php (localhost) seems not possible. ( Is it a security issue?, maybe because it's not the same domain?) So this the problem.

4. getting data with XMLHttpRequest from QV-extension folder is possible

-->so I build a workaround for getting data from php/localhost:

php creates a texttfile in QV-extension folder then getting data with XMLHttpRequest

To get a graps what I am talking about here is a picture of my scenario:

So the main-goal is to connect to MySQL via QV-extension.

Maybe someone have some ideas or insight on this topic.

I know there are extension writing to SQL Server. But there not working yet on my system.

I need to debug them with Visual Studio and I know I can connect with VS to MySQL to, so maybe I will try this  sometime.

I am happy about any suggestion

kind regard


Lars

9 Replies
simondachstr
Not applicable

Re: ajax to php

Hi Lars,

Not sure exactly why your code is not working as it seems pretty straightforward to me. Try debuggin with fiddler if you have not already done so. I've implemented once something similar, however using a WCF service to host the web service. I've summarized my code into a small demo here: SQL Writeback from QlikView extension object.

Hopefully this may help or point you into the right direction.

Not applicable

Re: ajax to php

I tried the code with my Browser and it worked. I don´t get it how to use ajax in a fiddle so i can`t use that. I think there is a problem with the setup. I am going to trie the extension on a other machine.

Thank you for the Writeback extension and the Guide, seems very nice

Thank you so far

akl
Not applicable

Re: ajax to php

Hey Lars,
If you have access to a QlikView server try to test the extension on it.

I have had tons of problems doing http gets from within the desktop client but it has worked perfectly on the server.

Not applicable

Re: ajax to php

Yes, definitely I am going to try it on QV server.

Not applicable

Re: ajax to php

So good news i have a working extension.

So here my latest insight on this topic:

1. the code is fine

2. sending data to php (localhost) file is possible (I am now using the XMLHttpRequest method)

3. getting data directly back from php (localhost) seems not possible. ( Is it a security issue?, maybe because it's not the same domain?) So this the problem.

4. getting data with XMLHttpRequest from QV-extension folder is possible

-->so I build a workaround for getting data from php/localhost:

php creates a texttfile in QV-extension folder then getting data with XMLHttpRequest

To get a graps what I am talking about here is a picture of my scenario:

So the main-goal is to connect to MySQL via QV-extension.

Maybe someone have some ideas or insight on this topic.

I know there are extension writing to SQL Server. But there not working yet on my system.

I need to debug them with Visual Studio and I know I can connect with VS to MySQL to, so maybe I will try this  sometime.

I am happy about any suggestion

kind regard


Lars

simondachstr
Not applicable

Re: ajax to php

Looks like quite a workaround! But good job on making it work.

Have you contemplated using post method instead of get?

Not applicable

Re: ajax to php

I am already using post (know). So yes I did and I need to because of the amount of data.

kirankkk
Not applicable

Re: ajax to php

Can you please share example and steps for same

mayuringale25
Not applicable

Re: ajax to php

is there any alternative than xampp for running extension