Arkivat e Kategorisë: InfoPath 2007 // Format Server

Hit i shpejtë: Leximi XML InfoPath direkt nga një SPListItem në 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 (të cilat janë vetëm fotografi XML, kështu që është e vërtetë mjaft e lehtë).

Ndërsa unë ishte ndërtuar projektin, I started by downloading an InfoPath form and saving it to my local hard drive. My c# code was reading directly from that instance. Megjithatë, 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. Megjithatë, there’s no need to go through those hoops as you can read it directly from the library. This little snippet shows how:

/// Përkufizimi Klasa gjëra këtu, duke përfshirë:
privat SPFile mySharePointFile; /* Pjesë e një SPList */
// Kodi More shkon këtu dhe në brendësi të një metodë të klasës kemi:
XmlTextReader textReader;
textReader = i ri XmlTextReader(mySharePointFile.OpenBinaryStream());

textReader.WhitespaceHandling = WhitespaceHandling.Asnjë;

textReader.Read();

// Nëse nyjen ka vlerë

ndërsa (textReader.Read())
{

… and so on and so forth …

Ata bit kyç sipër është se ne mund të lexoni InfoPath direkt nëpërmjet OpenBinaryStream() method call on the SPFile as a parameter to the constructor on XmlTextReader. It works great.

</fund>

Abonohen në blogun tim.

Atëherë ejani pas meje në Twitter në http://www.twitter.com/pagalvin

Technorati Tags:

Programmatically Nxjerrjen Attachments nga forma InfoPath (Duke përfshirë edhe emrat e tyre!)

I have an expense entry solution for a client that leverages InfoPath and workflow. At one point during the approval process, Unë kam nevojë për të gjeneruar një email që ka të gjithë se të dhënat InfoPath të mira si të bashkëngjitni skedarë vetë në mënyrë që (psherëtimë) dikush mund të marrë që të dhënat dhe manualisht ri-kyç atë në një kërkesë bazë të dhënash Oracle.

It’s not very difficult to get at or parse the InfoPath form. I didn’t know how to handle the attachments, megjithatë. After an hour or two of poking around the Internets (një përjetësi!) Kam gjetur këtë artikull: http://support.microsoft.com/kb/892730

It provide some handy code to extract the attachment from a node in the form. (Ju ende nevojë për të gjetur nyjen dhe gjithçka që, por kjo është vetëm XML parsing).

Unë e di se shtojcë është base64-koduar dhe unë shkova fillimisht poshtë rrugën e vetëm nxjerrjen e të dhënave base64, decoding it and saving it. Megjithatë, Unë shpejt e kuptuan që unë nuk e di se si të merrni File Name veten deri sa kam gjetur artikullin e lartpërmendur.

Unë kisha gjetur në fakt që mjaft herët, por unë u shty nga personaliteti i saj të ndarë. Nga njëra anë, the article *says* it’s good for InfoPath 2007. Ende, Kodi dhe udhëzimet janë të gjitha në lidhje me Visual Studio 2003 dhe referencat ndaj InfoPath 2003.

Bottom line, Kodi neni, me kusht që është duke punuar mirë për mua (deri tani). I can get my InfoPath form, Unë mund të kuptoj atë, I can find and decode the attachment and I know its name. What more can one ask of one’s life?

</fund>

Abonohen në blogun tim.

Atëherë ejani pas meje në Twitter në http://www.twitter.com/pagalvin

Technorati Tags: ,,

Nëse jeni të shqetësuar se mjedisi juaj SharePoint mund të jetë një fëmijë i sëmurë, më lejoni të ju ndihmojë të rregullojmë se me një kontroll shëndetësor.

Menaxhimi grupet aprovues me InfoPath në një mjedis FBA

Unë kam një procesi të miratimit shpenzim që kam nevojë për të zbatuar duke përdorur InfoPath në një format të bazuar authentication (FBA) Mjedisi përdorur forma shërbime (InfoPath web bazuar).

Ka dy grupe miratimit dhe procesi works like this:

  • User mbush nga një raport shpenzim dhe ia paraqet atë për miratim.
  • 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, trishtim. 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.

</fund>

Abonohen në blogun tim.

Atëherë ejani pas meje në Twitter në http://www.twitter.com/pagalvin

Technorati Tags: ,

InfoPath // Një shpjegim për "përjashtim Unhandled kur merr formë System.Xml.XmlException: Fundi i papritur i dosjes Emri, ndërsa parsing ka ndodhur. "

Unë kam qenë duke punuar në një formë sot InfPath dhe vrapoi deri kundër një mik të vjetër, "Përjashtimi i Unhandled kur pasqyrim System.Xml.XmlException formë: Fundi i papritur i dosjes Emri, ndërsa parsing ka ndodhur. "

This happened to me a long time ago and I don’t know what exactly I did to resolve it. Honestly, Unë mendoj se unë kam qenë duke kaluar në një projekt të ri dhe kurrë nuk e panë kjo zgjidhet (zëvendësimet e mi kishte për t'u marrë me atë dhimbje koke). I do remember it was a devil of a problem. I spent several unsuccessful days dealing with it. Since then, Unë e kam parë këtë të dalë në forumet MSDN të paktën një herë gjatë vitit të kaluar dhe kurrë nuk e panë me të vërtetë një përgjigje për atë.

I goditi atë sot dhe për fat të mirë këtë herë , 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.

Në rastin tim, problemi ishte shkaktuar nga këto hapa:

  1. Shto një element të ri në një burim të të dhënave si një fushë teksti.
  2. Drop atë mbi formën.
  3. Ndrysho shfaqin atë së në një drop down listë.
  4. Tregoj drop down list për të tërhequr vlerat e saj nga një listë me porosi SharePoint.

Unë nuk e di nëse këto hapa të shkaktojë një problem apo ndoshta, disi të dhënat në listën e vetë është një problem. I’m going to experiment a bit and see if I can nail downt he parameters of this with any more detail.

</fund>

Abonohen në blogun tim.

Atëherë ejani pas meje në Twitter në http://www.twitter.com/pagalvin

Technorati Tags:

Embed Notes Zhvillues Inside format tuaja InfoPath

Unë jam ende duke jetuar në forma InfoPath botë dhe unë e nevojshme për të bërë një prej këtyre ndryshimeve "të vogla" në një formë që, për fat të keq, breaks a naming convention I adopted with it two weeks ago. Mendova për veten time, "Dikush do të shikojmë në këtë gjë një vit nga tani dhe të thonë, "Çfarë Pali u menduar? By Jove, konventë emërtimin e tij e bën nuk ka kuptim!"

Unë kuptova se unë mund të krijojë një pamje në formë për këtë dhe pastaj, njëherë, 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

Unë e kam konfiguruar formularin mënyrë që përdoruesit nuk mund të merrni për të parë atë dhe për këtë arsye, 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!

</fund>

Abonohen në blogun tim.

Atëherë ejani pas meje në Twitter në http://www.twitter.com/pagalvin

Technorati Tags:

Menaxhimi Views InfoPath

I duket për të shkuar nëpër faza InfoPath ku, si i rënë nga qielli, 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.

Unë jam në mes të një faze InfoPath dhe unë jam duke krijuar forma InfoPath me një shumë të pikëpamjeve. Një gjë që ju ndoshta njoftim është se 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, siç ilustrohet këtu:

image

I wish I had been doing this all along.

</fund>

Abonohen në blogun tim.

Atëherë ejani pas meje në Twitter në http://www.twitter.com/pagalvin

Technorati Tags:

Sevices Forma InfoPath, Format Authentication Based (FBA) dhe emrat unik imazhit

Unë kam qenë duke punuar në disa InfoPath formon këtë javë në MOSS në një mjedis FBA dhe mësuar, kur shkova për të vendosur format në një mjedis të prodhimit me një zonë FBA se emrin() function function does not work. I was using it to generate unique file names.

Mirë, se funksioni nuk do të punojnë në një mjedis FBA (të paktën, mos dalë nga kutia). Dhe, mbi këtë reflektim, duke përdorur emrin në mënyrën se si unë kishte planifikuar nuk do të kishte garantuar një emër unik e fotografisë në çdo rast.

Zgjidhja ime ishte që të përdorin tani() 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. (Unë nuk e tregojnë atë në ekran shtënë, por vënë një kusht në rregull për të zjarrit vetëm kur "myFilename" është bosh). I used to set the file name at the data source level. Typically, Unë do të bëj diçka (keq) si kjo:

image

Problemi me këtë është se në qoftë se përdoruesi Një hap formularin hënën dhe B përdorues e ndryshon atë të martën, ju do të përfundojë me dy forma të ndryshme që dy përdorues të ndryshëm shpëtuam atë me emra të përdoruesve të ndryshëm.

Kështu, si i bezdisshëm si FBA mund të jenë në përgjithësi dhe në veçanti me InfoPath, kjo më bëri ri-mendojnë një detaj i vogël, por me të vërtetë e rëndësishme teknike dhe qasje që unë nuk do të kishte bërë ndryshe!

</fund>

Abonohen në blogun tim.

Atëherë ejani pas meje në Twitter në http://www.twitter.com/pagalvin

Technorati Tags:

Shpejtë dhe i thjeshtë: Bëni një Formular InfoPath Vetëm Lexuar (InfoPath Forms Shërbimet në MOSS)

Ka një skenar të përbashkët të biznesit si kjo:

  • User mbush një formular InfoPath.
  • Dorëzon formularin.
  • Long-running procesi workflow nis.
  • Ndërsa workflow po kandidon, ne nuk duam askënd për të ndryshuar përmbajtjen e formularit.

Ky shembull 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. Over time, me zhvilluesit të ndryshme, there can be some divergence.

Kjo alternativë mund të punojnë më mirë në disa raste:

  • Add a new field to the form called "IsEditable".
  • Set its default value to true.
  • Promote it when publishing to MOSS.
  • Në workflow, set the value of IsEditble to false.
  • Go back to the form.
  • Add a rule that "upon open of the form", disable your save button when IsEditable is false.

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, possibly in big red letters across the top of the page.

In one project, I created a "workflow status" pamje. 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" përjashton automatikisht kaloi në këtë pikëpamje dhe përdoruesi ka një status të bukur pak përmbledhës.

</fund>

Abonohen në blogun tim.

Switch Shiko Based on User ID në një formë InfoPath

Ne kishim një zhvilluar një formë InfoPath me pamje të shumta për të mbështetur një qira të ri / on-boarding process. When the company hires a new person, departamenti IT dhe grupe të tjera kanë nevojë për të marrë veprim (ngritur pagave, mundësojë qasje në aplikimet përkatëse, gjetur një tavolinë, etj). We use on form but a different view of the form for each of those functions.

Në këtë kompani, shumica e njerëzve të përfshirë në procesin e biznesit janë të IT-tru, kështu që kur ata të hyni në formularin, their default view is a "menu" view with buttons that direct them to their specific function. Megjithatë, we needed to simplify things for the new hire’s direct manager. This person should not see any of the IT related stuff. Në të vërtetë, ajo duhet të shikoni vetëm një pamje e formës dhe të mos ketë edhe një mundësi për të parë pikëpamjet e tjera.

Në rastin tonë, që përbëjnë menaxherit direkt është i lidhur direkt me mirësjellje formen e nje kontaktoni selektorin (which I am always wanting to call a "people picker" për disa arsye).

Hapat janë si më poshtë:

1. Në regjimin e dizajnit, shkoni tek Tools -> Options Forma -> Hapur dhe Save.

2. Select "rules".

3. Create a new rule whose action is "switch to view" dhe gjendja e të cilit thekson emër përdorues() funksion.

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 (në mjedisin tim gjithsesi) kthen domain dhe përdorues ID, as in "domain\pagalvin". This prevents us from doing a straight-forward equality condition since AccountID ("domain\pagalvin") kurrë nuk do të jetë e barabartë emër përdorues() ("pagalvin").

We can get around this using the "contains" operator: AccountID përmban Username().

Ne mund të marrë atë më tej dhe para-pend një hard-coded domain në frontin e USERNAME() funksionojë për të marrë barazinë tonë të kontrolluar dhe eliminuar rrezikun e një rreme pozitive mbi përmban operatorin.

We would have REALLY like to automatically switch view for other users based on their AD security group membership. Për shembull, when a member of the "IT Analytics" Grupi accesses formularin, 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", kalojë ajo userName() and return back true or false. Does anyone have any other, më shumë ide e zgjuar? Is there any SharePoint function we can leverage from InfoPath to make that determination?

</fund>

Technorati Tags: