Qeb Archives: NTXHUAB

NTXHUAB advanced nrhiav customization — Rooj plaub no txawv nyob rau hauv txawm nrhiav XSLT

Kuv tsis hloov txawm nrhiav XSLT ntau heev, li no mas, li kuv tabtom toj toj me me txhua txhua lub sij hawm.

Kuv cov tshooj newest no puas yog: Rooj plaub no matters thaum referencing ib sab. Nyob hauv kuv siab heev tsis mus nrhiav, Kuv muaj txhua li no:

<hauv paus xmlns:xsi="http://www.w3.org/ 2001/XMLSchema-lom">
<
Txhua>
<
Kem Lub npe="GafTrainingInvoiceNumber" />
<
Kem Lub npe="GafTrainingInvoiceLocation" />
<
Kem Lub npe="WorkId"/>
<
Kem Lub npe="Plaws"/>
<
Kem Lub npe="Npe"/>
<
Kem Lub npe="Sau"/>
<
Kem Lub npe="Loj"/>
<
Kem Lub npe="Kab"/>
<
Kem Lub npe="Hauj lwm lawm"/>
<
Kem Lub npe="Sau ntawv"/>
<
Kem Lub npe="SiteName"/>
<
Kem Lub npe="CollapsingStatus"/>
<
Kem Lub npe="HitHighlightedSummary"/>
<
Kem Lub npe="HitHighlightedProperties"/>
<
Kem Lub npe="ContentClass"/>
<
Kem Lub npe="IsDocument"/>
<
Kem Lub npe="PictureThumbnailURL"/>
</
Txhua>
</
hauv paus>

Cov XLST uas qhia txog cov invoice invoice xov tooj thiab cov chaw lawm:

<p>
Kev kawm Invoice tooj: <xsl:tus nqi-ntawm xaiv="GafTrainingInvoiceNumber"/>
<
br></br>
Kev kawm qhov chaw Invoice: <xsl:tus nqi-ntawm xaiv="GafTrainingInvoiceLocation"/>
</
p>

Txawm li cas los, Cov xaiv tau reference muaj cov cuab yeej nyob rau hauv txhua rooj plaub no tsawg dua, raws li nyob rau hauv:

<p>
Kev kawm Invoice tooj: <xsl:tus nqi-ntawm xaiv="gaftraininginvoicenumber"/>
<
br></br>
Kev kawm qhov chaw Invoice: <xsl:tus nqi-ntawm xaiv="gaftraininginvoicelocation"/>
</
p>


Kom kuv ho uas, nrhiav tau tsom cov Hmong (i.e. "Txoj kev kawm Invoice tooj") tab sis tsis muaj ntaub ntawv.

NTXHUAB / Cov neeg rau zaub InfoPath cov mov (InfoPath 2007) nco-down daim ntawv teev kev kawm ntawv

Qeb ntxiv: InfoPath

Txoj kev: Ib InfoPath 2007 daim ntawv mus rau ib tug neeg rau zaub mov hauv NTXHUAB deployed muab ib daim ntawv teev nco-down cov neeg muag khoom rau NTXHUAB sau kev cai tied. Thaum koj xaiv ib vendor, kev cai cob teb qhov tseem ceeb rau lub handful ntawm phau ntawv teb xws li muag rep npe, chaw nyob, lub nroog, lub xeev, zauv teb thiab xov tooj. Kev kawm yog phev heev. Peb daim ntawv ceeb toom tias kev kawm ntawv twg thiaj li raug heev tshaj qub (rau ib tus uas tsis yog-linear zam) rau txhua yam kev teb peb hloov li no. Xws li, Yog peb cia li hloov qhov muag rep npe, nws yuav siv sij hawm [x] tus nqi ntawm lub sij hawm. Yog peb hloov rep muag, address1, address2, lub nroog, lub xeev, zauv teb, nws yuav siv sij hawm 10 lub sij hawm ntev dua.

