Archive for the ‘ BDC ’ Category

How to Add a Date Filter to a BDC

for Tammie, apologies for the late reply. i hope you will still find this useful.

I’ve worked with BDCs quite a bit, especially when MOSS was still very new (B2, B2TR, Gold Code, and RC). This is the only way I’ve gotten Date Filters to work in BDCs.

1. In the <FilterDescriptors> section, add your date filter descriptor.

<FilterDescriptor Type="Comparison" Name="Date Entered">
<Properties>
<Property Name="Comparator" Type="System.String">Equals</Property>
</Properties>
</FilterDescriptor>

2. In the <Parameters> section, add 2 parameters: a low date boundary, and a high date boundary

<Parameter Direction="In" Name="@min_date_entered">
<TypeDescriptor TypeName="System.DateTime" AssociatedFilter="Date Entered" Name="min_date_entered">
<DefaultValues>
<DefaultValue MethodInstanceName="MyListFinder" Type="System.DateTime">2000-01-01 01:01:01Z</DefaultValue>
<DefaultValue MethodInstanceName="MyListSpecificFinder" Type="System.DateTime">2000-01-01 01:01:01Z</DefaultValue>
</DefaultValues>
</TypeDescriptor>
</Parameter>
<Parameter Direction="In" Name="@max_date_entered">
<TypeDescriptor TypeName="System.DateTime" AssociatedFilter="Date Entered" Name="max_date_entered">
<DefaultValues>
<DefaultValue MethodInstanceName="MyListFinder" Type="System.DateTime">3000-01-01 01:01:01Z</DefaultValue>
<DefaultValue MethodInstanceName="MyListSpecificFinder" Type="System.DateTime">3000-01-01 01:01:01Z</DefaultValue>
</DefaultValues>
</TypeDescriptor>

3. For the list of return values, add your datetime column

<Parameter Direction="Return" Name="MyList">
<TypeDescriptor TypeName="System.Data.IDataReader, System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" IsCollection="true" Name="MyListDataReader">
<TypeDescriptors>
<TypeDescriptor TypeName="System.Data.IDataRecord, System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Name="MyListDataRecord">
<TypeDescriptors>

<TypeDescriptor TypeName="System.String" IdentifierName="my_id" Name="my_id">
<LocalizedDisplayNames>
<LocalizedDisplayName LCID="1033">CA ID</LocalizedDisplayName>
</LocalizedDisplayNames>
</TypeDescriptor>

<TypeDescriptor TypeName="System.DateTime" Name="date_entered">
<LocalizedDisplayNames>
<LocalizedDisplayName LCID="1033">Date Entered</LocalizedDisplayName>
</LocalizedDisplayNames>
<Properties>
<Property Name="DisplayByDefault" Type="System.Boolean">true</Property>
</Properties>
</TypeDescriptor>

</TypeDescriptors>
</TypeDescriptor>
</TypeDescriptors>
</TypeDescriptor>
</Parameter>

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

DEVTEACH/VANTUG 2007 – Sharepoint Integration Presentation Materials

Yaroslav and I did a presentation at VANTUG on November 22, 2007 (Thanks to Graham Jones, President of VANTUG, for inviting us to speak!). As promised, here are the presentation materials. These are the same materials we are going to use for DEVTEACH on November 28, 2007.

As we mentioned in the presentation, we used a real business case as a basis for the demo. The solution in our project involved:
– Sharepoint as portal/framework (specifically MOSS)
– WCF for communication between Sharepoint and backend databases
– Custom Web Part for entry forms and client-side validation
– BDC for search and data display
– SSNS for notification and audit trails

We tried to create a simpler version that uses most of the features above, and highlights the flexibility of Sharepoint as a framework.

Presentation

PRESENTATION FILE – Download the Powerpoint Presentations from here:
VANTUG November 2007 – Sharepoint Integration

Resources

