Pages

Thursday, October 23, 2008

Integration and Configuration of Microsoft Dynamics GP 10.0 for SharePoint Server 2007

Microsoft Dynamic GP provides financial management functionality that includes general ledger, accounts payable, and accounts receivable modules to bank reporting, cash flow management, and reconciliation. It’s like ERP software.


Dynamic GP 10.0 has same look and feel like Microsoft Office Outlook and it also extend its business functionality through Microsoft Office SharePoint Server 2007, SQL Reporting Services, Web Services, BizTalk, Microsoft Office Excel, and Microsoft Office Word.



After integrating Dynamics GP 10.0 with MOSS 2007, users can access and analyze data from Dynamics GP and from any other application. User can easily create and deploy Office Excel reports to SharePoint Server.
Dynamic GP can export all their excel reports to SharePoint site in data connection and report library, when we are installing Dynamic GP 10.0, one installer/connector or utility is come with Dynamic GP which will helpful for connecting Dynamic GP SQL Server database and exports all company or specific company records to SharePoint site and create data connections and report library into given SharePoint site.



Steps for integrating and configuring Dynamic GP 10.0 to SharePoint site for excel reports which will be displayed into excel services.

1.    Click on connector installer for Microsoft.Dynamics.GP.BusinessIntelligence.MossDeployment and first select Data Connection checkbox for Microsoft Dynamics GP, it will deploy to SharePoint server.



2.    Enter Dynamic GP Database server name and credentials for accessing database server.



3.    Select the respective Dynamic GP Databases, which we want to deploy to SharePoint server.



4.    Give the SharePoint site URL and Data connection and Report Library name in which are data connection and report will be deploy.



5.    Now follow same step from step No 1 for creating excel reports for the Microsoft Dynamic GP data, first we have created Data connection, because before creating excel reports, it require connections. Follow same step from 2 to 4.



After doing above process, it will create data connection and reports into SharePoint site into Data Connections and Report Library as per below screenshot.



Now we can open Report Library and open excel reports into excel services of the SharePoint site.

Tuesday, October 21, 2008

SharePoint Security model

I have found some useful information related to SharePoint security from below links.

http://blogs.devhorizon.com/blogs/reza_on_blogging/archive/2007/03/12/457.aspx (How to break inheritance and create unique security model from object model, also see second part of current blog)

http://blogs.msdn.com/joelo/archive/2007/08/23/sharepoint-security-and-compliance-resources.aspx ( security improvement in MOSS, how to create security model for internet, intranet and extranet sharepoint site)

http://www.15seconds.com/issue/040511.htm (SharePoint and .NET security model)

http://www.sharepointsecurity.com/ (All about SharePoint security framework)

Monday, October 20, 2008

SSRS 2005 deployment to FBA enabled MOSS site

I was having problem to deployed SSRS 2005 Report Model from visual studio to SharePoint Integrated mode with Forms Authentication enabled on MOSS site. It gives an error message "A connection could not be made to report server "http"//<sharepointservername>/"

Though, I was successfully able to deploy SSRS 2005 Report Model from visual studio to SharePoint Integrated mode with Windows Authentication enabled on MOSS site.

I installed SharePoint 2007 server, SQL server 2005 Developer Edition with sp2 and also applied hotfixes from Microsoft for reports to work with Forms Authentication.

I also worked with Microsoft Support team and I tried to find the resolution, at the last I came to one common point that its design limitation of SharePoint and sql server, so Microsoft support team told me that because of security reason, it has been designed that way only.

Few people already notice this bug and some of them get the temporary patch/fix from Microsoft but its not permanent solution, Microsoft is saying that this problem will resolved with SQL Server SP3.

Reference link :

http://www.sharepointblogs.com/nrdev/archive/2007/06/21/ssrs-in-sharepoint-2007-site-using-forms-based-authentication-sharepoint-integrated-mode.aspx

Fetch list item using SPQuery

One of my friend has one scenario in which he has to change display text of one of the column of
Data Grid web part and Back color of Submit button quickly without much changes into code, so for finishing task quickly he approach below steps.

Normally we can keep all configuration values of project in web.config file to avoid deployment in small change cases.

The second way to do it is to keep these values in SharePoint List (values like Some display name
(webpart title, column header text, etc), color).

Example :