Kua: Sau cov qhov Web site (coj cai nrhiav tau ntawm no) uas yog tau lub cheeb ib vendor thiab nws rov qab tau kom paub meej vendor. Ces, cob teb li no. Txawm tias qhov no ib yam nkaus thiab nkawd qeeb, muaj tug tsis txawv discernable nyob rau hauv cov kev kawm thaum peb raug 1 daim teb no tiv tiag 8 liaj teb. Raws li qhov nws lawm, cov neeg tau txais lub laj "hu cov neeg rau zaub mov" Cylon nyhuv thaum lawv tos rau daim ntawv no ua tau rau tus thiab tsis txhob haus cov xav tau kev pab.

NTXHUAB: Nyiaj tshwm sim. (Nyiaj ntawm HRESULT: 0x 80020009 (DISP_E_EXCEPTION))

HLOOV TSHIAB: Peb tsis txhob txiav hauv paus ua kom muaj qhov teeb meem no thiab nws yeej tsis deg rov.

Peb paub lub sij hawm yuav ua raws li ib txoj kev loj hlob qhov ntawd mam li nco dheev, 2 cov neeg tsis muaj peev xwm nkag tau rau ib qhov chaw sau ntawv. Cov nyiaj yuav authenticate mus rau lub chaw tseem ceeb, tab sis thaum koj sim mus saib tau ib qho chaw sau ntawv, lawv nyuam qhuav tau ib tug dawb paug npo. Tsis muaj cov uas tsis displayed, cia ib tug dawb dawb paug phab.

Peb tau teev rau hauv uas ua ib qhov chaw sau admin thiab sim ntxiv yog ib cov neeg siv cov no yog ib qhov chaw admin thiab lub sij hawm no, Thaum nias "Lawv xav tshuaj", peb tau cov xov no:

Nyiaj tshwm sim. (Nyiaj ntawm HRESULT: 0x 80020009 (DISP_E_EXCEPTION))

Peb siv tej lub sij hawm no researching thiab hmoov tsis, tsis tuaj nrog dab tsi pab tau. Muaj ib co lus nyob rau hauv lub cav diagnostic, tiam sis yog nyuab rau koj raws nraim correlate lawv cov no qhov teeb meem.

Thaum kawg, peb Hmong cov qhov sau los ua qhov chaw thiab re-created nws thiab uas solved.

Yog hais tias kuv paub tseeb seb ho zoo li no yav, Kuv mam li hloov no ncej.

NTXHUAB: Ntsuas los ntawm cov kev cai lub npe thiab xa cov ntaub ntawv uas yuav InfoPath

Lag luam Scenario:

Muab txoj kev enables rau cov neeg siv yuav sau purchase yog requisitions ceev ceev.

Cov teeb meem ua lag ua luam:

Tus neeg twg ua lag ua luam nrog rau ntau pua neeg muag khoom.

Neeg muag khoom yog "hom" meej. Qhov no txhais tau hais tias ib tug vendor sells lub computer khoom (e.g. Dell) los sis khoom siv hauv chaw ua hauj lwm (e.g. Staples).

Peb yuav pab cov neeg siv tag leej twg rhawv purchase requisitions xaiv ib vendor uas koj siv tau li cas?

Kev hais haum ua lag ua luam:

Qha cov neeg muag khoom nyob rau hauv lub cev ntawm "hom".

Pab kom cov neeg siv kom xaiv "hom" ntawm cov khoom thiab muab ib txheej uas tsim nyog cov neeg muag khoom.

Kev tov:

Ib cov ntawv InfoPath twb tau tsim cov neeg enables sau hauv internet muas requisitions.

Ob tug InfoPath xaiv npe tswj vendor xaiv. Ua ntej, tus neeg siv ntawv twg xaiv ib tus "purchase yam". Qhov no txwv thib ob uas sau kom muaj xwb neeg muag khoom muag rau ntawd purchase hom. Qhov no nws yog ib tug classic cascading nco-down.

Neeg muag khoom muab cia rau hauv NTXHUAB kev cai sau kev cai txhua rau vendor pas xws li lub npe nrog rau, qhov chaw nyob thiab tshwj xeeb tshaj yog "yam".

