Group:  Other Microsoft Office Products ยป microsoft.public.infopath
Thread: Merge List Box rows to text box

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Merge List Box rows to text box
Hasse 18.07.2006 07:29:02
Hi,

In my InfoPath form I have a List Box with several rows of data collected
from a SharePoint list.
If I would like to use vb script to merge all the rows so it will look
something like this: row1data;row2data;row3data;..... and put it in a Text
Box how can I accomplish that?

Any assistance would be highly appreciated,
Hans
RE: Merge List Box rows to text box
S.Y.M. Wong-A-Ton 18.07.2006 18:37:02
If your list box is being populated by a secondary data source, you can
retrieve the data source in code (by using e.g.
XDocument.GetDOM(<data_source_name>)), select the rows under the main group
node for the rows (using selectNodes() on the DOM of the secondary data
source), and then loop through all the rows while you build a string and
concatenate the values you need, and then write the results to the text box
(using XDocument.DOM.selectSingleNode(<xpath_to_text_box>).text = value)

Search this newsgroup on the functions I've mentioned (GetDOM, selectNodes,
selectSingleNode) to find examples on how to get this done.
---
S.Y.M. Wong-A-Ton


"Hasse" wrote:

[Quoted Text]
> Hi,
>
> In my InfoPath form I have a List Box with several rows of data collected
> from a SharePoint list.
> If I would like to use vb script to merge all the rows so it will look
> something like this: row1data;row2data;row3data;..... and put it in a Text
> Box how can I accomplish that?
>
> Any assistance would be highly appreciated,
> Hans
RE: Merge List Box rows to text box
Hasse 19.07.2006 09:38:01
Hi,

Thanks for trying to help me with this but after looking around in the
newsgroup I have to admit that I have not become any wiser.
Can you please explain this a little bit more and maybe provide me with some
code?
And yes, my List Box is being populated by a secondary data source,
SharePoint Contacts List.

Regards,
Hans

"S.Y.M. Wong-A-Ton" wrote:

[Quoted Text]
> If your list box is being populated by a secondary data source, you can
> retrieve the data source in code (by using e.g.
> XDocument.GetDOM(<data_source_name>)), select the rows under the main group
> node for the rows (using selectNodes() on the DOM of the secondary data
> source), and then loop through all the rows while you build a string and
> concatenate the values you need, and then write the results to the text box
> (using XDocument.DOM.selectSingleNode(<xpath_to_text_box>).text = value)
>
> Search this newsgroup on the functions I've mentioned (GetDOM, selectNodes,
> selectSingleNode) to find examples on how to get this done.
> ---
> S.Y.M. Wong-A-Ton
>
>
> "Hasse" wrote:
>
> > Hi,
> >
> > In my InfoPath form I have a List Box with several rows of data collected
> > from a SharePoint list.
> > If I would like to use vb script to merge all the rows so it will look
> > something like this: row1data;row2data;row3data;..... and put it in a Text
> > Box how can I accomplish that?
> >
> > Any assistance would be highly appreciated,
> > Hans
RE: Merge List Box rows to text box
S.Y.M. Wong-A-Ton 19.07.2006 17:04:01
The steps I outlined are the steps you need to take; I cannot explain more
unless you have a more specific question. I'm very tight on time these days,
so give me a couple of days and I might be able to put together a solution
for you and post it on my website by next week.
---
S.Y.M. Wong-A-Ton


"Hasse" wrote:

[Quoted Text]
> Hi,
>
> Thanks for trying to help me with this but after looking around in the
> newsgroup I have to admit that I have not become any wiser.
> Can you please explain this a little bit more and maybe provide me with some
> code?
> And yes, my List Box is being populated by a secondary data source,
> SharePoint Contacts List.
>
> Regards,
> Hans
>
> "S.Y.M. Wong-A-Ton" wrote:
>
> > If your list box is being populated by a secondary data source, you can
> > retrieve the data source in code (by using e.g.
> > XDocument.GetDOM(<data_source_name>)), select the rows under the main group
> > node for the rows (using selectNodes() on the DOM of the secondary data
> > source), and then loop through all the rows while you build a string and
> > concatenate the values you need, and then write the results to the text box
> > (using XDocument.DOM.selectSingleNode(<xpath_to_text_box>).text = value)
> >
> > Search this newsgroup on the functions I've mentioned (GetDOM, selectNodes,
> > selectSingleNode) to find examples on how to get this done.
> > ---
> > S.Y.M. Wong-A-Ton
> >
> >
> > "Hasse" wrote:
> >
> > > Hi,
> > >
> > > In my InfoPath form I have a List Box with several rows of data collected
> > > from a SharePoint list.
> > > If I would like to use vb script to merge all the rows so it will look
> > > something like this: row1data;row2data;row3data;..... and put it in a Text
> > > Box how can I accomplish that?
> > >
> > > Any assistance would be highly appreciated,
> > > Hans
RE: Merge List Box rows to text box
Hasse 20.07.2006 08:17:02
Hi,