Looking for additional references? You can check out the resource list for this presentation from my previous blog:
DevTeach/VANTUG Sharepoint 2007 Integration Presentation (Nov 2007): Resources

Screenshots: At A Glance


BDC

SSRS

SSNS

Custom Web Part with SSNS
Resources

Looking for additional references? You can check out the resource list for this presentation from my previous blog:
DevTeach/VANTUG Sharepoint 2007 Integration Presentation (Nov 2007): Resources

Database

PRESENTATION FILE – ProductDetail
Database File (setup_productdetail.zip)
This contains the ProductDetail table, and related views and stored procedures. This .sql file is enough for you to get the BDC and SSRS part of the demo working.

We used the AdventureWorksLT database as our base database, and added a few tables/view/stored procedures.

This is the ProductDetail ERD:

1. Download the AdventureWorksLT database. You can download the AdventureWorksLT database from CodePlex (http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=4004).
2. Download the SQL file for the presentation here.
3. Open up the setup_productdetail.sql file in SQL Server Management Studio.
4. Execute

Business Data Catalog (BDC)

PRESENTATION FILE – BDC:
BDC File (AdventureWorksProductDetailADF.zip)
This file contains the ProductDetail BDC Application Definition File

The BDC is a MOSS (Microsoft Office Sharepoint Server) only feature. This will not run on WSS.

Sample Screenshot:


1. If you don’t have access to MOSS, you can download the MOSS trial version from http://www.microsoft.com/downloads/details.aspx?FamilyId=2E6E5A9C-EBF6-4F7F-8467-F4DE6BD6B831&displaylang=en
2. Open Central Administration
3. Go to Shared Services
4. Under the Business Data Catalog section, click on Import Application Definition.
5. Browse to AdventureWorksProductDetailADF.xml, accept defaults and click on OK.

Some people asked during the presentation what I use to create the BDCs. Since I started working on the BDC since MOSS’s B2TR, I’ve grown accustomed to writing the ADF by hand. I did try the BDC Metaman at that time – which was then still a beta (and free!) version developed by Todd Baginski.

To debug BDC’s to date, however, you have 2 indispensible friends:
1. Event Viewer
2. 12 Hive LOGS folder (C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12LOGS). If you can’t see any relevant logs, check Central Admin and get MOSS to log “Business Data”.
3. When updating the BDC:
– you will need to manually update the Version in the ADF
– you may need to disable caching (from Web Part properties)
– at times, you may need to delete the BDC Application Instance and recreate
(Not sure exactly when these things happen, but this will be one my next discovery quests!)
4. Last but not least, make sure you check the permissions. Whoever’s using the BDC needs to be added to the BDC permissions list with EXECUTE permissions.

SQL Server 2005 Reporting Services – Integrated Mode with Sharepoint

PRESENTATION FILE – Sample SSRS Project:
Sample Report Project on ProductDetail table

The bulk of the work in this section is not about creating the reports, it is configuring the environment.
I’ve used three main resources, which I reference in a previous blog (DevTeach/VANTUG Sharepoint 2007 Integration Presentation (Nov 2007): Resources)

Raju Sakthivel. Microsoft SQL Server Reporting Services – Installation and Configuration Guide for SharePoint Integration Mode (very good resource, and a must read if you are planning to deploy SSRS Integrated Mode)
http://blogs.msdn.com/sharepoint/attachment/4194088.ashx

How to: Configure SharePoint Integration on Multiple Servers
http://technet.microsoft.com/en-us/library/bb677365.aspx

How to: Configure SharePoint Integration on a Standalone Server
http://technet.microsoft.com/en-us/library/bb677368.aspx

Sample Screenshot:


SSRS Integrated Mode introduces 3 new content types to Sharepoint: Report Builder Model, Report Builder Report and Report Data Source.


