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.

Dynamic XML PDF not importing fields

Avatar

Level 2

I have a PDF developed in Livecycle and saved as a dynamic XML.

My database is MS Access and from this I've exported a query saved as an XML file, a XSD schema and an XSL stylesheet. (files attached)

I'm trying to populate the PDF from the above mentioned files client-side. I have the fields set up to display in a table with repeating rows.

It seems that I've set everything up okay and I get no error generated in the log file when I preview the PDF in Livecycle, but, the fields are not

being generated.

I suspect maybe this is because I don't have the nested forms set up properly for a flowed subform. But I should get at least the first row generated

shouldn't I, if it is reading the nodes in the XML?

Attached is (a mock-up) of the PDF along with the XML, XSD and XLS. This form should flow to other pages when dynamically built and I'm hoping to

display the header on each page (the header will be on the Master Page -- it will contain site links, etc.)

I hope to not only import data to a PDF this way but also to export fields from the PDF in the same way for database edits...

Can anyone tell me what I'm doing wrong in the attached?

And, on another note... do all of the above need to be in the same folder together on the server or can I put the PDF in one folder and the XML, XSD

and XLS a different folder? (Or the PDF and XLS in the same folder and XML and XSD files in a different folder, etc.)...

Thanks for any reponses on this.

- ed

PS: Below is the XSD schema code (since I can only upload the 3 other files here)

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:od="urn:schemas-microsoft-com:officedata">
<xsd:element name="dataroot">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="WMS_x0020_BMI_x0020_Percentile_x0020_ZScore" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="generated" type="xsd:dateTime"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="WMS_x0020_BMI_x0020_Percentile_x0020_ZScore">
<xsd:annotation>
<xsd:appinfo/>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="LastName" minOccurs="0" od:jetType="text" od:sqlSType="nvarchar">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="255"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Firstname" minOccurs="0" od:jetType="text" od:sqlSType="nvarchar">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="255"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="PreHeight" minOccurs="0" od:jetType="text" od:sqlSType="nvarchar">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="50"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="PreWeight" minOccurs="0" od:jetType="text" od:sqlSType="nvarchar">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="50"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="PreBMI" minOccurs="0" od:jetType="double" od:sqlSType="float" type="xsd:double"/>
<xsd:element name="PreBMIPercentile" minOccurs="0" od:jetType="double" od:sqlSType="float" type="xsd:double"/>
<xsd:element name="PreZScore" minOccurs="0" od:jetType="double" od:sqlSType="float" type="xsd:double"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

5 Replies

Avatar

Former Community Member

The preview type (File > Form Properties > Preview) is set to "Print Form (one-sided)". Change the preview type to "Interactive" and you should be good to go.

Steve

Avatar

Level 2

Thanks, Steve.

I didn't realize this preview setting would change the dynamics of the form... but I'm glad to know this now.

I changed to this setting on the (previously attached PDF) file but it's still not importing the XML nodes.

I did notice after reading other forum posts here that I had the nested forms set to flow in the wrong sequence. The table for displaying the dynamic rows is wrapped in a subform and this is inside another subform. I reset the table subform to "positioned" and the form wrapped around the table form to "flowed"... but it's still not importing the data fields in the row. (After reading other posts I'm wondering if I should not try to do this in a table. Seems tables can be a lot of trouble on displaying dynamic data...)

I'm thinking that the integrity of the XSD file and XSL file are okay since they were output from the same program (Access 07) at the same time. So... I'm at a loss as to why it's not importing the fields - at least the first row, even if the 'flow' setting was incorrect.

Thanks again for the response and anyone else's response as well.

- ed

Avatar

Level 4

All,

I am a bystander watching this thread, as creating a new pdf from all these different files is of great interest to me. I am interested in more than the question at hand.

Nessmuk, I have been able to get to the point of viewing your file in preview mode, but it looks just like your form in Design View. As I understand it, the XSL file should define how the form appears in preview. How does the XSL file connect to the pdf?

Thanks, and I look forward to seeing this thread being resolved.

Graham

Avatar

Level 2

Sorry for the delay in replying to this post. I got stuck at a friend's from the weekend snow we had... and am finally back on my own computer.

Just before leaving Friday I found the problem with the form not displaying data fields read from the XML.

It's a bit embarrassing to admit but, per Steve's instruction here to change the form preview properties (file/form properties) (thanks, Steve!) - I changed the preview from 'print one-sided' to 'interactive' and noticed that I had not set up the link to the XML under 'Data File'. Duh! So, it is reading the data from the XML now.

However... For the form to display, I had to (under 'connection properties) take the XSLT file off. Under 'Connection Properties' the form is set up as XML Schema with the link to the XSD set up.

The problem now is that a few of the dynamic fields are numbers. These number fields in the database only have two digits to the right of the decimal point (as in 93.79) but when the form loads these fields in the table in preview mode these fields contain 8 digits to the right of the decimal point (as in 93.79362082). I don't know why this is except that maybe it is because it's no longer reading from the XSLT file. All I want it to do is read the field exactly as it is in the database...

The table on the form doesn't display as it should either. The table expands with the rows its presenting but this runs to the very bottom of the page and doesn't flow to the next page. I've tried changing the size of the 'root' form on the Master page as well as the size of the 'parent' subform of the table subform but the table still runs to the bottom of the page... I'll keep playing around with this until I fix it unless someone can point me in the right direction...

Thanks for any leads on this...

(new corrected file attached)

Graham, this stuff really is interesting! These handful of files working together to build a dynamic PDF, reading the database XSD schema, an XML file and the XSL file as well as throwing in some Javascript functions is really cool... I'm also (hopefully) planning to have Cold Fusion query the database, depending on the login person's admin privilages, parse the fields from the database and build the XML file from this data 'on the fly' at login... Quite a lot going on in the background here to build the PDF! (I wish I could answer your question about the stylesheet but, obviously from the above, I'm a novice at this - I'm new at this and trying to grope my way around this stuff in the dark. These forums have been helpful as well as googling questions, but, there is still a learning curve here. I'm pretty rough with Javascript as well and that's a big feature of this stuff...)

Thanks to anyone for direction on getting this file to display properly and the number fields to show the same as in database...

- ed

Avatar

Level 1

Select Cell Object -> Object Window -> Cell Tab -> Patterns -> Display -> Pattern: num{z,zzz,zz9.99} -> Apply -> OK -> Preview Tab

Will display up to two decimal places.