I can wait until next week if you can provide me with a solution.
To help you do this I shall try to explain what I wan't to do.
In SharePoint I have a Contacts List with columns for E-mail address and
Group.
In my InfoPath form I get the E-mail address from all contacts that belongs
to the groups Market and Coordinator in to a List Box. Wen clicking on a Send
Mail button
I wan't to, using VB-script, merge the E-mail addresses in my List Box and
put them in the To field in my mail, like,
recipient1[ at ]mail.com;recipient2[ at ]mail.com;recipient3[ at ]mail.com.
Hope this is enough for you to solve this problem of mine.

Regards,
Hans

"S.Y.M. Wong-A-Ton" wrote:

[Quoted Text]
> The steps I outlined are the steps you need to take; I cannot explain more
> unless you have a more specific question. I'm very tight on time these days,
> so give me a couple of days and I might be able to put together a solution
> for you and post it on my website by next week.
> ---
> S.Y.M. Wong-A-Ton
>
>
> "Hasse" wrote:
>
> > Hi,
> >
> > Thanks for trying to help me with this but after looking around in the
> > newsgroup I have to admit that I have not become any wiser.
> > Can you please explain this a little bit more and maybe provide me with some
> > code?
> > And yes, my List Box is being populated by a secondary data source,
> > SharePoint Contacts List.
> >
> > Regards,
> > Hans
> >
> > "S.Y.M. Wong-A-Ton" wrote:
> >
> > > If your list box is being populated by a secondary data source, you can
> > > retrieve the data source in code (by using e.g.
> > > XDocument.GetDOM(<data_source_name>)), select the rows under the main group
> > > node for the rows (using selectNodes() on the DOM of the secondary data
> > > source), and then loop through all the rows while you build a string and
> > > concatenate the values you need, and then write the results to the text box
> > > (using XDocument.DOM.selectSingleNode(<xpath_to_text_box>).text = value)
> > >
> > > Search this newsgroup on the functions I've mentioned (GetDOM, selectNodes,
> > > selectSingleNode) to find examples on how to get this done.
> > > ---
> > > S.Y.M. Wong-A-Ton
> > >
> > >
> > > "Hasse" wrote:
> > >
> > > > Hi,
> > > >
> > > > In my InfoPath form I have a List Box with several rows of data collected
> > > > from a SharePoint list.
> > > > If I would like to use vb script to merge all the rows so it will look
> > > > something like this: row1data;row2data;row3data;..... and put it in a Text
> > > > Box how can I accomplish that?
> > > >
> > > > Any assistance would be highly appreciated,
> > > > Hans
RE: Merge List Box rows to text box
S.Y.M. Wong-A-Ton 20.07.2006 18:00:02
If you are looking to merge email addresses, you can also do it without code
using the method described in this article:
http://blogs.msdn.com/infopath/archive/2006/04/05/569338.aspx
---
S.Y.M. Wong-A-Ton


"Hasse" wrote:

