Here’s the function :
function print_All()
{
var DocumentContainer = document.getElementById('view_all');
var WindowObject = window.open('', "Printing form", "width=800, height=500, top=250, left=345, toolbar=no, scrollbars=no, status=no, resizable=no");
WindowObject.document.write(DocumentContainer.innerHTML);
WindowObject.document.close();
WindowObject.focus();
WindowObject.print();
WindowObject.close();
}
Explanation :
· « var DocumentContainer = document.getElementById('view_all'); » :
Th id (view_all) will be the id that you’ll assign to the
· Now you could just use the WindowObjet.document.write(DocumentContainer) directly without adding the tags above, or you could reform your popup by adding the basic html page tags(), and then attach it to a stylesheet for more sweet display or adding javascript to your popup.
for that exemple, i used dispform.aspx content, of course you could apply it to the rest of form.
i hope it will help you on your job or studies, if you have a question or wondering about something releated to that, dont hesitate to contact me about it.
Fill a user/group field with the current user username on page load
hi everyone, today i'll post how to fill a user/group field with the current user username on page load.the solution was built on javascript script, so you've to be a little bit familiar with it, cuz anyway it will bring you a great help on developing web content.
here's the fucntion :

personnaly i put it in the first template call

at the end you must call _spBodyOnLoadFunctionNames.push() function brought by SharePoint to execute you needed function on page load :
_spBodyOnLoadFunctionNames.push("get_CurrentUser");
Now after you did all that, save the file and execute.
i hope i helped you even if a little bit, if there's a question about that or anything else, mail me or comment on the post, i'll be here.
here's the fucntion :
personnaly i put it in the first template call
at the end you must call _spBodyOnLoadFunctionNames.push() function brought by SharePoint to execute you needed function on page load :
_spBodyOnLoadFunctionNames.push("get_CurrentUser");
Now after you did all that, save the file and execute.
i hope i helped you even if a little bit, if there's a question about that or anything else, mail me or comment on the post, i'll be here.
jeudi 6 novembre 2008
Dashboard(KPI) avec SharePoint Designer
Dans ce messagen je vais en un façons donner un exemple sur une methode qu'elle poura vous etre utile pour créer des kpi a travers SharePoint Designer.