I have list with following 4 columns : Title, ElementID, Language, ElementType

In code, we can get any parameter value by calling the following function :

string webPartTitle = queryForName("ContractDetails_WebPart","WebPartTitle", "en").ToString();

This is very helpful technique in terms of small display changes because it removes overheads of going in the code again and deploying again.

public static string queryForName(string Keyword, string Type, string Language)
{
string Name = string.Empty;
SPWeb currentWeb = SPContext.Current.Web;
try
{
SPList elementList = currentWeb.Lists[_ElementList];
string queryString = "<Where><And><And><Eq><FieldRef Name=\"ElementID\" /><Value
Type=\"Text\">" + Keyword + "</Value></Eq><Eq><FieldRef Name=\"ElementType\" /><Value Type=\"Lookup\">" + Type +"</Value></Eq></And><Eq><FieldRef Name=\"Language\" /><Value
Type=\"Lookup\">" + Language + "</Value></Eq></And></Where>";

SPQuery query = new SPQuery();
query.Query = queryString;
SPListItemCollection results;
results = elementList.GetItems(query);
int itemsReturned = results.Count;

if (itemsReturned == 1)
{
foreach (SPListItem result in results)
{
Name = result[_ElementContent].ToString();
break;
}
}
else
{
Name = "";
}
return Name;
}
catch (Exception ex)
{
return Name;
}
}

Saturday, October 18, 2008

Custom Themes in MOSS 2007

Steps to creating custom themes in MOSS 2007

1. Explore to the Themes folder e.g. LocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\Themes

2. Make a copy of one of the existing theme folders and rename it e.g. MyCustomTheme.

3. Rename the .INF file which is in the MyCustomTheme folder to MyCustomTheme.INF

4. Edit MyCustomTheme.INF.

1. At the info section, Change the title, to “Custom Site Theme”.
2. In the titles section, rename the names to your new name. This section is to present the name in the different language.

5. Provide an image to give a preview of your theme.
This image should be placed in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES. E.g. MyCustomThemelogo.gif

6. Modify the c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\Layouts\1033\SPTHEMES.xml to include a reference to the new MyCustomTheme theme

<Templates>
<TemplateID>MyCustomTheme</TemplateID>
<DisplayName> MyCustomTheme</DisplayName>

<Description> Apply this Theme for applying MyCustomThemelogo and unique colors and fonts styles.

</Description>
<Thumbnail>images/MyCustomTheme.gif</Thumbnail>
<Preview>images/ MyCustomTheme.gif</Preview>
</Templates>

7. Modify the CSS within MyCustomTheme folder to personalize your theme.

8. Run iisreset from the command prompt

Apply the new theme "MyCustomTheme" to a site by click on SiteActions -> SiteSettings -> sitetheme.

Now Select the newly created theme and click on apply and you can see new look of your site according to you theme.

SharePoint Custom Actions

I came across requirement of customizing out of box SharePoint pages (like create.aspx, spcf.aspx, qstnew.aspx) to fulfill client need to add functionality or custom code in those pages.

Generally we are making copy of those pages for making changes and add custom link on page from where it’s getting called.

Example:

If you are required to override the Web Part Page/Survey Creation Page (spcf.aspx/new.aspx) then you have to add link under particular Group in Create.aspx page. This you can achieve without writing any code in create.aspx by creating Feature using Custom Actions.

SharePoint provides so many defaults Custom Actions which we can use as per our creativity.

Code example: To add custom link in Site Actions Menu which takes user to custCreate.aspx page.

<CustomAction
Id = "RepLetterCustCreatePage"
Title = "Custom Create"
Sequence="2000"
Description = "Add a new library, list or web page to this website using custom Create Page."
GroupId = "SiteActions"
Location = "Microsoft.SharePoint.StandardMenu">

<UrlAction Url="~site/_layouts/custcreate.aspx"/>

</CustomAction>

Example :

I also added custom link into SharePoint Central Admin Site into Operation TAB, on clicking of new added link, I am opening my ASPX page from Central Admin site.

Element file look like:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

<CustomActionGroup
Id="CustomSecurity"
Location="Microsoft.SharePoint.Administration.Operations"
Title="Custom Security"
Sequence="1000"
/>

