Importing data into an Infopath form...

P

Peter Ghali

I've been trying (quite unsuccessfully) to create an import routine for an
Infopath form. I'm desperate for some help on this.

Using VB.Net and SP1:
When the user clicks a button on the infopath form, a file dialog prompts
them to locate an xml file. Upon selection, the routine populates a specific
repeating section in the active document with the corresponding data from the
selected document. The routine should preserve any hierarchy that exists
inside the repeating section.

Does anyone have a VB.Net code sample that can do this?
 
P

Patrick Halstead [InfoPath MVP]

Hi Peter,
Are you using the Merge Forms functionality in InfoPath? Should be pretty
straightforward. Take a look at the Issue Tracking and Meeting Agenda
samples that come with the product for an example of how to do this without
writing code. To get the button in the view, you'll have to write some code,
and I'm not sure it's easily doable. My advice would be use the default
File->Merge functionality.
Regards,
Patrick
http://www.autonomysystems.com/
 
P

Peter Ghali

Thanks Patrick, but Infopath's merge functionality doesn't meet my needs.
That's why I'm writing it in code.

For example, I have a form with several repeating sections, and my user
wants to explicitly import data into only one of the repeating sections, and
ignore the rest. Infopath's merge will attempt to merge all the source data
in to all of the repeating sections, which in this case would be disastrous.
They need a greater degree of granularity over what gets imported.
 
P

Patrick Halstead [InfoPath MVP]

Hey Peter,
Of course, default merge won't work, but I was suggesting you use custom
merge. Anyway, it's documented in the SDK.
Good luck,
 
P

Peter Ghali

Oh! I didn't know anything about "custom" merge. My xsl skills are pretty
weak, but this appears to be much simpler to figure out than the approach I
was trying.

This will work. Thanks for the advice Patrick.

--Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top