Le premier pas c'est de créer une vue de donnée :
1-Créer une page aspx vide dans SPD
2-Faite la herité de la page maitre
3-pointé vous sur la petite fleche du PlaceHolderMain pour le rendre personalisé
4-Aller sur insertion->Controles SharePoint->Zone de composant webpart
5-Dans la zone clické dedan pour inserer la liste que vous voudraiez en appliqué les KPI
6-Une fois la liste ajouter, click droit sur elle et puis clické sur Convertir en vue de donnée XSLT
7-Rechercher le test '{$List}-{$View}', c'est le id de la balise table quio encapsule les titres des
colonnes de la liste.
8-Ajouter une balise qui contiendra le nom de colonne voulu.
9-Clicker sur le contenu des colonnes, ensuite aller sur le code et puis ajouter votre balise et dans laquelle vous mettriez vos regle d'affichage.
10-Dans cet exemple on prendra un champ 'Stock', si le stock est inferieur à 10 en mettra jaune, si stock est inferieur à 5 on mettra rouge, si stock est superieur que 10 on mettra vert(biensur
les images doivent etre sur le serveur) :
Enfin enregistré la page et tester.
j'espere que ca vous aidera et n'hesitez pas à me contacter.
samedi 19 juillet 2008
Workflow change field
i'd a specific workflow to build, and i used the workflow brought by SPD.
so when i wanted to update a 'Status' field in the list where the workflow will be executed upon, the field doesnt update.
i past days of searching out for make that work, but no solution for.
then i realise that maybe the requester must have the right to update if i want that his request will be updated too, here i switch to authorisation form into the list, gives the right to the requester to update their data, finally i tested the workflow.
the result was : Amazing because it worked.
so when i wanted to update a 'Status' field in the list where the workflow will be executed upon, the field doesnt update.
i past days of searching out for make that work, but no solution for.
then i realise that maybe the requester must have the right to update if i want that his request will be updated too, here i switch to authorisation form into the list, gives the right to the requester to update their data, finally i tested the workflow.
the result was : Amazing because it worked.
mercredi 16 juillet 2008
Custom search attached to a specific list
i encountered a specific need when i was working on a specific Intranet project using MOSS 2007 technologie.
it was about searching for contact on a specific list with these own fields, i tried the ContactTemplate provided by Microsoft team but it was basic, so i began to learn how to customize it to lead to my need.
After a few days of work and insomnia lol, i attained my purpose.
so now there's the steps :
Before all, to realize that you have to combine 2 page:
first with the textbox controle where you'll type your contact name
second where the search will be executed
In this article i'll discuss only the first page content.
1.Go to Form Compnent Webpart in Sharepoint control in insert menu
2.now go through the control inserted and replace the javascript script with that one :
//![CDATA[
//div style="height:400px;"//
//script type="text/javascript"//
function commitSearch(text) {
var frame = document.getElementById("contactFrame");
if (text == "") frame.src = "Results.aspx?ReturnAll=Yes";
else frame.src = "Results.aspx?Search=" + text;
}
//script//
//input type="text" style="border:1px gray solid;" id="contactSearch" name="contactSearch" onkeyup="commitSearch(this.value);"//
//iframe id="contactFrame" style="width:100%; height: 100%; margin-bottom:-30px; padding-bottom:30px;" src="Results.aspx?ReturnAll=Yes" scrolling="auto" frameborder="no"//
//iframe//
//div>]]//
where the result.aspx is the second page that i'll og though after, and remeber the parameter "ReturnAll=Yes" and "Search" because we'll need them after.
the function 'commitSearch' will evaluate the text typed, if its different of empty the cpntent will be transferred to the Results.aspx as value of the parameter Search else the parameter ReturnAll=yes will be the transferred one, and with that the final search result will be performed.
the second page content will be the next post.
Enjoy :)
it was about searching for contact on a specific list with these own fields, i tried the ContactTemplate provided by Microsoft team but it was basic, so i began to learn how to customize it to lead to my need.
After a few days of work and insomnia lol, i attained my purpose.
so now there's the steps :
Before all, to realize that you have to combine 2 page:
first with the textbox controle where you'll type your contact name
second where the search will be executed
In this article i'll discuss only the first page content.
1.Go to Form Compnent Webpart in Sharepoint control in insert menu
2.now go through the control inserted and replace the javascript script with that one :
//![CDATA[
//div style="height:400px;"//
//script type="text/javascript"//
function commitSearch(text) {
var frame = document.getElementById("contactFrame");
if (text == "") frame.src = "Results.aspx?ReturnAll=Yes";
else frame.src = "Results.aspx?Search=" + text;
}
//script//
//input type="text" style="border:1px gray solid;" id="contactSearch" name="contactSearch" onkeyup="commitSearch(this.value);"//
//iframe id="contactFrame" style="width:100%; height: 100%; margin-bottom:-30px; padding-bottom:30px;" src="Results.aspx?ReturnAll=Yes" scrolling="auto" frameborder="no"//
//iframe//
//div>]]//
where the result.aspx is the second page that i'll og though after, and remeber the parameter "ReturnAll=Yes" and "Search" because we'll need them after.
the function 'commitSearch' will evaluate the text typed, if its different of empty the cpntent will be transferred to the Results.aspx as value of the parameter Search else the parameter ReturnAll=yes will be the transferred one, and with that the final search result will be performed.
the second page content will be the next post.
Enjoy :)
dimanche 13 juillet 2008
Allow script in SharePoint Pages
i forget to mention something related to get script work inside SharePoint page.
the key is you must add a tag in web.config file own to the current web application :

so inside you wouild find the file.open it and browse to 'SafeMode' tag, inside it you'll add this tag :

in this example by indicating 'VirtualPath="/*"' i assumed that script is safe inside all my pages, so personalize yours you will replace it with the page path like: /_catalogs/masterpage/default.master for just execute script inside default.aspx
the key is you must add a tag in web.config file own to the current web application :

so inside you wouild find the file.open it and browse to 'SafeMode' tag, inside it you'll add this tag :

in this example by indicating 'VirtualPath="/*"' i assumed that script is safe inside all my pages, so personalize yours you will replace it with the page path like: /_catalogs/masterpage/default.master for just execute script inside default.aspx
how to add your own script to a sharepoint MasterPage
first required thing is SharePoint Designer.
after that open the website where you want to include your script, browse out to your specifique page and open it.
but an important thing before is to extract the page, like that if you fall out in an fatal error you can cancel the extract and you return to the begin state of the page.
after all this precaution you open the page, add your script :
and like if you put the script in body tags, it will fired on page load so the field test1 will take the string "Hello World" after load end.
thats a simple example, you can do more complected thing with that.
i would thank Robert Jones for helping me to make that work.
Inscription à :
Articles (Atom)

