Page 1 of 1

Integrating DAI in Visual Dataflex Webapp

PostPosted: Wed Mar 14, 2012 10:26 am
by Jacques
Hi,
How can I integrate a DAI report in Visual dataflex asp file ?
In the help of the DAI report I found that I can use
Code: Select all
<HTML>
<BODY onload='BB.submit();'>
<FORM NAME=BB METHOD=POST ACTION="http://localhost/ai6/ai.asp">
<INPUT TYPE=HIDDEN NAME="UID" VALUE="">
<INPUT TYPE=HIDDEN NAME="PW" VALUE="">
<INPUT TYPE=HIDDEN NAME="DAI_R" VALUE="1025">
</FORM>
</BODY>
</HTML>


I though using the simple Ajax view created with the wizard

Code: Select all
<!-- #Include FILE="VdfAjaxLib/2-0/PageTop.inc.asp" -->
<html>
<head>
    <title>AJAX Web Application</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="GENERATOR" content="Visual DataFlex Studio">
    <!-- Global stylesheet -->
    <link rel="stylesheet" href="Css/WebApp.css" type="text/css">
    <link rel="stylesheet" media="print" href="Css/Print.css" type="text/css">
    <!-- #include File="VdfAjaxLib/2-0/Includes.inc.asp" -->
</head>
<body>
    <form action="none" name="user_form" autocomplete="off" vdfControlType="form" vdfControlName="user_form" vdfMainTable="user" vdfServerTable="user" vdfWebObject="oDAI">
        <!-- Status fields -->
        <input type="hidden" name="user__rowid" value="" />

        <table width="100%">
            <tr>
                <td>
                    <h3>DAI</h3>
                </td>
            </tr>
            <tr>
                <td>
                    <!-- Include the toolbar for the Find buttons, etc -->
                    <!-- #Include FILE="VdfAjaxLib/2-0/Toolbar.inc.asp" -->
                </td>
            </tr>
            <tr>
                <td>
                    <div>
                        <table class="EntryTable">
                            <tr>
                                <td class="Label">UserID</td>
                                <td>
                                    <input class="Data" type="text" value="" name="User__Userid" title="UserID" size="8" vdfSuggestSource="find" />
                                </td>
                            </tr>
                            <tr>
                                <td class="Label">Login</td>
                                <td>
                                    <input class="Data" type="text" value="" name="User__Loginname" title="Login" size="20" vdfSuggestSource="find" />
                                </td>
                            </tr>
                            <tr>
                                <td class="Label">Password</td>
                                <td class="Data"><input type="text" value="" name="User__Password" title="Passw" size="10" /></td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>


I would like to integrate both of them to put the User__loginname and the User__password in the right place of the first form.
Or do you have another solution ?

Jacques

Re: Integrating DAI in Visual Dataflex Webapp

PostPosted: Wed Mar 14, 2012 11:05 am
by Eddy Kleinjan
Hi Jacques,

You can also try to put this into an iframe on your page by feeding it a formatted url. You can find the URL to use on the report documentation page.

For example: http://localhost/ai6demo/ai.asp?UID=adm ... &DAI_R=229

Hope this helps!

Eddy Kleinjan

Re: Integrating DAI in Visual Dataflex Webapp

PostPosted: Wed Mar 14, 2012 2:23 pm
by Jacques
Eddy,

The problem is that you see the login and password on the URL

Jacques

Re: Integrating DAI in Visual Dataflex Webapp

PostPosted: Wed Mar 14, 2012 2:32 pm
by Eddy Kleinjan
Hi Jacques,

That is true of course. Unfortunately, you will have to pass either the userid/password or a ticket id to Dynamic AI at some point in order for it to grant you access to reports.

From within Visual DataFlex you can use the Dynamic AI library to put Dynamic AI reports as control on your Windows program. This uses a technique that we call ticket authentication. You can read about this in the helpfile for the Visual DataFlex Dynamic AI library.

This probably could be changed so that you can also use this ticket authentication system for web based access, but one way or the other, people will be able to see the url. The password is never shown though. Tickets live for 15 minutes. That means that if someone catches the URL, the will be able to use that URL for 15 minutes. They will not have access to other parts of Dynamic AI outside the scope of the URL. That means that they will only be able to view the exact same report with passed filter values for which the ticket has been handed out.

Is this what you are looking for?

Best regards,

Eddy

Re: Integrating DAI in Visual Dataflex Webapp

