Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Database Connection

Avatar

Former Community Member
Im new to working with Livecycle. I am attempting to connect to a SQL database. Im able to setup the connection easy enough and select the table i want to query, but when I enter the field in to the binding section and test it. the field only displays the first value. Ive tied it different ways with different types of objects (list box, combo box, ect) .any ideas what Im missing...?
64 Replies

Avatar

Former Community Member
Your email address just came back as invalid ..is there a typo?

Avatar

Former Community Member
diefeuerwolke@web.de



sry... didn't reread it ^^

Avatar

Former Community Member
Hi Paul,



could you send me the data view sample files as well?



Thank you, Thomas



mac00d@gmx.net

Avatar

Former Community Member
Hi Paul,



Could you send me the sample as well?

My email: ivor_ho@hotmail.com



Thanks.

Avatar

Level 7
me to me to .... please



aditya.shah@gsinc.com



Thanks !!

Avatar

Level 1

Hi Paul, 

could you send me the data view sample files ? 

revelly.gb@free.fr

Thanks !!!!!!

Avatar

Former Community Member

Now that we have attachment support on the forum I can simply attach them here. Note that if you want to use database connections with Reader the form must be Reader Extended using LiveCycle Reader Extensions server to allow this.

Paul

Avatar

Former Community Member

Hi Paul!

Thank you VERY much for attaching the PDF files, it works wonderfully!

I do have 1 question if you have a moment... Rather than capturing the data already in the DB on enter - would it be possible to simply AddNew() on Enter and append the data to the DB table?

Also, do you know if I can distribute this PDF file to other end users without having them establish the database connectivity on each of their machinces?

I'm using this internally, and both the MS DB and PDF file are available on the network drive so all users have rights to the edit/view the MS DB.

Thank you very much!

Chris

Avatar

Former Community Member

Depending on the DB being used in most cases you have to create a new record in the DB (addnew) then update that record. That means you need two operations to accomplish this.

Each machine that loads the form will have to create a DSN on their local machine. This is why we do not recommend this approach as it involves creating and maintaining that data conenction on each machine. If there is a small number of users then it is not too bad....if this is an enterprise solution and there is a large number of users then this becomes a bigger issue.

Avatar

Level 1

Hello Paul,

You seem to be one of the few people that understand this subject. I am new to LifeCycle Designer ES, having done the tutorials I  still have a huge hole in my knowledge for the project I am trying to complete.

My project requires that from a php page which is displaying information from MySql (say  purchase order information) a button (print this) is pressed and the same information on the previous php page populates a PDF form. In this instance the PDF is being used for layout/design and corporate identity purposes only and the purchase order information does not need to be editable on the PDF.

The client would be using Acrobat  Reader (in their browser) to view and print the PDF.

The user will be anyone in the world - so no client DSN connections are possible.

They would also at times need to save the PDF with all information so that they can email it.

This is on a shared hosting environment, so installing server upgrades is probably not going to be permitted.

I am working with a php programer - but I need to find the right direction for her to follow (no experience with pdf forms) so a sample would be very helpful.

Is this even possible?

Thanks VERY much for your time.

jim

Avatar

Former Community Member

So if I understand your requirement your PHP program will extract the data from the database and display the results as an HTML page that you need to turn into a PDF. If this is correct then there is no need for database connectivity software on the client as your PHP is taking care of that. What you need is an ability to turn the HTML page into a PDF. There are two ways that I know of to do this:

1. Adobe Acrobat - you could point Acrobat at your PHP URL and the results would be turned into a PDF. You cannot legally load Acrobat on your server and automate it. This means each user woudl have to have a copy (making this solution undesirable in your case)

2. LiveCycle PDF Generato (PDF/G) - This is a server based product that is used to automate the creation of PDFs. It actually calls the same libraries that Acrobat uses (they have been modified to run safely on the server). Your PHP program could call PDF/G pass the results and have a PDF generated that can be returned to the browser. This is server based software and is priced as such.

I am sure there are other solutions out there (as PDF is a standard) but I am not aware of any others that i woudl recommend.

Hope that helps

Paul

Avatar

Level 1

Paul, thanks so much for your quick reply.

I will look into LiveCycle PDF Generator for server requirements and pricing (I fear that it will be cost prohibitive)

More of a gripe than a question (my apologies in advance):
It just seems to me that if LiveCycle PDF forms can read XML then why can't a path (absolute URL) be used as a parameter while creating the form and then when the PDF is opened in the browser (Acrobat Reader) it looks for the XML (via the URL parameter) and inputs the form data. That sounds so simple I am sure it can not be done - I guess then Adobe would not be able to sell as much server software.

Again, thanks for your input!!

jim

Avatar

Level 7

Hi Paul,

how we can modify one of your samples so we be able to display data from specific record?

Thanks

Avatar

Former Community Member

The SQL that is executed to get the specific record is what is required. In the sample that you send you modified the SQL statement but you do not have a where clause. Typically you woudl have something like Select * from Table where rowData ='"somevalue'. IN your case I woudl suspect that the selcteion in the DDList is the column you want to query and the actual value woudl be what th euser selected. So added that to the expression woudl yield:

Select * from Table where rowData = "'" + DDlist.rawValue + "'"

The "'" is a double quote, single quote, double quote. This results in teh value of the DDList pbeing put in single quotes in the expression. I do not know how you will determine which Department 1 that the user wants as you have multiple Department1 values in your DB. Usually you woudl provide something that is unique so that you know specifically which record they want to look at.

Hope that helps

Paul

Avatar

Level 7

Hi Paul,

I have a form that it been use a lot from different departments on daily base.

I have modify your sample(database_ShowMultipleRecord) and works fine!

My question it is:

How I can modify your sample(database_ShowMultipleRecord) so I can have all  data from a specific department ?

For example using a Drop down box with all departments including, so when I select a department to populate

all it's data(with repeating subform same as your sample).

Thanks Paul for all your help in this matter

Avatar

Former Community Member

Forget about the form for a moment .....if I was using a query tool what SQL woudl I write to get the data that you want?

Paul