首页 文章

在sharepoint数据视图Web部件中使用列表和文档库中的数据

提问于
浏览
0

如何显示来自两个不同sharepoint列表的数据 . 我有一个包含任务列表和文档库的审批系统 . 如果我通过将两个列表链接为数据源来放置显示批准过程中每个文档的当前进度/状态的DVWP,对用户会有帮助 .

我确实在相关数据源>链接到另一个数据源中看到一个选项...但我没有找到任何有关如何在SPD 2007中使用此功能的在线资源.MOSS 2007应用程序 .

有谁可以建议一些参考链接或解决方案......

谢谢!

2 回答

  • 0

    在单个数据视图中显示来自多个源的数据

    适用于:Microsoft Office SharePoint Designer 2007

    http://office.microsoft.com/en-us/sharepoint-designer-help/display-data-from-multiple-sources-in-a-single-data-view-HA010099144.aspx

  • 0

    您可以使用连接器来简化您的开发过程,例如http://www.bendsoft.com/net-sharepoint-connector/ .

    使用这样的组件,您只需连接到列表,就像它们在普通SQL表中一样,并从每个列表中选择所需的数据并以您喜欢的方式输出 .

    在例子中

    string query = "SELECT ID, LinkTitle AS Title FROM list";
    conn = new SharePointConnection(connectionString);
    SharePointDataAdapter adapter = new SharePointDataAdapter(query, conn);
    
    DataTable dt = new DataTable();
    adapter.Fill(dt);
    

    或者使用辅助方法填充DataGrid

    string query = "Select * from mylist.viewname";
    DataGrid dataGrid = new DataGrid();
    dataGrid.DataSource = Camelot.SharePointConnector.Data.Helper.ExecuteDataTable(query, connectionString);
    dataGrid.DataBind();
    Controls.Add(dataGrid);
    

    你可以在这里看到更多的例子,access list in sharepoint 2007 using c#

    您希望如何烘焙数据取决于您的想象力,但它肯定会简化您的工作流程和SharePoint开发:)

相关问题