Expand my Community achievements bar.

Problem with the export order

Avatar

Former Community Member
Afternoon all:



I'm having a problem with the fields not exporting in the expected sequence.



There seems to be no consistent order to the export of fields either--I am expecting it to follow the tab order and it doesn't.



I also tried setting the field names alphabetically (since you cannot start a field with a number) with no luck.



Looking through the KB and this forum didn't provide any enlightenment either so any help is appreciated.



Regards,



--Steve
14 Replies

Avatar

Former Community Member
How are you parsing or processing the resulting document? The information that's exported is identifiable, so using the document structure to find the information you want, rather than the position of the fields in the document, would give you better results.. is this possible?



--

SteveX

Adobe Systems

Avatar

Former Community Member
Hi Steve:



As a newbie to this, I've just created my first on-line form and done my first export (as XML) and import into Excel as a CSV (trying to keep it K.I.S.S. for the client's needs). They may want to look at a database in the future, but for now, I'm dumping it into a spreadsheet which is why I'd like to control the structure of the output.



So if you can point me to some examples on how to use the document structure, I won't waste anyone's time with "on-line form 101" type questions.



Thanks for the help!

Avatar

Former Community Member
There are a few ways you could do it.. here's some suggestions..



If you're familiar with Excel macros, you could write an Excel macro that would take the imported data and format it the way you want it displayed.



If you're familiar with XSLT (okay, well, nobody is really familiar with XSLT, but if you can write enough XSLT to get the job done) you can use that to transform the document into the format that you want.



Have you tried ordering the fields in your form in the Hierarchy View so that they're in the order you want imported? I don't know if we guarantee that the order of the fields won't change, but I tried it in a test form and I find the output I get is always in the order that I've arranged the fields in the hierarchy.



The tab order wouldn't affect the order that the data gets written out in, but the hierarchy order would.



--

SteveX

Adobe Systems

Avatar

Former Community Member
Steve:



Well, I've been looking for an excuse to learn about XSLT. (GRIN)



I was wondering if I needed to create some type of XML Schema file and reference it "somewhere" in the form to get the resulting XML output in a format I could pull in easily. (Like I said this is all new territory for me)



Not to sound dumb but Hierarchy view in Excel or are we talking something within Designer that I haven't discovered yet?



TIA



-Steve

Avatar

Former Community Member
Sorry, the hierarchy view in Designer. If it's not visible (it's usually on the left side), look for it in the Window menu.



It gives you a tree view showing everything in your form; you can drag and drop within the tree to reorder nodes.



--

SteveX

Adobe Systems

Avatar

Former Community Member
Steve:



No problem; Sorry about the newbie questions. So I assume Designer uses an XML Schema to create the XML data file that the users will e-mail.



Is this a editable file or should it not be edited?



If it can't, can a copy be modified with my fields to achieve the desired output?



How would I point the submit output to this new XML Schema?



Thanks fro your patience!

Avatar

Former Community Member
If you're using a schema, then the generated XML will conform to that schema - you'll have to create the XSD yourself (Designer doesn't give you a way to do that), and then create a data connection in Designer using that schema.



Once you've got that you can drag fields from the Data View inspector onto your form to hook up the fields to the data model defined by the schema - and then when you submit, what you get will match the schema.



It's a bit more work (unless you already have the schema) but hopefully this will give you what you need..



--

SteveX

Adobe Systems

Avatar

Former Community Member
This is exactly my problem but exporting the data in the same order that it displays in the form is exactly what I *don't* want it to do.



I have about eight data entry fields which are properly output in sequence within the same XML record but there is another data entry field which doesn't belong in that record - but I need it to display it in the middle of the other eight on the form. How can I do that?



Failing that, can I export the same data field twice, i.e., so I can export it in the right place even if it is also in the wrong one?



Thanks.

Avatar

Former Community Member
Create a schema for your data, and start from that. With a schema, the data is already defined and you're hooking fields up to that data; if you don't have a schema, then the fields themselves are defining the data model that your form is going to export.



Once you import the schema, you can drag fields from the Data View onto the form and it doesn't matter where you put them.



I've attached a simple sample that uses the Purchase Order schema from the Designer samples and just hooks up a small form to it, so you can see what I mean. Type some values into the fields, hit the Email button, and look at the XML that gets generated - the XML is generated exactly as specified in the schema.



--

SteveX

Adobe Systems

Avatar

Former Community Member
OK, I'm starting to get the idea, thanks.<br /><br />Do I understand correctly that if I create a schema (which I have to figure out how to do) and import it (which I have to figure out how to do) and drag fields onto the form instead of creating them from scratch (which I have to figure out how to do <g>)...then I can distribute the PDF and it stands alone? That is, I don't have to distribute the XSD file too, right?<br /><br />I'll figure it out. Before I set off down the road, I just want to make sure that I'm headed for the right destination.<br /><br />Thanks.

Avatar

Former Community Member
Thanks Steve for the help!



FYI, I discovered the Sample XML file option as well. My preliminary stab at that seems to be work as well. I'll post when I get success.



Again, thanks so much for the help!



P.S. - I'll also look at the attachment you included!

Avatar

Former Community Member
Bob - you can embed the schema in the XDP file, so you don't need to distribute it separately. This follows through to the PDF so yes, your distributed form will still follow those rules.



Take a look at the Purchase Order schema - you can probably use that as a starting point for your own. To import it, switch to the Data View, right-click in it, and you'll find the option there. This will bring up a wizard and walk you through importing it.



Once it's in, you'll see a tree of form fields you can drag onto the form. It's the best way to create a form really - start with a schema that defines the data that you want the form to gather, and then build the form around it.

--

SteveX

Adobe Systems

Avatar

Former Community Member
Okay:<br /><br />I'm getting the content into a usable format now, but I am having two issues when the XML is imported into Excel:<br /><br />1. The following header is added when the XML file is imported into Excel:<br /><br /> form1[0].Page1[0].<FIELDNAME><br /><br />As a real world example:<br /><br /> form1[0].Page1[0].Assoc_Dept[0]<br /><br />2. The data fields are also being reorganized into alphabetical order instead of following the designed structure in the Hierarchy (and resulting XML file).<br /><br />Any suggestions on what I am missing? Have we journeyed outside of an Acrobat issue into an MS issue?<br /><br />Thanks again!

Avatar

Former Community Member
Hello Forum,



I have the same question as #1 above... when I do an extract to spreadsheet, the Excel header row has the full heirarchy form1[0].subform[0].Field[0].



While I understand why this happens, it is not optimal for my users' experience, because they have to do a couple search/replaces in order to make the header row readable.



Any thoughts on how to ameliorate this?



Thanks.