Qhov Web site rau ib tug neeg InfoPath yuav haus cov dej uas siv los ntawm daim ntawv kev cai vendor iterates, rov qab xwb neeg muag khoom txuam ib supplied "yam".

Ua tau rau tus cov qhov Web site ntawm daim InfoPath.

Cov tshooj lus kawm:

  • Ua ntej, nkawd yuav mus no lawv. Kuv yuav muaj tau najnpawb mus ua tus filtering nkaus li cov InfoPath thiab tsis tsim tej Web site rau functionality no. Txawm li cas los, cov neeg rau zaub mov yuav tsis muaj qhov yuav tsum tau filtering muaj rab peev xwm. Peb yuav muab txoj cai rau ib "hom" daim ntawv xaiv nyob rau hauv daim ntawv tsawm tsawv thiab rov qhib rau cov lus nug vendor, tab sis peb tsis tau mus ua hauj lwm kom zoo. Yog li no, yog yuav siv tau cov Web site qhov.
  • Classic "cascading xaiv yuav sau li no" qhov teeb meem nyob rau hauv cov InfoPath tas li neeg rau zaub mov qab ntuj thiab muaj ntau yam zoo qauv muaj sia uas piav seb yuav kom daws tau qhov no li cas.
  • Ib tug nqi rau ib sab nyob rau hauv daim ntawv vendor dawb paug tsis xa ib khoob hlua thaum hais los zoo li no: initItem["Vendor npe"]. Xwb, nws rov ib null.

Ib co sau ntawv:

  • Kuv xa ib array[] cov neeg muag khoom vim kuv tau tej teeb meem uas rov qab ua ArrayList. InfoPath tau complaining txog nws thiab kuv tsis muaj sij hawm los yog tus inclination mus tua dua nws. Qhov no, tau mas, txo nws hwj ib co txwv rau tag nrho cov neeg muag khoom. Nws kuj compelled kuv siv ib trim() qauv rau cov array vim kuv ntxub cov tswv yim uas rov qaum 100 tus uas thov tus neeg muag khoom. InfoPath tsis tu, tab sis nws nagged rau kuv. (Dua, qhov no yooj yim dua ntaus InfoPath nyob ArrayLists).
  • Kuv DVR ib GetSpecificVendorByName() ua kom zoo li, uas tej zaum yuav instructive.

Qhov chaws:

siv Tsim;
siv System.Web;
siv System.Web.Services;
siv System.Web.Services.Protocols;
siv Microsoft.SharePoint;
siv System.Configuration;

