如何更改 infopath 表单模版的编程语言
如果你以前的为Infopath表单编程选择的语言为VB,现在希望改为用C#开发,可以以下方法
注意:改变语言后,你原来的代码就没有了,所以你应该保存源代码,然后在新语言环境中中心开发
1.On the Tools menu, click Form Options.
在工具菜单中,点击表单选项
2.Under Category in the Form Options dialog box, click Programming.
在类别中,选择编程
3Under Programming language, click Remove Code.
在编程语言中,点击删除代码
4.Click Yes in the message box warning you that you are about to remove the code from the form template.
当出现警告提示时,点击“是”
5In the Form template code language list, click the language that you want to use in the form template.
在表单模版代码语言中选择你希望采用的语言
OK
http://office.microsoft.com/en-us/infopath/HA102034701033.aspx
1.打开管理中心页面,然后点击左侧选项卡中的操作项,接着在右侧打开的操作页面中,依次点击拓扑结构和服务中服务器场中的服务和服务器上的服务(注意Search Indexing搜索索引服务一定要启用,另外,所有显示必须启动的项目一定要启动),并检验相应的服务都处于启动状态。
2.打开管理中心页面,然后点击左侧选项卡中应用程序管理项,接着在右侧打开的应用程序管理项中点击 Office SharePoint Server共享服务下的创建或配置此服务器场的共享服务,并新建一个SSP。
3.上述两步正确设置完毕后,重新点击管理中心页面,此时你会惊喜地发现红色警告不见了,在使用审批工作流时的Session State is not available的提示也消失了。同时看看第一张图显示的任务,也增加了一些。
2008-01-25 16:12 Sharepoint中得到spuser的两种方法
1
Get SPUser object from SPList item If you are doing a fair amount of programmatic access to SharePoint lists, you will quickly find there are a number of limitations with the data that is returned in each SPList item object in a SPListItemCollection (what is returned from a SPQuery object). One common problem which I have come across is getting more useful information from a user field (rather than their basic name).
I recently came across a post on David San Filippo's Blog which addresses this issue with a simple lookup method that he has written. I have included this below as it is a fantastic little piece of code, which gets you some great information about a user, when doing a query (rather than having to loop over the SiteCollection Users or something similar).
public static SPUser GetSPUser(SPListItem item, string key){ SPFieldUser field = item.Fields[key] as SPFieldUser; if (field != null) { SPFieldUserValue fieldValue = field.GetFieldValue(item[key].ToString()) as SPFieldUserValue; if (fieldValue != null) { return fieldValue.User; } } return null; }2SPSite siteCollection = SPControl.GetContextSite(Context);SPWeb site = siteCollection.AllWebs["Site_Name"];SPUser user = site.AllUsers["User_Name"];user.Email = "E-mail_Address";user.Name = "Display_Name";user.Notes = "User_Notes";user.Update();
2008-01-28 14:09 Sharepoint工作流任务权限问题(Sharepoint Workflow Task Security Problem)
开发人员在使用Sharepoint工作流时,常常遇到工作流权限控制不严格的问题,即任何人都可以对工作流任务进行审批,解决此问题有两种方法,分别针对两种情况
情况一:针对使用SharepointDesigner定制的工作流
使用EventHandler扩展的方法,在新建任务的EventHandler中,加入权限控制语句
情况二:针对使用VS2005编码定制的工作流
对CreateTask中的SpecialPermission属性进行赋值,将要授予权限的用户写入其中。
这里要注意的有两点:
1、要使用SpecialPermission,首先要定义一个全局公有变量
public HybridDictionary task1permission = new HybridDictionary();
2、要将这个新变量赋给CreateTask的SpecialPermission属性,方法是点击SpecialPermission属性旁边蓝色的感叹号,这是才会弹出绑定属性的窗口,才可以将此变量绑定。
以上两点完成后,就可以实现权限的控制了。
关键代码是:
task1permission.Add("INTRANET\Zhangsan,SPRoleType.Contributor);
2008-01-28 14:18 Sharepoint在工作流中如何得到当前登录用户
使用VS2005开发工作流时,我们希望在工作流的任务审批过程中,得到当前登录用户的信息,即对该任务真正进行审批的用户的信息,
可采用如下方法
1新增一个全局公有字符串变量
public String CurTaskUser = defalut(System.String);
2在工作流的设计视图中,选中onTaskChanged1活动,在属性编辑器中,找到Executor属性,将CurTaskUser绑定到该属性上
3你现在就可以在onTaskChanged_Invoked事件中,直接使用CurTaskUser得到当前登录用户的信息了。
将Excel数据导入到sharepoint 列表中
在网上查了很多帖子,都说没有一个直接的办法将Excel中的数据导入到sharepoint列表中,通常的处理办法是编程解决,
经过研究发现了一个办法,就是用粘贴的办法导入,其实sharepoint的操作中有一种操作(Action):Edit in Datasheet,选择此操作,则list界面变成可编辑的界面,此时将准备好的数据直接粘贴进去就达到了数据导入的作用
但是,这样做还是有一定限制的,就是用户数据比较难导入,其实即使用程序,想导入用户的数据也是很困难的,尤其是该用户还不存在于所有用户列表中时,希望其他朋友能分享关于sharepoint,list数据导入的办法。