[Quoted Text]
> Hi,
>
> I can wait until next week if you can provide me with a solution.
> To help you do this I shall try to explain what I wan't to do.
> In SharePoint I have a Contacts List with columns for E-mail address and
> Group.
> In my InfoPath form I get the E-mail address from all contacts that belongs
> to the groups Market and Coordinator in to a List Box. Wen clicking on a Send
> Mail button
> I wan't to, using VB-script, merge the E-mail addresses in my List Box and
> put them in the To field in my mail, like,
> recipient1[ at ]mail.com;recipient2[ at ]mail.com;recipient3[ at ]mail.com.
> Hope this is enough for you to solve this problem of mine.
>
> Regards,
> Hans
>
> "S.Y.M. Wong-A-Ton" wrote:
>
> > The steps I outlined are the steps you need to take; I cannot explain more
> > unless you have a more specific question. I'm very tight on time these days,
> > so give me a couple of days and I might be able to put together a solution
> > for you and post it on my website by next week.
> > ---
> > S.Y.M. Wong-A-Ton
> >
> >
> > "Hasse" wrote:
> >
> > > Hi,
> > >
> > > Thanks for trying to help me with this but after looking around in the
> > > newsgroup I have to admit that I have not become any wiser.
> > > Can you please explain this a little bit more and maybe provide me with some
> > > code?
> > > And yes, my List Box is being populated by a secondary data source,
> > > SharePoint Contacts List.
> > >
> > > Regards,
> > > Hans
> > >
> > > "S.Y.M. Wong-A-Ton" wrote:
> > >
> > > > If your list box is being populated by a secondary data source, you can
> > > > retrieve the data source in code (by using e.g.
> > > > XDocument.GetDOM(<data_source_name>)), select the rows under the main group
> > > > node for the rows (using selectNodes() on the DOM of the secondary data
> > > > source), and then loop through all the rows while you build a string and
> > > > concatenate the values you need, and then write the results to the text box
> > > > (using XDocument.DOM.selectSingleNode(<xpath_to_text_box>).text = value)
> > > >
> > > > Search this newsgroup on the functions I've mentioned (GetDOM, selectNodes,
> > > > selectSingleNode) to find examples on how to get this done.
> > > > ---
> > > > S.Y.M. Wong-A-Ton
> > > >
> > > >
> > > > "Hasse" wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > In my InfoPath form I have a List Box with several rows of data collected
> > > > > from a SharePoint list.
> > > > > If I would like to use vb script to merge all the rows so it will look
> > > > > something like this: row1data;row2data;row3data;..... and put it in a Text
> > > > > Box how can I accomplish that?
> > > > >
> > > > > Any assistance would be highly appreciated,
> > > > > Hans
RE: Merge List Box rows to text box
S.Y.M. Wong-A-Ton 23.07.2006 15:44:01
Part of the solution to your scenario is given here:
http://enterprise-solutions.swits.net/infopath/generate-string-email-addresses-list-vbscript.htm

The other part should be pretty straightforward to produce now: For the
group you need to add an XPath filter when retrieving the contact rows. And
to fill the "To" field it is best to just set the "To" field's value equal to
the value of the "emailAddresses" field using a formula.
---
S.Y.M. Wong-A-Ton


"Hasse" wrote:

[Quoted Text]
> Hi,
>
> I can wait until next week if you can provide me with a solution.
> To help you do this I shall try to explain what I wan't to do.
> In SharePoint I have a Contacts List with columns for E-mail address and
> Group.
> In my InfoPath form I get the E-mail address from all contacts that belongs
> to the groups Market and Coordinator in to a List Box. Wen clicking on a Send
> Mail button
> I wan't to, using VB-script, merge the E-mail addresses in my List Box and
> put them in the To field in my mail, like,
> recipient1[ at ]mail.com;recipient2[ at ]mail.com;recipient3[ at ]mail.com.
> Hope this is enough for you to solve this problem of mine.
>
> Regards,
> Hans
>
> "S.Y.M. Wong-A-Ton" wrote:
>
> > The steps I outlined are the steps you need to take; I cannot explain more
> > unless you have a more specific question. I'm very tight on time these days,
> > so give me a couple of days and I might be able to put together a solution
> > for you and post it on my website by next week.
> > ---
> > S.Y.M. Wong-A-Ton
> >
> >
> > "Hasse" wrote:
> >
> > > Hi,
> > >
> > > Thanks for trying to help me with this but after looking around in the
> > > newsgroup I have to admit that I have not become any wiser.
> > > Can you please explain this a little bit more and maybe provide me with some
> > > code?
> > > And yes, my List Box is being populated by a secondary data source,
> > > SharePoint Contacts List.
> > >
> > > Regards,
> > > Hans
> > >
> > > "S.Y.M. Wong-A-Ton" wrote:
> > >
> > > > If your list box is being populated by a secondary data source, you can
> > > > retrieve the data source in code (by using e.g.
> > > > XDocument.GetDOM(<data_source_name>)), select the rows under the main group
> > > > node for the rows (using selectNodes() on the DOM of the secondary data
> > > > source), and then loop through all the rows while you build a string and
> > > > concatenate the values you need, and then write the results to the text box
> > > > (using XDocument.DOM.selectSingleNode(<xpath_to_text_box>).text = value)
> > > >
> > > > Search this newsgroup on the functions I've mentioned (GetDOM, selectNodes,
> > > > selectSingleNode) to find examples on how to get this done.
> > > > ---
> > > > S.Y.M. Wong-A-Ton
> > > >
> > > >
> > > > "Hasse" wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > In my InfoPath form I have a List Box with several rows of data collected
> > > > > from a SharePoint list.
> > > > > If I would like to use vb script to merge all the rows so it will look
> > > > > something like this: row1data;row2data;row3data;..... and put it in a Text
> > > > > Box how can I accomplish that?
> > > > >
> > > > > Any assistance would be highly appreciated,
> > > > > Hans
RE: Merge List Box rows to text box
Hasse 27.07.2006 10:50:02
Hi,

