About Me

My photo
a Dynamic and Energetic guy.....

Tuesday, March 5, 2013

SSRS Can not Open Connection to report server

The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing. (rsReportServerDatabaseUnavailable)

The Solution is the re-configure SSRS using command
1) Open Command Prompt with privileges
2) Run
rsconfig -c -s SPSVR -d reportserverName -a Windows -u AD\administrator -p myp@ssw0rd



Wednesday, February 13, 2013

Add a Visual WebPart to a SandBox Solution in SharePoint 2010

When we create a Sandbox solution we can't add Visual Web-parts to it.
But it is mandatory when we create complex scenarios.
So we have a solution powered by Microsoft. --> "Visual Studio 2010 SharePoint Power Tools"

1) First download the small patch

2) Install the package (SPPowerTools_x86)
3) It Installs plugin to VS 2010
4) After created a SharePoint project, we can add "Visual WebParts (Sandboxed)" to our project

5) Can program our CODE, add complex logic

6) Can add all web controls to our .ASCX file
7) Then we have, full Web controls enabled WebPart (SANDBOX)




Sunday, February 10, 2013

Developer DashBoard In SharePoint 2010

1) Open Normal SharePoint Page, we can t see any dashboard item or ICON


2) Open command prompt and Change path to SharePoint 14 hive and type the command (STSADM)

3) OR, Open PowerShell with administrative privileges and run the PowerShell command
4) Open SharePoint page and view ICON in the top Right corner
 
5) View Data in the bottom panel of SharePoint page

*** It displays the time taken to load full page, any WebPart, render time for RIBBON and the execution time.

6) Can switch-off at any time with powershell command





Tuesday, January 29, 2013

PowerShell Command Builder

I got a nice tool that can create "Windows Power Shell Commands" dynamically.
Go here


Simple Power shell command generation screen,
"Create -SPSite"


"Add -SPSolution"

Simple...


Sunday, January 27, 2013

Apply MasterPage to all Site Collections Using PowerShell Commands

------------------------ Set Master Page ----------------------------- 
foreach ($site in get-spsite -url http://spsvr*) {
     $web = Get-SPWeb $site
     $web.CustomMasterUrl = "/_catalogs/masterpage/my_v4.master" 
     $web.Update()
}
 
------------------------ Using Other Method --------------------------
 
foreach ($site in Get-SPSite)
{
 foreach ($web in $Site.AllWebs)
 {
  $web.MasterUrl  = "/_catalogs/masterpage/my_v4.master";
  $web.CustomMasterUrl = "/_catalogs/masterpage/my_v4.master";  
  $web.update()
 }
} 
 
---------------------- Set Master Page For Web Application ------------
----------------------------------------------------------------------- 
#Enter a web application, get all the site collections in the web app
Add-PsSnapin Microsoft.SharePoint.PowerShell
Start-SPAssignment -Global

$web = Get-SPWeb 'http://spsvr:1111/'
#$web.CustomMasterUrl = "/_catalogs/masterpage/v4_TG.master"
$web.MasterUrl = "/_catalogs/masterpage/v4_TG.master"
$web.Update()


--------------------- Set Master Page For All Subsites --------------
----------------------------------------------------------------------
#Enter a web application, get all the site collections in the web app
Add-PsSnapin Microsoft.SharePoint.PowerShell

Start-SPAssignment -Global
$site = Get-SPSite 'http://spsvr:1111'
$topWeb = Get-SPWeb $site.Url
$site | Get-SPWeb -limit all | ForEach-Object 
{if (($_.WebTemplate -ne "SRCHCEN") -and ($_.WebTemplate -ne "SRCHCENTERLITE") -and ($_.WebTemplate -ne "SRCHCENTERFAST")) {$_.CustomMasterUrl = $topWeb.CustomMasterUrl;$_.AllProperties["__InheritsCustomMasterUrl"] = "True";$_.MasterUrl = $topWeb.MasterUrl;$_.AllProperties["__InheritsMasterUrl"] = "True";$_.AlternateCssUrl = $topWeb.AlternateCssUrl;$_.AllProperties["__InheritsAlternateCssUrl"] = "True";$_.Update();}}
Stop-SPAssignment -Global

Monday, December 10, 2012

Chart WebPart With Excel Data

Add Chart Web-Part
Customize WebPart properties


Create Data Connection with EXCEL file
After Set Excel path and data Range,
Data will be shown in tabular manner




Customize data and show in 3D mode

Data in Excel on Charts :)



SharePoint Excel file throws unable to process the request when opens


 When we open an excel on browser,

We have to enable settings inside Library

Then we have to create Excel Service Application using Central Administration


Verify whether the Excel Service Application is configured using central administration

Now we can view Excel sheet through browser



















Thursday, November 29, 2012

Install a dll to GAC in Windows Server 2008

Step -1
 
   Open the command prompt with 'Run as Administrator'.
 
Step - 2
 
   set the path for the gacutil command
 
   >cd C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin
 
Step -3
 
   Run the gacutil command
 
  C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin> gacutil.exe -i  "path to dll"


Monday, November 19, 2012

Income Tax based on Sri Lanka Salary

Personal Income Tax

Tax Free Allowance
Present tax free allowance of Rs. 300,000 (Rs. 25,000 per month) will be increased to Rs. 500,000 (Rs. 41,667 per month) and this will be extended to non – resident who are citizens of Sri Lanka.


Tax Slabs for Individual Tax Payers on Taxable Income

Tax Slabs (Rs) Rate
1st Rs. 500,000 - 4%
Next Rs. 500,000 - 8%
Next Rs. 500,000 -  12%
Next Rs. 500,000 - 16%
Next Rs. 500,000 - 20%
Balance - 24%

Thursday, September 27, 2012

Shrink All Databases In SQL 2008 Using A Query

IF EXISTS(select * from sysobjects where id = object_id('dbo.SP_ShrinkAllDatabasesOnServer') and xtype = 'P')
DROP PROCEDURE dbo.SP_ShrinkAllDatabasesOnServer
GO
CREATE PROCEDURE dbo.SP_ShrinkAllDatabasesOnServer
AS
BEGIN
CREATE TABLE #TempDatabasesTable
(
[DatabaseName] sysname not null primary key,
Mod tinyint not null default 1
)
INSERT INTO #TempDatabasesTable ([DatabaseName])
SELECT
name
FROM
master..sysdatabases
WHERE
dbid > 4
DECLARE @DatabaseName sysname
SET @DatabaseName = ''
WHILE @DatabaseName is not null
BEGIN
SET @DatabaseName = NULL


SELECT TOP 1 @DatabaseName = [DatabaseName] from #TempDatabasesTable where Mod = 1
IF @DatabaseName is NULL
break
print '*******************************************************************'
print '> DB: ' + @DatabaseName
print '> SET RECOVERY MODE SIMPLE'
declare @SqlCommand nvarchar(4000)
set @SqlCommand = 'ALTER DATABASE [' + @DatabaseName + '] SET recovery simple'
exec sp_executesql @SqlCommand
print '> Shrinking database'
set @SqlCommand = 'dbcc shrinkdatabase([' + @DatabaseName + '])'
exec sp_executesql @SqlCommand
update #TempDatabasesTable set Mod = 0 where [DatabaseName] = @DatabaseName
end
DROP TABLE #TempDatabasesTable
END
GO
exec dbo.SP_ShrinkAllDatabasesOnServer

My Masters