Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Creating a table from Data Connection

Avatar

Former Community Member
Am using Live Cycle Designer 7.1. I want to create a table in my form which shows data from a table in the database. I have created a data connection in my data view using Microsoft OLE DB Driver for ODBC drivers. I read in documentation that the Data View palette identifies any items that could be tables. But I dont see that my Data View identifies like that. As a result when I drag and drop those fields, all I see is 1 Row where I want all rows from the database a table.
10 Replies

Avatar

Level 5
You could try using SQL option rather than Table selection while creating DataConnection. You can write your own Select statement if you use SQL option.



Good luck,

SekharN

Avatar

Former Community Member
Sekhar,



Thanks for the reply. I tried even that option, but it didnt work. I observed something with my data connection. In the hierarchy, I see the Data Connection and below it all the columns of my table. But if I see Live Cycle Designer help, I observed that there is Data Connection on top and in that a Data Group and in that Data Group all the columns. So how to get this Data Group in my hierarchy?

Avatar

Level 5
Provider=MSDASQL.1;Persist Security Info=false;User ID=<usrID>;Mode=Read;Extended Properties="DRIVER=SQL Server;SERVER=<SQLservername>;UID=<userID>;APP=Adobe LiveCycle Designer;WSID=<workstationID>;DATABASE=<databasename>"<br /><br />This is how my connect string looks like. Before you start working with DataConnection you need a userDSN or systemDSN. Try to build your connect string based on the DSN. However this option requires DSN with name and properties on each machine that you access this form/template. Unfortunately this a limitation documented no ware in Adobe LiveCycle documents. After you create DataConnection based on the DSN you will see all the column names listed under DataConnection. For now I would not worry about Data Group.<br /><br />Regards,<br />SekharN.

Avatar

Former Community Member
Thanks again. But hey, I can see the Data Connection and the columns underneath. If I drag the columns, all I get is one row. I can test that pdf and the first row in the table appears in the respective fields. But I want to display the entire table(all rows) in my form.

Avatar

Level 5
I misunderstood. That is what you get(always first row) with the default way it is setup. If you need to display multiple rows you need to save the form as dynamic template and loop through the results of DataConnection and store the values in memory and then use InstanceManager to add dynamic rows reading values from memory. Check for the code under 'initialize' event of the Data Drop-down list available under 'Custom' tab in Library pallet.



Hope that helps,

SekharN.

Avatar

Former Community Member
I have a form called 'outside'. In that, there is a subform called 'inside'. In that there are 4 text fields to contain data from 4 columns. Now, I have to add an instance of 'inside' for every row in the table right?



I have written this line,



xfa.form.form1.outside.inside.instanceManager.



After every dot, Livecycle designer is prompting me the available functions or child nodes in a drop down. Everything was prompted so far correctly. But when I stop at the above line of script, LC designer does not prompt me 'addInstance' at all. Instead I see 'instanceManager' again. I thought may be its a bug and finished the line as I wanted.



xfa.form.form1.outside.inside.instanceManager.addInstance()



But nothing happens when the script is executed.

Avatar

Level 5
Replace the following line

xfa.form.form1.outside.inside.instanceManager.addInstance()

with

_instance.addInstance(1);



Then make sure you have set the following for instance subform under Object pallet.



1. in 'Subform' tab set Content: as 'Flowed'

2. in 'Binding' tab check 'Repeat subform for Each Data Item'



Good luck,

SekharN.

Avatar

Former Community Member
Hmm..followed all the steps, but still didnt work. I have Live Cycle designer 7.1. In the Form Properties --> Defaults, I have set XDP Preview Format and PDF Render Format to 'Acrobat 7.0 Compatible Dynamic PDF'. Anything else am missing?

Avatar

Level 5
I ran into hard times making this kind of scenario work for me. It is hard to guess what is going wrong with out looking at your code. Those properties looks good to me. Can you email me a copy of your template at 'meetsekhav AT yahoo.com'. I am going home for today but Will try to help you tomorrow.



Regards,

SekharN

Avatar

Former Community Member
Since, I dont know how to send the template. I have copied the XML source into notepad, saved it as XML file and attached the same. Let me know if thats not what you meant.