Points to note before you pull your hair out:
– You must get Kerberos working. Make sure your SPNs are in place.
– You must install SQL Server 2005 SP2.
– Don’t look for Report Manager. It’s not there. Sharepoint Integrated mode does away with the Report Manager. Other unsupported features are documented here: http://technet.microsoft.com/en-us/library/bb326290.aspx
– When deploying, you need to provide the URL to the document libraries and URL to the site you are deploying to. This could be easy to miss especially if you are used to the Report Manager. To check this:
– Open your Project in Visual Studio
– Right click on your project from the Object Explorer > Properties
– Make sure your


Custom Web Part – Hello World

PRESENTATION FILE – Basic Custom Web Part:
Yaro-Softlanding.SampleWebpart.zip
These are the files provided by Yaroslav for creating your basic hello world custom web part:

SQL Server 2005 Notification Services

PRESENTATION FILE – SSNS:
SSNS File (SSNS – NSProduct2.zip)
This file contains the ADF, ICF, XSL, schemas, sample events you need to get started on Notification Services.



Microsoft has provided a number of good step-by-step tutorials. You can start with:
MSDN. SQL Server 2005 Notification Services Tutorial
http://msdn2.microsoft.com/en-us/library/ms170337.aspx

Here’s a quick start guide:
1. If you don’t have Notification Services installed, install notification service:
a. Run the SQL Server 2005 Setup Disk
b. Choose to add components.
1. Create your ADF file.
2. Create your ICF file.
3. Create a new SQL Server Notification Services instance and enable
4. Register the Notification Service you created as a Windows Service
5. Assign permissions to an Event folder if you are using a FileWatcher
6. Start the service
7. Add subscribers
8. Test, test, test

If you are debugging:
1. Check the NotificationDistribution table in the generated [InstanceName][ApplicationName] database. This should tell you if your notifications were successfully delivered or not.
2. Check the Event Viewer
3. Check the SQL Logs

Other things worth checking:
1. throttle
2. illegal XML characters

Oh, and if you want to update your CSS/HTML/XSL file, you need to update your notification instance. It’s not just going to pick up the style or content changes.