<CustomAction
Id="TerminationJob"
GroupId="CustomSecurity"
Location="Microsoft.SharePoint.Administration.Operations"
Sequence="10"
Title="Termination Job">

<UrlAction Url="/_admin/TerminationJob.aspx"/>

</CustomAction>

</Elements>

One more thing, I remember that after developing feature, I was not able to see custom link into Central Admin site, I came to know that in feature file, where we are defining element manifest file, I use wrong tag for giving XML file location, we have to use

<ElementManifests>

<ElementManifest Location="elementManifest.xml" />

</ElementManifests>

I was using

<ElementFile Location="elementManifest.xml" />

Useful reference link for Custom Actions:

http://msdn.microsoft.com/en-us/library/bb802730.aspx

http://msdn.microsoft.com/en-us/library/ms473643.aspx

Disabling some file export options in Reporting Service

There are some options available in Reporting services to export reports.

If you want to disable few options from that list into all application on your server then you can make it visible false by editing one central config file named "rsreportserver.config"

You need to make visible false which ever extension you don't want in the list of export report.

But if you want to make this for only one particular application then you can write down below code into your application:

private void DisableUnwantedExportFormats()
{
foreach (RenderingExtension extension in ReportViewer1.ServerReport.ListRenderingExtensions())
{
if (extension.Name == "XML" || extension.Name == "IMAGE" || extension.Name == "MHTML"
|| extension.Name == "PDF" || extension.Name =="RGDI" || extension.Name == "XLTemplate"
|| extension.Name == "WordTemplate" || extension.Name == "HTML4.0" || extension.Name == "HTML3.2")
{
FieldInfo info = extension.GetType().GetField("m_serverExtension", BindingFlags.NonPublic |     BindingFlags.Instance);
if (info != null)
{
Extension rsExtension = info.GetValue(extension) as Extension;
if (rsExtension != null)
{
rsExtension.Visible = false;
}
}
}
}
}

Tuesday, October 14, 2008

SPListItem Class

In SharePoint object model, for document library, each item consider as SPListItem in code, like If I have one word document file and one folder then both comes under SPListItem class, but for differentiate purpose we can check SPListItem.ContentType.Name and compare with "folder" type or anything.

SharePoint Manager 2007 – Administration Tool

SharePoint Manager 2007 - Administration tool which will give one window interface to see all our farms web application lists and object model data.

http://www.codeplex.com/spm

It’s not like Avepoint tool, because Avepoint is used for taking backup, restore and scheduling all things, SPM 2007 don’t have this type of facility, but it’s give inner details of all farm web application, list, site collection and features also.

We can also change any value and that will reflect into Central Admin or web application level from SPM 2007.

There is one loop hole or bug into SharePoint Manager 2007 tool, it will display plain text password.
We can see password by opening tool and going to

ENT Farm Configuration -> Administration Service -> Web Application -> Click on web application name -> SharePoint Central Administration v3

Check properties into right side of window, it will show username and plain password field.

Difference between ASP.NET and windows form Drop down list/Combo box

There is difference between ASP.NET and windows form Drop down list/Combo box.

In ASP.NET drop down list, while adding items into drop down list, we can assign/add only List Item or string into dropdown list (dropdownname.Items.add)

In Window Combo box, we can assign/add object into controls.

So there might be limitation if we want to add Object into ASP.NET drop down list item by items.

If we are going to add ListItems in ASP.Net Dropdown by
Listitem itm = new ListItem and add that drpobject.Items.add(itm)

And if we are going to select particular item by drpobject.Items[1].selected = true

We will get error like "Multiple Items cannot select".

So if we do not want this item we have to add items like drpobject.items.add(new listitm(Displaytext,Value)) and we want to select some other values then we can also use
dropdown.clearselection() method.

Meta data information from SharePoint document

We can see meta data and content type information into document quickly by doing Right click on document “Properties” into file system, there will be tab called “Custom”, from this tab, we can see all meta data like same way we used to do “View Properties” from selecting document into SharePoint site.

Access denied error while installing feature

I was getting “Access denied” in command prompt when I tried to execute below command

Stsadm –o installfeature –name “featurename” –force

Solution:

1. Log in user was not added into Central Admin Database security group into SQL Server.

2. Log in user has to be in farm administrator/site collection users group in SharePoint site.

By adding my current Log in users into above two parts, I was able to successfully install feature.