PostPosted: Wed Mar 14, 2012 2:56 pm
by Jacques
Eddy,

I'll try it (If I can). I thougth that using the html form described at the begin of this discussion, I would be able to open the report without showing the login and password.
I perhaps can use it in a popup windows. In this way, I'll be perhaps sure that the session will be closed when the user leaves the window.

With the URL, I think I have a problem from session count. At the moment, DAI tells me that 3 users are connected and that once, it were 4. I am alone using DAI.
If I go to the administrative tools - users - active sessions - liste of users I see that 2 sessions are opened on my name. It's something wrong on it.

To use the URL, do I need to put a special parameter to the user ? when I open ai6 and put the login and the password of a test user, I see the reports he may use. If I try to open directly the report with the URL of the report, it ask me the login and password (I put the same one) but after that, the program is blocked. I don't see the report.

Jacques

Re: Integrating DAI in Visual Dataflex Webapp

PostPosted: Wed Mar 14, 2012 3:24 pm
by Eddy Kleinjan
Hi Jacques,

Whether or not the menu is shown depends on the URL parameters that you pass. In order to see a full menu enviroment (as opposed to seeing the report itself) you need to add the parameter &MENU=F to the url. Like this:

http://localhost/ai6demo/ai.asp?UID=adm ... 229&MENU=F

In order to be able to give you an good advice, can you describe to us what it is that you trying to accomplish?

Eddy Kleinjan

Re: Integrating DAI in Visual Dataflex Webapp

PostPosted: Wed Mar 14, 2012 3:53 pm
by Bob Cergol
PMJI....but in cases where I had to provide a URL to execute a Dynamic AI report I created a generic user credential with privileges to run the report -- but with no privilieges to navigate menus, explore databases etc.

I wasn't too worried about users studying the URL and noticing they might be able to attempt to login to Dynamic AI separately because if they tried all they would get was a blank page.

Worst case scenario is they could try random report ID's in the URL to see what they might get. I wasn't publishing these URL's to the world -- rather to limited end-users and customers.

Bob

Re: Integrating DAI in Visual Dataflex Webapp

PostPosted: Wed Mar 14, 2012 3:59 pm
by Jacques
I have a webapp application and I want to open a DAI report from the webapp menu without asking the user his login and password but using the properties of the user to manage the reports (Restrictions, ...)

Re: Integrating DAI in Visual Dataflex Webapp

PostPosted: Wed Mar 14, 2012 4:05 pm
by Bob Cergol
Jacques,

I'm pretty sure you can do this but it requires knowing how to generate the HTML in your WebApp. Dynamic AI gives you the means to do this but you have to know what to do with those means. I've not done too much with WebApp and I'm no HTML or Javascript expert so I can't tell you explicity how.

I know another developer who is already doing this with other interfaces and when I recently showed him the Dynamic AI integration stuff, he indicated he knew exactly what to do to use the "form post" method of invoking the report from his WebApp. I'll see if I can get an example from him.

Regards,
Bob

Re: Integrating DAI in Visual Dataflex Webapp

PostPosted: Wed Mar 14, 2012 4:21 pm
by Eddy Kleinjan
Hi Jacques,

Are the filter values that need to be applied also depending on the user and have different users different values?

My guess is that we need to explore the way the URL is compose in the Visual DataFlex library and provide a way so that you can get that URL and publish that. That URL should use the ticket authentication system so that even though someone gets hold of a complete URL, it will be useless after x minutes. This will provide the best protection that we can offer at this moment since it only exposes the user id in which context the report needs to be runl; not the password.

Is this what you are looking for?

Eddy Kleinjan

Re: Integrating DAI in Visual Dataflex Webapp

PostPosted: Wed Mar 14, 2012 4:53 pm
by Jacques
The filter values will be applicated in DAI depending of the user.
An other idea were to create in the .wo the HTML file with the actual user and password and open it from the asp file. If the Html file is created in a apphtml subdirectory with the name of the user, it should run and have no problem if more than one user wanted to open the same report.

Anyway, I'll try to make the standard reports from DAI. We'll see if we really need to integrate it in the webapp menu.

Jacques

Re: Integrating DAI in Visual Dataflex Webapp

PostPosted: Wed Mar 14, 2012 7:04 pm
by Eddy Kleinjan
Hi Jacques,

Ok, thanks. Just let me know if you need any help.

Eddy Kleinjan