UNFORTUNATELY, to my dismay, the July CTP of Katmai’s readme file announces very silently that Notification Services days are over (or at least that’s what it sounds like). I liked working with Notification Services :(

“SQL Server Notification Services will not be included as a component of SQL Server 2008, but will continue to be supported as part of the SQL Server 2005 product support life-cycle. Moving forward, support for key notification scenarios will be incorporated into SQL Server Reporting Services. Existing Reporting Services functionality, such as data driven subscriptions, addresses some of the notification requirements. Features to support additional notification scenarios may be expected in future releases.”

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

DevTeach/VANTUG Presentation: Resources

List of useful resources. Most of these I’ve used or read at some point, and revisited in preparation for the VANTUG/DevTeach demo. I hope this becomes useful to someone.

Building Your Dev Environment
Tony Zink. Creating a MOSS VPC Image: The whole 9 yardshttp://www.pptspaces.com/sharepointreporterblog/Lists/Posts/Post.aspx?ID=28
Bill English. Installing a New Microsoft Office SharePoint Server 2007 Portal: Step-by-Step Instructionshttp://mindsharpblogs.com/bill/archive/2006/06/27/1153.aspx
Sahil Malik. A Single Developer’s SharePoint 2007 Development Environment http://blah.winsmarts.com/2007-10-A_Single_Developers_SharePoint_2007_Development_Environment.aspx

Custom Web Parts
Developer Introduction to Workflows for Windows SharePoint Services 3.0 and SharePoint Server 2007 http://msdn2.microsoft.com/en-US/library/aa830816.aspx
Sharepoint Web Parts Overview http://msdn2.microsoft.com/en-us/library/ms432401.aspx
Windows SharePoint Services Web Part Infrastructurehttp://msdn2.microsoft.com/en-us/library/ms415560.aspx
Walkthrough: Creating a Basic SharePoint Web Parthttp://msdn2.microsoft.com/en-us/library/ms452873.aspx
Walkthrough: Creating Connectable SharePoint Web Partshttp://msdn2.microsoft.com/en-us/library/ms469765.aspx
Creating Web Parts in Windows SharePoint Services http://msdn2.microsoft.com/en-us/library/ms367238.aspx
Working with the Windows SharePoint Services WebPart Class http://msdn2.microsoft.com/en-us/library/ms473203.aspx
Channel 9 Video: Building ASP.NET Web Parts for Windows SharePoint Services 3.0http://channel9.msdn.com/ShowPost.aspx?PostID=192071
15 Seconds: Building Web Parts for Windows SharePoint Services 3.0http://15seconds.com/issue/060824.htm
15 Seconds: Building an ASP.NET 2.0 Web Part for Deployment to WSS V3.0 and MOSS 2007http://15seconds.com/issue/060914.htm
Walkthrough: Creating an ASP.NET Web Part for the AdventureWorks Business Data Application Samplehttp://msdn2.microsoft.com/en-us/library/ms558854.aspx
SharePoint Products and Technologies: Creating Custom Web Part Page Templates Samplehttp://www.microsoft.com/downloads/details.aspx?familyid=48b2c899-db2c-4a93-aa95-af4a37fa8ae8&displaylang=en
Sahil Malik. Writing Custom Webparts for Sharepoint 2007http://blah.winsmarts.com/2006/05/14/writing-custom-webparts-for-sharepoint-2007.aspx

SQL CLR
CLR Integration in SQL Server 2005http://aspalliance.com/1081_CLR_Integration_in_SQL_Server_2005.2
Building my First SQL Server 2005 CLRhttp://www.simple-talk.com/sql/learn-sql-server/building-my-first-sql-server-2005-clr/
Using Signed Assemblies for SQLCLR: Doing the Safety Dancehttp://www.sqljunkies.com/WebLog/ktegels/articles/SigningSQLCLRAssemblies.aspx

BDC
MSDN: Business Data Cataloghttp://msdn2.microsoft.com/en-us/library/ms563661.aspx
Business Data Catalog Sampleshttp://msdn2.microsoft.com/en-us/library/aa598181.aspx
Sahil Malik. SharePoint 2007: BDC – The Business Data Cataloghttp://blah.winsmarts.com/2007-4-SharePoint_2007__BDC_-_The_Business_Data_Catalog.aspx
TechNet Virtual Lab: Getting Started with the Business Data Catalog in Microsoft Office SharePoint Server 2007 http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032331910&EventCategory=3&culture=en-US&CountryCode=US
OS303 – SharePoint Server 2007 Business Data Catalog: Integrating Line of Business Data and Applications into Enterprise Portals (OS303_Burke.wmv)http://www.microsoft.com/downloads/details.aspx?FamilyID=5ec4193a-8061-4fd8-8ca4-574540049fe9&DisplayLang=en
Microsoft SharePoint Products and Technologies Team Blog: Business Data Cataloghttp://blogs.msdn.com/sharepoint/archive/2006/04/18/578194.aspx
AdventureWorks SQL Server 2005 BDC Samplehttp://msdn2.microsoft.com/en-us/library/ms494876.aspx
Troubleshooting Business Data Clients and Metadatahttp://msdn2.microsoft.com/en-us/library/ms499588.aspx
Walkthrough: Using the Business Data Catalog Security Trimmer to Trim Search Resultshttp://msdn2.microsoft.com/en-us/library/bb447548.aspx

Notification Services
Building Effective SQL Server Notification Applicationshttp://www.simple-talk.com/sql/sql-server-2005/building-effective-sql-server-notification-applications-part-i/
SQL Server 2005 Notification Services Tutorial.http://msdn2.microsoft.com/en-us/library/ms170337.aspx
MSDN Webcast: Introducing Notification Services in SQL Server 2005—Level 200 http://msevents.microsoft.com/cui/webcasteventdetails.aspx?eventid=1032263436&eventcategory=5&culture=en-us&countrycode=us

Reporting Services
Raju Sakthivel. Microsoft SQL Server Reporting Services – Installation and Configuration Guide for SharePoint Integration Mode (very good resource)http://blogs.msdn.com/sharepoint/attachment/4194088.ashx
Microsoft SharePoint Products and Technologies Team Blog. Microsoft SQL Server 2005 SP2 Reporting Services integration with WSS 3.0 and MOSS 2007.http://blogs.msdn.com/sharepoint/archive/2007/02/19/microsoft-sql-server-2005-sp2-reporting-services-integration-with-wss-3-0-and-moss-2007.aspx
How to: Configure SharePoint Integration on Multiple Servershttp://technet.microsoft.com/en-us/library/bb677365.aspx
How to: Configure SharePoint Integration on a Standalone Serverhttp://technet.microsoft.com/en-us/library/bb677368.aspx
Reporting Services Configuration How-to Topicshttp://msdn2.microsoft.com/en-us/library/ms157412.aspx
Report Server How-to Topics (SharePoint Integrated Mode)http://msdn2.microsoft.com/en-us/library/bb283321.aspx
SQL Server 2005 Reporting Services Tutorials.http://msdn2.microsoft.com/en-us/library/ms170246.aspx
William Li. Service Account Configuration for Reporting Servicehttp://blogs.msdn.com/williaml/archive/2006/10/21/service-account-configuration-for-reporting-service.aspx

Tools and Utilities
Windows SharePoint Services 3.0 Tools: Visual Studio 2005 Extensionshttp://www.microsoft.com/downloads/details.aspx?familyid=19f21e5e-b715-4f0c-b959-8c6dcbdc1057&displaylang=en
.NET Reflectorhttp://www.aisto.com/roeder/dotnet/
SQL Server 2005 Sample Databases (including AdventureWorksLT)http://www.codeplex.com/MSFTDBProdSamples
SQL Server 2005 SP2http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/servicepacks/sp2.mspx
MOSS SDK – August 2007http://www.microsoft.com/downloads/details.aspx?familyid=6d94e307-67d9-41ac-b2d6-0074d6286fa9&displaylang=en
BDC Editor (included in MOSS SDK – August 2007 Release)http://www.microsoft.com/downloads/details.aspx?familyid=6d94e307-67d9-41ac-b2d6-0074d6286fa9&displaylang=en
BDC Metamanhttp://www.bdcmetaman.com/
Microsoft Virtual Serverhttp://www.microsoft.com/windowsserversystem/virtualserver/
Windows Powershell http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx
SharePoint Products and Technologies: Creating Custom Web Part Page Templates Samplehttp://www.microsoft.com/downloads/details.aspx?familyid=48b2c899-db2c-4a93-aa95-af4a37fa8ae8&displaylang=en
Microsoft SQL Server 2005 Reporting Services Add-in for Microsoft SharePoint Technologieshttp://www.microsoft.com/downloads/details.aspx?FamilyID=1E53F882-0C16-4847-B331-132274AE8C84&displaylang=en

Additional Resources
Application Templates for Windows SharePoint Services 3.0http://technet.microsoft.com/en-us/windowsserver/sharepoint/bb407286.aspx
WSS How To’shttp://office.microsoft.com/en-us/sharepointtechnology/FX101494691033.aspx?ofcresset=1
MOSS How To’shttp://office.microsoft.com/en-us/sharepointserver/FX101211721033.aspx
Windows Powershell Script Repositoryhttp://www.microsoft.com/technet/scriptcenter/scripts/msh/default.mspx?mfr=true

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

How to Show Your BDC Results in XML

Lifesaver BDC XSLT! This XSL snippet of code allows you to show your BDC results in XML. This is extremely useful especially when you are trying to style your BDC results using XSLT.

This is applicable to BDCs or Data View Web Parts :
1. Edit the Page
2. Click Edit on the BDC Web Part
3. Modify Sharepoint Web Part
4. Click on XSL Source Editor

5. Type the following:


VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
`