Thanks a lot for your solution.
Now it works perfect.

Regards,
Hans

"S.Y.M. Wong-A-Ton" wrote:

[Quoted Text]
> Part of the solution to your scenario is given here:
> http://enterprise-solutions.swits.net/infopath/generate-string-email-addresses-list-vbscript.htm
>
> The other part should be pretty straightforward to produce now: For the
> group you need to add an XPath filter when retrieving the contact rows. And
> to fill the "To" field it is best to just set the "To" field's value equal to
> the value of the "emailAddresses" field using a formula.
> ---
> S.Y.M. Wong-A-Ton
>
>
> "Hasse" wrote:
>
> > Hi,
> >
> > I can wait until next week if you can provide me with a solution.
> > To help you do this I shall try to explain what I wan't to do.
> > In SharePoint I have a Contacts List with columns for E-mail address and
> > Group.
> > In my InfoPath form I get the E-mail address from all contacts that belongs
> > to the groups Market and Coordinator in to a List Box. Wen clicking on a Send
> > Mail button
> > I wan't to, using VB-script, merge the E-mail addresses in my List Box and
> > put them in the To field in my mail, like,
> > recipient1[ at ]mail.com;recipient2[ at ]mail.com;recipient3[ at ]mail.com.
> > Hope this is enough for you to solve this problem of mine.
> >
> > Regards,
> > Hans
> >
> > "S.Y.M. Wong-A-Ton" wrote:
> >
> > > The steps I outlined are the steps you need to take; I cannot explain more
> > > unless you have a more specific question. I'm very tight on time these days,
> > > so give me a couple of days and I might be able to put together a solution
> > > for you and post it on my website by next week.
> > > ---
> > > S.Y.M. Wong-A-Ton
> > >
> > >
> > > "Hasse" wrote:
> > >
> > > > Hi,
> > > >
> > > > Thanks for trying to help me with this but after looking around in the
> > > > newsgroup I have to admit that I have not become any wiser.
> > > > Can you please explain this a little bit more and maybe provide me with some
> > > > code?
> > > > And yes, my List Box is being populated by a secondary data source,
> > > > SharePoint Contacts List.
> > > >
> > > > Regards,
> > > > Hans
> > > >
> > > > "S.Y.M. Wong-A-Ton" wrote:
> > > >
> > > > > If your list box is being populated by a secondary data source, you can
> > > > > retrieve the data source in code (by using e.g.
> > > > > XDocument.GetDOM(<data_source_name>)), select the rows under the main group
> > > > > node for the rows (using selectNodes() on the DOM of the secondary data
> > > > > source), and then loop through all the rows while you build a string and
> > > > > concatenate the values you need, and then write the results to the text box
> > > > > (using XDocument.DOM.selectSingleNode(<xpath_to_text_box>).text = value)
> > > > >
> > > > > Search this newsgroup on the functions I've mentioned (GetDOM, selectNodes,
> > > > > selectSingleNode) to find examples on how to get this done.
> > > > > ---
> > > > > S.Y.M. Wong-A-Ton
> > > > >
> > > > >
> > > > > "Hasse" wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > In my InfoPath form I have a List Box with several rows of data collected
> > > > > > from a SharePoint list.
> > > > > > If I would like to use vb script to merge all the rows so it will look
> > > > > > something like this: row1data;row2data;row3data;..... and put it in a Text
> > > > > > Box how can I accomplish that?
> > > > > >
> > > > > > Any assistance would be highly appreciated,
> > > > > > Hans

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net