/// <txoj kev>
///
Qhov kev pab cuam vendor: Muab vendor ntsig txog cov kev pab uas hnub no yog ntim ntawm ib daim ntawv infopath nyob hauv kev pab.
///
/// Keeb kwm:
/// ——–
/// 07/24/07: Thawj zaug coding, Paul J. Cov Conchango Gavin.
///
/// </txoj kev>
[WebService(Namespace = "http://www.conchango.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
pej xeem hoob VendorService : System.Web.Services.WebService
{

/// <txoj kev>
/// Nruab nrab yog ib vendor ntawm ib daim ntawv kev cai sharepoint ntawm MSUSA.
/// </txoj kev>
pej xeem hoob Vendor
{
pej xeem Vendor() { }

pej xeem Vendor(SPItem initItem)
{
Yog hais tias (! (initItem["Vendor npe"] == null)) VendorName = initItem["Vendor npe"].ToString();
Yog hais tias (! (initItem["Nyob 1"] == null)) VendorAddress1 = initItem["Nyob 1"].ToString();
Yog hais tias (! (initItem["Nyob 2"] == null)) VendorAddress2 = initItem["Nyob 2"].ToString();
Yog hais tias (! (initItem["City"] == null)) VendorCity = initItem["City"].ToString();
Yog hais tias (! (initItem["VendorPhone"] == null)) VendorPhone = initItem["VendorPhone"].ToString();
Yog hais tias (! (initItem["PurchaseType"] == null)) VendorType = initItem["PurchaseType"].ToString();
Yog hais tias (! (initItem["Lub xeev"] == null)) VendorState = initItem["Lub xeev"].ToString();
Yog hais tias (! (initItem["Zip"] == null)) VendorZip = initItem["Zip"].ToString();
Yog hais tias (!(initItem["Fax"] == null)) VendorFax = initItem["Fax"].ToString();
Yog hais tias (!(initItem["SalesRepName"] == null)) VendorSalesRepName = initItem["SalesRepName"].ToString();

VendorItemId = initItem.ID; // Nws tswj tseg ntawm NTXHUAB ID.
}

pej xeem rau cov menyuam VendorItemId;
pej xeem hlua VendorName;
pej xeem hlua VendorAddress1;
pej xeem hlua VendorAddress2;
pej xeem hlua VendorCity;
pej xeem hlua VendorState;
pej xeem hlua VendorZip;
pej xeem hlua VendorPhone;
pej xeem hlua VendorType;
pej xeem hlua VendorSalesRepName;
pej xeem hlua VendorFax;
}

pej xeem VendorService () {

//Cov lus hauv qab no kab yog siv tsim Cheebtsam uncomment
//InitializeComponent();
}

lwm yam Vendor[] GenerateTestVendors()
{
Vendor[] resultList;
resultList = tshiab Vendor[100];

Vendor v;
v = tshiab Vendor();
v.VendorAddress1 = "v1_address1";
v.VendorAddress2 = "v1_address2";
v.VendorCity = "v1_city";
v.VendorName = "v1_vendorname";
v.VendorPhone = "v1_vendorphone";
v.VendorState = "v1_st";
v.VendorType = "v1_type";
v.VendorZip = "v1_zip";

resultList[0] = v;

v = tshiab Vendor();

v.VendorAddress1 = "v2_address1";
v.VendorAddress2 = "v2_address2";
v.VendorCity = "v2_city";
v.VendorName = "v2_vendorname";
v.VendorPhone = "v2_vendorphone";
v.VendorState = "v2_st";
v.VendorType = "v2_type";
v.VendorZip = "v2_zip";

resultList[1] = v;

v = tshiab Vendor();
v.VendorAddress1 = "v3_address1";
v.VendorAddress2 = "v3_address2";
v.VendorCity = "v3_city";
v.VendorName = "v3_vendorname";
v.VendorPhone = "v3_vendorphone";
v.VendorState = "v3_st";
v.VendorType = "v3_type";
v.VendorZip = "v3_zip";

resultList[2] = v;

rov qab los resultList;

}

[WebMethod]
pej xeem Vendor GetSpecificVendorById(rau cov menyuam vendorId)
{
hlua SpVendorSiteName; // Lub npe ntawm lub txoos NTXHUAB kawm uas hosts vendor kev cai daim ntawv.
hlua SpVendorListName; // Lub npe ntawm lub txoos NTXHUAB daim ntawv uas muaj cov neeg muag khoom.

SpVendorSiteName = ConfigurationSettings.AppSettings["VendorListHostingSite"].ToString();
SpVendorListName = ConfigurationSettings.AppSettings["VendorList"].ToString();

siv (SPSite kawm ntawv = tshiab SPSite(SpVendorSiteName))
{

siv (SPWeb Web = kawm ntawv. OpenWeb())
{

Splist.Update() currentList = web. Teev[SpVendorListName];

SPItem specificItem = currentList.Items[vendorId];

rov qab los tshiab Vendor(specificItem);

} // siv lub web spweb = site.openweb()
} // siv qhov chaw spsite = spsite tshiab("http://localhost/mizuho")

}

[WebMethod]
// Assumes tias cov vendor npe hu ua nws, ntawm lub lag luam foundations
pej xeem Vendor GetSpecificVendorByVendorName(hlua yuav)
{
hlua SpVendorSiteName; // Lub npe ntawm lub txoos NTXHUAB kawm uas hosts vendor kev cai daim ntawv.
hlua SpVendorListName; // Lub npe ntawm lub txoos NTXHUAB daim ntawv uas muaj cov neeg muag khoom.

SpVendorSiteName = ConfigurationSettings.AppSettings["VendorListHostingSite"].ToString();
SpVendorListName = ConfigurationSettings.AppSettings["VendorList"].ToString();

siv (SPSite kawm ntawv = tshiab SPSite(SpVendorSiteName))
{
siv (SPWeb Web = kawm ntawv. OpenWeb())
{

Splist.Update() currentList = web. Teev[SpVendorListName];

foreach (SPItem vendorItem nyob rau hauv currentList.Items)
{
Yog hais tias (vendorItem["Vendor npe"] == null) ntxiv mus;

Yog hais tias (vendorItem["Vendor npe"].ToString().Qhov sib npaug(yuav))
rov qab los tshiab Vendor(vendorItem);
}

Vendor v = tshiab Vendor();
v.VendorPhone = "nrhiav tsis tau: " + yuav;

rov qab los v;

rov qab los null;

} // siv lub web spweb = site.openweb()
} // siv qhov chaw spsite = spsite tshiab("http://localhost/mizuho")

} // txujci

[WebMethod]
pej xeem Vendor[] GetVendorsOfType (hlua filterType)
{

hlua SpVendorSiteName; // Lub npe ntawm lub txoos NTXHUAB kawm uas ib hom tsiaj t
nws vendor kev cai sau.
hlua SpVendorListName; // Lub npe ntawm lub txoos NTXHUAB daim ntawv uas muaj cov neeg muag khoom.

SpVendorSiteName = ConfigurationSettings.AppSettings["VendorListHostingSite"].ToString();
SpVendorListName = ConfigurationSettings.AppSettings["VendorList"].ToString();

Vendor[] resultList;
rau cov menyuam vendorIndex = 0;
resultList = tshiab Vendor[1000];

// Initialize daim ntawv nrog vim tus phooj ywg lus.
Vendor v = tshiab Vendor();
v.VendorName = "Xaiv ib yam vendor rau populate daim ntawv.";
resultList[0] = v;

// Hloov lub lim los txo cov ntaub ntawv kom yooj yim txoj hlua sib piv ib tsam.
filterType = filterType.ToLower();

// Yog hom lim kis yog "sim", ua kom muaj tej ntaub ntawv yooj yim.
#thaj av Lim yam = "sim"
Yog hais tias (filterType. qhov sib npaug("sim"))
rov qab los GenerateTestVendors();
#endregion

Yog hais tias (tseeb)
{
siv (SPSite kawm ntawv = tshiab SPSite(SpVendorSiteName))
{
siv (SPWeb Web = kawm ntawv. OpenWeb())
{

v = null;

Splist.Update() currentList = web. Teev[SpVendorListName];

// Iterate txog txhua yam nyob rau hauv daim ntawv vendor.
foreach (SPItem vendorItem nyob rau hauv currentList.Items)
{

hlua lowerVendorType;

lowerVendorType = vendorItem["PurchaseType"].ToString().ToLower();
lowerVendorType = lowerVendorType.Substring(3);

Yog hais tias (lowerVendorType. qhov sib npaug(filterType))
{
resultList[vendorIndex ] = tshiab Vendor(vendorItem);
}
} // ntsuas qhib rau txhua tus neeg muag khoom nyob hauv daim ntawv


rov qab los TrimVendorArray(vendorIndex, resultList);
// rov qab mus resultList;

} // siv lub web spweb = site.openweb()
} // siv qhov chaw spsite = spsite tshiab("http://localhost/mizuho")

} // Yog hais tias muaj tseeb tiag

rov qab los null;
}

lwm yam Vendor[] TrimVendorArray(rau cov menyuam newsize, Vendor[] originalVendorArray)
{
Vendor[] trimmedArray;

Yog hais tias (newsize == 0) newsize = 1;
trimmedArray = tshiab Vendor[newsize];

rau cov menyuam currentCounter = 0;

rau (currentCounter = 0; currentCounter < newsize; currentCounter )
{
trimmedArray[currentCounter] = originalVendorArray[currentCounter];
}

rov qab los trimmedArray;

}
}