Arkivji tal-Kategorija: InfoPath 2007 // Formoli Server

Quick Hit: Qari InfoPath XML direttament minn SPListItem fl SharePoint

I’m been working on a project where I need to extract attachments from an InfoPath form. There are some good resources for parsing InfoPath forms (li huma biss fajls XML, dan huwa attwalment pjuttost faċli).

Filwaqt I kien bini l-proġett, I started by downloading an InfoPath form and saving it to my local hard drive. My c# code was reading directly from that instance. Madankollu, the InfoPath forms are really living inside a SharePoint forms library. I did a little half hearted searching to find out how to read it directly from the library and almost gave up, in which case I would have saved the form to a local temp directory and read it from there. Madankollu, there’s no need to go through those hoops as you can read it directly from the library. This little snippet shows how:

/// Jittieħed klassi definizzjoni hawn, inklużi:
privat SPFile mySharePointFile; /* Parti minn SPList */
// Aktar kodiċi tmur hawn u ġewwa metodu tal-klassi għandna:
XmlTextReader textReader;
textReader = ġdid XmlTextReader(mySharePointFile.OpenBinaryStream());

textReader.WhitespaceHandling = WhitespaceHandling.Xejn;

textReader.Read();

// Jekk il-node għandha valur

filwaqt li (textReader.Read())
{

… and so on and so forth …

Huma bit ewlieni hawn fuq hija li nistgħu taqra l-InfoPath direttament permezz tal-OpenBinaryStream() method call on the SPFile as a parameter to the constructor on XmlTextReader. It works great.

</aħħar>

Abbona għall-blog tiegħi.

Follow lili Twitter fi http://www.twitter.com/pagalvin

Tags:

Programmatically Estrazzjoni Attachments minn forom InfoPath (InkluŜ l-ismijiet!)

I have an expense entry solution for a client that leverages InfoPath and workflow. At one point during the approval process, I bżonn li jiġġeneraw email li tkun kollha ta 'dik data InfoPath tajba kif ukoll l-annessi nnifishom sabiex (daqqa) xi ħadd jista 'jieħu dik id-data u manwalment mill-ġdid muftieħ f'applikazzjoni database Oracle.

It’s not very difficult to get at or parse the InfoPath form. I didn’t know how to handle the attachments, madankollu. After an hour or two of poking around the Internets (eternity!) Sibt dan l-artikolu: http://support.microsoft.com/kb/892730

It provide some handy code to extract the attachment from a node in the form. (Inti xorta jkollok bżonn biex isibu l-node u dak kollu li, iżda li biss parsing XML).

I know that the attachment is base64-encoded and I originally went down the path of just extracting the the base64 data, decoding it and saving it. Madankollu, I quickly realized I didn’t know how to get the file name itself until I found the aforementioned article.

I had actually found that quite early, but I was put off by its split personality. On the one hand, the article *says* it’s good for InfoPath 2007. Madankollu, the code and instructions are all about Visual Studio 2003 and references to InfoPath 2003.

Bottom line, the code that article provided is working well for me (s'issa). I can get my InfoPath form, I can parse it, I can find and decode the attachment and I know its name. What more can one ask of one’s life?

</aħħar>

Abbona għall-blog tiegħi.

Follow lili Twitter fi http://www.twitter.com/pagalvin

Jekk int inkwetat li l-ambjent SharePoint tiegħek jista 'jkun tad ħżiena għas-saħħa, let me jgħinuk jiffissaw dak ma 'kontroll tas-saħħa.

Maniġerjali Gruppi Approvazzjoni bl InfoPath f'ambjent FBA

I have an expense approval process that I need to implement using InfoPath in a forms based authentication (FBA) environment using forms services (web based InfoPath).

There are two approval groups and the process works like this:

  • User fills out an expense report and submits it for approval.
  • That triggers an email to first level approver group.
  • First level approver reviews and approves or denies the report.
  • If first level person approves it, system notifies second level approver.

On the InfoPath side of things, I have different sections that hide/appear based on whether the user is a member of one of those approval groups.

In an FBA environment the username() function always returns blank, sfortunatament. What I’ve done is set up a a custom list called “Approval Groups”.

I don’t add any additional columns to the list.

When the form opens up, it has a rule like this:

image

The “set a field’s value” is here:

image

This is basically saying: Query the approval group custom list and filter that query by looking for any row where Title’s value = “NORDIC”.

If that returns any value, then the current user is a member of that group. I know it contains that value because the string length is greater than zero.

Close the loop by securing the individual items in the Approval Group list. At run-time, if the current user doesn’t have appropriate security access to that item then the query won’t return it, string-length will be zero and now you know the current user is not part of that group. You can use that fact as needed in the form.

This is a super brief write-up. I’m pressed for time or I’d provide more detail.

I don’t know how relevant it is that I’m in an FBA environment. This would probably work well in a non-FBA environment but I can imagine cases where this would be useful.

</aħħar>

Abbona għall-blog tiegħi.

Follow lili Twitter fi http://www.twitter.com/pagalvin

InfoPath // Spjegazzjoni waħda għal "eċċezzjoni unhandled meta jfornu forma System.Xml.XmlException: Tmiem mhux mistennija tal-fajl waqt Isem parsing tkun seħħet. "

I kien qed jaħdem fuq formola InfPath llum u dam up kontra xi ħabib antik, "Eċċezzjoni unhandled meta jfornu forma System.Xml.XmlException: Tmiem mhux mistennija tal-fajl waqt Isem parsing seħħet. "

This happened to me a long time ago and I don’t know what exactly I did to resolve it. Honestly, Naħseb li I kien jgħaddi għall proġett ġdid u qatt ma raw dan wieħed solvuti (sostituzzjonijiet tiegħi kellhom jittrattaw ma 'dak uġigħ ta' ras). I do remember it was a devil of a problem. I spent several unsuccessful days dealing with it. Since then, Stajt rajt dan toħroġ fuq forums MSDN inqas darba matul l-aħħar sena u qatt verament raw tweġiba għaliha.

I hit llum u fortunatament dan iż-żmien , I had just made a change to the form. I backed out that change and the problem went away. It turns out that it’s possible to create a from template using InfoPath Designer in such a way that it generates a parse error on the forms server side of the fence.

Fil-każ tiegħi, il-problema kienet ikkawżata minn dawn il-passi:

  1. Żid element ġdid ma 'sors tad-dejta bħala qasam tat-test.
  2. Qatra fuq il-formola.
  3. Bidla display huwa fi drop down lista.
  4. Għid il-drop down lista biex jiġbdu l-valuri tagħha minn lista custom SharePoint.

I do not know jekk dawk il-passi jikkawża problema jew forsi, b'xi mod l-informazzjoni fil-lista nnifisha hija problema. I’m going to experiment a bit and see if I can nail downt he parameters of this with any more detail.

</aħħar>

Abbona għall-blog tiegħi.

Follow lili Twitter fi http://www.twitter.com/pagalvin

Tags:

Embed Noti Developer Ġewwa Formoli InfoPath tiegħek

Jien għadhom jgħixu fil InfoPath Formoli dinja u I meħtieġa biex jagħmlu waħda minn dawk "żgħar" tibdiliet għal forma li, sfortunatament, breaks a naming convention I adopted with it two weeks ago. I thought to myself, "Xi ħadd ikun se tħares lejn dan il-ħaġa sena minn issa u jgħidu, "Dak li kien Paul taħseb? By Jove, his naming convention makes no sense!"

I realized that I could create a view on the form for this and then, għal darb'oħra, realized that I could have been doing something like this all along. I added a “Developer Notes” view to the InfoPath form as such:

image

I’ve configured the form so that users can’t get to that view and therefore, it’s only visible with the InfoPath client in design view. Now I feel a little inoculated against some future unknown developer looking at my form and thinking bad thoughts about me. Phew!

</aħħar>

Abbona għall-blog tiegħi.

Follow lili Twitter fi http://www.twitter.com/pagalvin

Tags:

Ġestjoni Views InfoPath

I jidhru li jmorru permezz ta fażijiet InfoPath fejn, mill-blu, I’m crafting a bunch of forms. My fingers learn how to use the tool well and then I go through nine month drought and have to learn it all over again.

Jien fin-nofs ta 'fażi InfoPath u jien ħolqien forom InfoPath ma' lott ta 'fehmiet. Ħaġa waħda inti probabilment avviż huwa li l-InfoPath 2007 client shows views in alphabetical order. This is a real nuisance some times. My best technique these days is to prepend a number to the view name so that they always show in the order I want, kif jidher hawn:

image

I wish I had been doing this all along.

</aħħar>

Abbona għall-blog tiegħi.

Follow lili Twitter fi http://www.twitter.com/pagalvin

Tags:

Formola servizzi għat InfoPath, Formoli Awtentikazzjoni Ibbażat (FBA) u Ismijiet File uniku

Stajt ilhom jaħdmu fuq xi InfoPath forom din il-ġimgħa fil MOSS f'ambjent FBA u tgħallmu, meta I marru biex tibgħat formoli għal ambjent produzzjoni ma 'żona FBA li l-username() function function does not work. I was using it to generate unique file names.

Well, dik il-funzjoni ma jaħdmu f'ambjent FBA (inqas, mhux barra mill-kaxxa). U, fuq riflessjoni, jużaw username fil-mod I kienet ippjanat ma kienx garantit fajl isem uniku fi kwalunkwe każ.

My soluzzjoni kienet li tuża l-issa() function and a rule that fires on loading of the form. I assign the file name to data element when it’s blank:

image

image

The advantage of this approach is that the file name is set only once. (I ma juru fil-isparatura iskrin, iżda tpoġġi kundizzjoni fuq ir-regola tan-nar biss meta "myFilename" huwa vojt). I used to set the file name at the data source level. Typically, Nixtieq nagħmel xi ħaġa (bad) bħal dan:

image

Il-problema ma 'dan huwa li jekk utent A jiftaħ il-formola tat-Tnejn u l-utent B bidliet li nhar it-Tlieta, inti ser jispiċċaw ma 'żewġ forom differenti peress li żewġ utenti differenti salvati bl-ismijiet differenti ta' utenti.

Allura, kif annoying bħala FBA jistgħu jkunu b'mod ġenerali u fir InfoPath b'mod partikolari, għamel miegħi taħseb mill-ġdid ta 'dettall tekniku żgħir imma verament importanti u l-approċċ li jien mhux se għamlu inkella!

</aħħar>

Abbona għall-blog tiegħi.

Follow lili Twitter fi http://www.twitter.com/pagalvin

Tags:

Quick u sempliċi: Jagħmlu Formola InfoPath Aqra biss (InfoPath Formoli Servizzi fil MOSS)

Hemm xenarju tan-negozju komuni bħal dan:

  • User jimla formola InfoPath.
  • Jissottometti forma.
  • Proċess workflow fit-tmexxija kicks off.
  • Filwaqt li l-fluss tax-xogħol qed taħdem, aħna ma tridx xi ħadd li jibdlu l-kontenut tal-formola.

Dan l-eżempju office.microsoft.com describes how to create a separate "view" and mark the whole view as read-only. This is a workable approach but has the drawback that you’ve effectively created two entire versions of the same form and must now keep them in sync manually. If you add a field to the editable view, you must then add it to the non-editable view as well. Maż-żmien, mal-iżviluppaturi differenti, there can be some divergence.

Din l-alternattiva jista 'jaħdem aħjar f'xi każijiet:

  • Add a new field to the form called "IsEditable".
  • Issettja valur default tagħha li veru.
  • Jippromwovu meta jiġu ppubblikati l MOSS.
  • Fil-fluss tax-xogħol, jiffissa l-valur tal IsEditble biex falza.
  • Mur lura għall-forma.
  • Add a rule that "upon open of the form", jiskonnettja buttunaIssejvja tiegħek meta IsEditable hija falza.

The drawback to this approach is that all the fields will still be editable on the screen. The user can get a false impression that they can actually change content. You can mitigate that by putting in some text that the form is disabled, possibilment b'ittri ħomor kbar madwar l-quċċata tal-paġna.

Fi proġett wieħed, I created a "workflow status" ħsieb. As the workflow progressed, it would update specific status fields that had been promoted from the form. When the user opened the form, the "open form" regola awtomatikament ma din l-opinjoni u l-utent kellu status sbieħ sommarju ftit.

</aħħar>

Abbona għall-blog tiegħi.

Jaqilbu View View Ibbażat fuq User ID f'forma InfoPath

Kellna żviluppat formola InfoPath bl-opinjonijiet multipli biex tappoġġja kiri ġdida / on-boarding process. When the company hires a new person, IT dipartiment u gruppi oħra jeħtieġu li jieħdu azzjoni (stabbilit payroll, jippermettu aċċess għall-applikazzjonijiet xierqa, jillokalizza desk, eċċ). We use on form but a different view of the form for each of those functions.

Fuq din il-kumpanija, maġġoranza tal-persuni involuti fil-proċess tan-negozju IT-sofistikati, hekk meta jaċċessaw il-formola, their default view is a "menu" view with buttons that direct them to their specific function. Madankollu, we needed to simplify things for the new hire’s direct manager. This person should not see any of the IT related stuff. Fil-fatt, hi għandha tara wieħed biss minħabba l-forma u lanqas l-għażla li tara l-opinjonijiet l-oħra.

Fil-każ tagħna, dak il-kont manager dirett huwa direttament marbut ma l-forma korteżija ta ' kuntatt selettur (which I am always wanting to call a "people picker" għal xi raġuni).

Il-passi huma li ġejjin:

1. Fil-modalità disinn, mur Tools -> Formola Għażliet -> Open u Save.

2. Select "rules".

3. Create a new rule whose action is "switch to view" u li l-kondizzjoni tiggwida l-Username() funzjoni.

Username() returns the "simple" user name without the domain. If I log into SharePoint with credentials "domain\pagalvin", Username() returns "pagalvin".

The contact selector provides three bits of information for a contact. The "AccountID" portion is most useful for this scenario. The only thing that makes this even a little bit of challenge is that the contact selector (fl-ambjent tiegħi xorta) jirritorna l-dominju u user ID, as in "domain\pagalvin". This prevents us from doing a straight-forward equality condition since AccountID ("domain\pagalvin") qatt se ugwali username() ("pagalvin").

We can get around this using the "contains" operatur: AccountID fih Username().

Aħna tista 'tieħu aktar u pre-pend domain hard-kodifikati quddiem il-username() jiffunzjonaw biex tikseb l-ugwaljanza tagħna kontroll u jeliminaw ir-riskju ta 'pożittiv falz fuq l-operatur fih.

We would have REALLY like to automatically switch view for other users based on their AD security group membership. Per eżempju, when a member of the "IT Analytics" grupp aċċessi l-forma, automatically switch to the IT Analytics view. We didn’t have time to implement it, but my first thought is to create a web service that would have a method like "IsMemberOfActiveDirectorySecurityGroup", tgħaddiha l-Username() and return back true or false. Does anyone have any other, aktar idea għaqlija? Is there any SharePoint function we can leverage from InfoPath to make that determination?

</aħħar>