Friday, December 24, 2010

How to copy assembly out of GAC?

You might Come across following situation while developing applications:
How to extract DLL from GAC?
How to take backup of dlls placed inside GAC?

Here's command that you can use to take backup of your GAC assemblies.

Create backup folder named 'AssemblyBack' where you want to place your backup files. I create folder at "C:\AssemblyBack"

Just navigate to the 'GAC_MSIL'
"C:\Windows\assembly\GAC_MSIL"

Once you are there just copy following command.
C:\Windows\assembly\GAC_MSIL>xcopy c:\AssemblyBack /s /y

Hope you find it useful.

Thanks,
Ashish Chotalia

Friday, December 17, 2010

sql server - Why the Full-Text indexing option is greyed out ?

If you find Full-Text Index option grayed out on particular table you can execute following command.

Open Query window and select database for which you want to activate Full-Text Index option. After that execute below code

EXEC sp_fulltext_database 'enable'

Thanks,
Ashish Chotalia

P.S - Replace [TableName] with yours.

Friday, December 3, 2010

Problem altering tables in SQL Server 2008

In SQL Server 2008 there's one option that prevents saving changes to table or alter script.

You might get error as shown below.



To resolve the issue follow steps mentioned below.

Go TO -> Tools -> Options -> Designers -> Uncheck Prevent saving changes that require table re-creation.

Here are the snaps for above solution.



Thanks,
AShish Chotalia

How to Resolve issue for Database diagram support objects cannot be installed

Many times you find situation when you need to design database using Database Diagram. When you try to open "Database Digram" node from SQL management studio you find following error.




You can resolve it by following script.

EXEC sp_dbcmptlevel 'DummyDB', '90';
go
ALTER AUTHORIZATION ON DATABASE::BIDashBoard TO "Domain\UserName"
go
use [DummyDB]
go
EXECUTE AS USER = N'dbo' REVERT
go

What above solution does ?
It will first make your compatibility level to 90. You can determine the level by below script.

select compatibility_level
from sys.databases
where name = 'DummyDB'

Here are list of compatibility level and MSSQL version mapping,

* 60 = MSSQL 6
* 65 = MSSQL 6.5
* 70 = MSSQL 7
* 80 = MSSQL 2000
* 90 = MSSQL 2005
* 100 = MSSQL 2008

Other thing is it will set authorization to the user name provided.
Right Click on Database
Go to properties
Click Files
you will end up as shown below.



Before running this script owner tab will be blank.
You can run above script or either go to the click button near by textbox and locate your user.

That's it.

Thanks,
Ashish Chotalia

Monday, November 29, 2010

Validate input values using javascript

Many times you are using javascript for allowing user to input only numeric values or special character etc.

I would like to share few javascript functions that you would find quite handy.


#1 Allows disabling keypress




#2 Allows you to enter numbers only



#3 Allows you to enter numbers with comma



#4 Allows you to enter numbers with comma



#5 Allows you to validate no of characters for textbox.




I will keep adding new functions.

Thanks,
Ashish Chotalia

Wednesday, November 24, 2010

SQL Insert Generator Stored Procedure

Below SP will be help full if you want to migrate your data from one database to another database. It will take table name as input parameter and provide you insert statement.

I have modified this SP to include "/" inside the field name as it was giving error earlier.

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROC [dbo].[InsertGenerator]
(@tableName varchar(100)) as

--Declare a cursor to retrieve column specific information for the specified table
DECLARE cursCol CURSOR FAST_FORWARD FOR 
SELECT column_name,data_type FROM information_schema.columns WHERE table_name = @tableName
OPEN cursCol
DECLARE @string nvarchar(3000) --for storing the first half of INSERT statement
DECLARE @stringData nvarchar(3000) --for storing the data (VALUES) related statement
DECLARE @dataType nvarchar(1000) --data types returned for respective columns
SET @string='INSERT '+@tableName+'('
SET @stringData=''

DECLARE @colName nvarchar(50)

FETCH NEXT FROM cursCol INTO @colName,@dataType

IF @@fetch_status<>0
 begin
 print 'Table '+@tableName+' not found, processing skipped.'
 close curscol
 deallocate curscol
 return
END

WHILE @@FETCH_STATUS=0
BEGIN

SET @colName = '['+@colName+']'
IF @dataType in ('varchar','char','nchar','nvarchar')
BEGIN
 --SET @stringData=@stringData+'''''''''+isnull('+@colName+','''')+'''''',''+'
 SET @stringData=@stringData+''''+'''+isnull('''''+'''''+'+@colName+'+'''''+''''',''NULL'')+'',''+'

END
ELSE
if @dataType in ('text','ntext') --if the datatype is text or something else 
BEGIN
 SET @stringData=@stringData+'''''''''+isnull(cast('+@colName+' as varchar(2000)),'''')+'''''',''+'

END
ELSE
IF @dataType = 'money' --because money doesn't get converted from varchar implicitly
BEGIN
 SET @stringData=@stringData+'''convert(money,''''''+isnull(cast('+@colName+' as varchar(200)),''0.0000'')+''''''),''+'

END
ELSE 
IF @dataType='datetime'
BEGIN
 --SET @stringData=@stringData+'''convert(datetime,''''''+isnull(cast('+@colName+' as varchar(200)),''0'')+''''''),''+'
 --SELECT 'INSERT Authorizations(StatusDate) VALUES('+'convert(datetime,'+isnull(''''+convert(varchar(200),StatusDate,121)+'''','NULL')+',121),)' FROM Authorizations
 --SET @stringData=@stringData+'''convert(money,''''''+isnull(cast('+@colName+' as varchar(200)),''0.0000'')+''''''),''+'
 SET @stringData=@stringData+'''convert(datetime,'+'''+isnull('''''+'''''+convert(varchar(200),'+@colName+',121)+'''''+''''',''NULL'')+'',121),''+'
  --                             'convert(datetime,'+isnull(''''+convert(varchar(200),StatusDate,121)+'''','NULL')+',121),)' FROM Authorizations
END
ELSE 
IF @dataType='image' 
BEGIN
 SET @stringData=@stringData+'''''''''+isnull(cast(convert(varbinary,'+@colName+') as varchar(6)),''0'')+'''''',''+'
END
ELSE --presuming the data type is int,bit,numeric,decimal 
BEGIN
 --SET @stringData=@stringData+'''''''''+isnull(cast('+@colName+' as varchar(200)),''0'')+'''''',''+'
 --SET @stringData=@stringData+'''convert(datetime,'+'''+isnull('''''+'''''+convert(varchar(200),'+@colName+',121)+'''''+''''',''NULL'')+'',121),''+'
 SET @stringData=@stringData+''''+'''+isnull('''''+'''''+convert(varchar(200),'+@colName+')+'''''+''''',''NULL'')+'',''+'

END

SET @string=@string+@colName+','

FETCH NEXT FROM cursCol INTO @colName,@dataType
END
DECLARE @Query nvarchar(4000)
print @string
SET @query ='SELECT '''+substring(@string,0,len(@string)) + ') VALUES(''+ ' + substring(@stringData,0,len(@stringData)-2)+'''+'')'' FROM '+@tableName
exec sp_executesql @query
--select @query

CLOSE cursCol
DEALLOCATE cursCol



Hope you find it useful. I have posted it for my future reference :)

Thanks,
Ashish Chotalia

Friday, November 19, 2010

Find text inside all stored procedure for selected database

You might find this hady while you want to find particular text exists with in all the procedure inside database.

SELECT DISTINCT OBJECT_NAME(id) FROM syscomments WHERE [text] LIKE '%User%'

Above query will search 'User' text inside all the stored procedure and will return distinct stored procedure names.

Hope you find it useful.

Thanks,
Ashish Chotalia

Wednesday, November 17, 2010

An unexpected error occurred after deploying Performance Point Server reports to SharePoint site

Once you create reports from Performance Point Server dashboard and deploy it to SharePoint site you might get following error.


To resolve above error there are few steps you need to follow as mentioned below.


STEP 1 - DEPLOY the web part solution to the Web application

The web part solution need not be ADDED, as the Configuration Manager would have already added it to the Solution store of the SharePoint Web server during initial installation of DVSS.

Run the following STSAdm command to DEPLOY the web part solution to the second SharePoint web application. Replace Your_SharePoint_WebApp_URL with the URL of the SharePoint web application including the port number.

stsadm.exe -o deploysolution -name PSCWebParts.cab -url http://Your_SharePoint_WebApp_URL /  -local    allowgacdeployment -force

In the case of SharePoint site example referenced in this article, the command line would be:
stsadm.exe -o deploysolution -name PSCWebParts.cab -url http://test:44444/ -local   -allowgacdeployment -force  

To confirm if the web part (pscwebpart.cab) has been deployed as a solution on your SharePoint site, go to Central Administration  Operations  Global Configuration  Solution Management. (http://Your_Central_Admin_Site_URL/_admin/solutions.aspx)

STEP 2 - Copy the master page to the new SharePoint site's master page gallery (web folder view)

The master page can be found at C:\Program Files\Microsoft Office PerformancePoint Server\3.0\Monitoring\Assemblies\PerformancePointDefault.master
To go to the web folder view of master page catalog for a site, go to http://test:60000/sites/Sales/_catalogs/masterpage. Select Actions Open with Windows Explorer. Copy the master page to this location.

STEP 3 - Add the following entries in web.config of the SharePoint web application

Add the following entries if any of the entries are not present in the web.config of the SharePoint web application (http://test:44444/) .

IMPORTANT: Backup the web.config file before making any updates.


a.       Entries under  <configSections> node

<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" />
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
    <sectionGroup name="Bpm">
      <section name="CustomReportViews" type="System.Configuration.DictionarySectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      <section name="CustomDataSourceProviders" type="System.Configuration.DictionarySectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      <section name="FCODaoProviders" type="System.Configuration.DictionarySectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      <section name="CustomParameterDataProviders" type="System.Configuration.DictionarySectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      <section name="CustomViewTransforms" type="System.Configuration.DictionarySectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    </sectionGroup>


b.      Entries under  <httpHandlers> node

<remove verb="*" path="*.asmx" />
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />


 c.       Entries under  <httpModules> node
     
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />


d.      The <globalization> node

<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="auto" uiCulture="auto" />


e.      Entries under  <assemblies> node

<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />


f.        Entries under  <pages> node

<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</controls>



g.       Entries under  <system.web> node

    <webServices>
      <protocols>
        <add name="HttpGet" />
        <add name="HttpPost" />
      </protocols>
    </webServices>


h.      Entries under  <appSettings> node.  Replace YOUR_DATABASE_SERVER with the SQL server instance where the Monitoring database is installed.
   
<add key="Bpm.MonitoringConnectionString" value="Data Source= YOUR_DATABASE_SERVER;Initial Catalog=PPSMonitoring;Integrated Security=True" />
    <add key="Bpm.ServerConnectionPerUser" value="False" />
    <add key="Bpm.ElementMemoryCacheTime" value="5" />
    <add key="Bpm.EnableAnalyticQueryLogging" value="False" />
    <add key="Bpm.UseASCustomData" value="False" />
    <add key="Bpm.IndicatorImageCacheTime" value="10" />
    <add key="Bpm.DataSourceQueryTimeout" value="300" />
    <add key="ExportToExcelEnabledControls" value="PivotChart,SqlReport,TrendAnalysisChart,Scorecard,OLAPGrid,OLAPChart" />
    <add key="ExportToPowerPointEnabledControls" value="PivotChart,TrendAnalysisChart,Scorecard,OLAPGrid,OLAPChart" />


i.         Entries under  <configuration> node

<Bpm>
    <CustomReportViews>
      <add key="OLAPChart" value="Microsoft.PerformancePoint.Analytics.WebControls.OlapChartCtrl, Microsoft.PerformancePoint.Scorecards.WebControls, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="OLAPGrid" value="Microsoft.PerformancePoint.Analytics.WebControls.OlapGridWebControl, Microsoft.PerformancePoint.Scorecards.WebControls, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="OlapMetadata" value="Microsoft.PerformancePoint.Analytics.WebControls.OlapCubeMetadata, Microsoft.PerformancePoint.Scorecards.WebControls, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="PivotChart" value="Microsoft.PerformancePoint.Scorecards.WebControls.ReportViewControl, Microsoft.PerformancePoint.Scorecards.WebControls, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="PivotTable" value="Microsoft.PerformancePoint.Scorecards.WebControls.ReportViewControl, Microsoft.PerformancePoint.Scorecards.WebControls, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="Spreadsheet" value="Microsoft.PerformancePoint.Scorecards.WebControls.ReportViewControl, Microsoft.PerformancePoint.Scorecards.WebControls, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="SqlReport" value="Microsoft.PerformancePoint.Scorecards.WebControls.ReportViewControl, Microsoft.PerformancePoint.Scorecards.WebControls, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="StrategyMap" value="Microsoft.PerformancePoint.Scorecards.WebControls.ReportViewControl, Microsoft.PerformancePoint.Scorecards.WebControls, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="TrendAnalysisChart" value="Microsoft.PerformancePoint.Scorecards.WebControls.ReportViewControl, Microsoft.PerformancePoint.Scorecards.WebControls, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="Url" value="Microsoft.PerformancePoint.Scorecards.WebControls.ReportViewControl, Microsoft.PerformancePoint.Scorecards.WebControls, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="PasPage" value="Microsoft.PerformancePoint.Scorecards.WebControls.ReportViewControl, Microsoft.PerformancePoint.Scorecards.WebControls, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="Scorecard" value="Microsoft.PerformancePoint.Scorecards.WebControls.ScorecardCtrl, Microsoft.PerformancePoint.Scorecards.WebControls, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="SingleSelectList" value="Microsoft.PerformancePoint.Scorecards.WebControls.SingleSelectDropDownControl, Microsoft.PerformancePoint.Scorecards.WebControls, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="SingleSelectTree" value="Microsoft.PerformancePoint.Scorecards.WebControls.SingleSelectTreeViewControl, Microsoft.PerformancePoint.Scorecards.WebControls, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="TimeIntelligenceCalendar" value="Microsoft.PerformancePoint.Scorecards.WebControls.TimeIntelligenceCalendarControl, Microsoft.PerformancePoint.Scorecards.WebControls, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="MultiSelectTree" value="Microsoft.PerformancePoint.Scorecards.WebControls.MultiSelectTreeViewControl, Microsoft.PerformancePoint.Scorecards.WebControls, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="ExcelServices" value="Microsoft.PerformancePoint.Scorecards.WebControls.ExcelServicesReportView, Microsoft.PerformancePoint.Scorecards.WebControls, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </CustomReportViews>
    <CustomDataSourceProviders>
      <add key="ADOMD.NET" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.AdomdDataSourceProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.Standard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="ODBC" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.OdbcDataSourceProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.Standard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="ExcelWorkbook" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.ExcelDataSourceProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.Standard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="ExcelServicesWorkbook" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.ExcelServicesDataSourceProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.Standard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="SqlTabularDataSource" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.SqlTabularDataSourceProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.Standard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="SpListDataSource" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.SpListDataSourceProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.Standard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="SAPBW" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.SapBwDataSourceProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.SapBW, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </CustomDataSourceProviders>
    <FCODaoProviders>
      <add key="TempReportViewDao" value="Microsoft.PerformancePoint.Scorecards.Server.Dao.TempReportViewDao, Microsoft.PerformancePoint.Scorecards.Server, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="DashBoardDao" value="Microsoft.PerformancePoint.Scorecards.Server.Dao.DashBoardDao, Microsoft.PerformancePoint.Scorecards.Server, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="DataSourceDao" value="Microsoft.PerformancePoint.Scorecards.Server.Dao.DataSourceDao, Microsoft.PerformancePoint.Scorecards.Server, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="IndicatorDao" value="Microsoft.PerformancePoint.Scorecards.Server.Dao.IndicatorDao, Microsoft.PerformancePoint.Scorecards.Server, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="KpiDao" value="Microsoft.PerformancePoint.Scorecards.Server.Dao.KpiDao, Microsoft.PerformancePoint.Scorecards.Server, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="ReportViewDao" value="Microsoft.PerformancePoint.Scorecards.Server.Dao.ReportViewDao, Microsoft.PerformancePoint.Scorecards.Server, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="ScorecardDao" value="Microsoft.PerformancePoint.Scorecards.Server.Dao.ScorecardDao, Microsoft.PerformancePoint.Scorecards.Server, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </FCODaoProviders>
    <CustomParameterDataProviders>
      <add key="MemberParameterDataProvider" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.MemberParameterDataProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.Standard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="NamedSetParameterDataProvider" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.NamedSetParameterDataProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.Standard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="MDXParameterDataProvider" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.MDXParameterDataProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.Standard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="StaticList" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.ParameterStaticListProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.Standard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="ParameterScorecardCellProvider" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.ParameterScorecardCellProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.Standard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="ParameterScorecardColumnMemberProvider" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.ParameterScorecardColumnMemberProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.Standard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="ParameterScorecardKpiProvider" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.ParameterScorecardKpiProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.Standard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="ParameterScorecardRowMemberProvider" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.ParameterScorecardRowMemberProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.Standard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="TimeIntelligenceProvider" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.TimeIntelligenceProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.Standard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="TimeIntelligencePostFormulaProvider" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.TimeIntelligencePostFormulaProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.Standard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="ScorecardProvider" value="Microsoft.PerformancePoint.Scorecards.DataSourceProviders.ParameterScorecardProvider, Microsoft.PerformancePoint.Scorecards.DataSourceProviders.Standard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </CustomParameterDataProviders>
    <CustomViewTransforms>
      <add key="ExpandNamedSets" value="Microsoft.PerformancePoint.Scorecards.GridViewTransforms.ExpandNamedSets, Microsoft.PerformancePoint.Scorecards.Server, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="RowsColumnsFilterTransform" value="Microsoft.PerformancePoint.Scorecards.GridViewTransforms.RowsColumnsFilterTransform, Microsoft.PerformancePoint.Scorecards.Server, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="AnnotationTransform" value="Microsoft.PerformancePoint.Scorecards.GridViewTransforms.AnnotationTransform, Microsoft.PerformancePoint.Scorecards.Server, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="UpdateDisplayText" value="Microsoft.PerformancePoint.Scorecards.GridViewTransforms.UpdateDisplayText, Microsoft.PerformancePoint.Scorecards.Client, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="ComputeRollups" value="Microsoft.PerformancePoint.Scorecards.GridViewTransforms.ComputeRollups, Microsoft.PerformancePoint.Scorecards.Client, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add key="ComputeAggregations" value="Microsoft.PerformancePoint.Scorecards.GridViewTransforms.ComputeAggregations, Microsoft.PerformancePoint.Scorecards.Client, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </CustomViewTransforms>
  </Bpm>


After completing these three steps, the second SharePoint site (http://test:44444/sites/Sales) can be used for deploying dashboards.


Hope it will be helpfulKeep Sharing


-Ashish

Business Intelligence Center Template Missing

If you are missing Business Intelligence Center Template while creating site collection then you can do it as follow.

Go to Site Actions > Site Settings menu from site that you created.

Locate Site collection features under Site Collection Administration section.

Find PerformancePoint Service Site Collection Features and Activate it. If you can't find it than you need to enable enterprise feature.


Same way locate Manage site features under Site Actions section.

Enable PerformancePoint Service Site Features.

Once you follow above steps you can find Business Inteligence Center Template when you want to create site under Enterprise Tab.

Performance Point Service Feature missing from SharePoint 2010

What if you are missing Performance Point Service entry from Site collection and Web Features. I came across similar situation where I need to work on Performance Point Reports and I was not able to find option anywhere. You can find it using below steps.

Basically you won't have this options enabled unless you have enterprise version for SharePoint 2010.

You can check your SharePoint edition from Centeral Administration.



Once you click Enable Enterprise Feature you will come up with choice if for standard and enterprise. Just select Enterprise from radiobutton list and click ok. It will show you below screen to enable this features for all sites.

Just check the option and click ok. You will come up with below screen.


It will start enabling features for Web Applications, Site Collections and Sites.



Once everything is successfully done you can go to your Site and Find PerformancePoint Service Site Collection Features.



Thanks,
Ashish

Sunday, November 14, 2010

SPGridViewWebpart.SPAlertsCounter is not registered as safe

You might get error once you deploy your reports to your SharePoint site indicating "The control type 'SPGridViewWebpart.SPAlertsCounter' is not allowed on this page. The type is not registered as safe."


You can resolve above error by inserting safe control entry inside web.config file.
<SafeControl Assembly="SPGridViewWebpart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4c163b8fd9df8b70" Namespace="SPGridViewWebpart" TypeName="*" Safe="True" />

Regards,
Ashish Chotalia

Friday, November 12, 2010

Import CSV File Into SQL Server Using Bulk Insert

Hi,

I would like to share my knowledge regarding bulk import. I came across situation where multiple data from excel sheet need to export to SQL database. To do it using Bulk Import you can use following snippet.

First create table in SQL server database with same no of columns as defined in CSV file. Once you create the SQL table, convert you excel sheet to CSV file.

bulk INSERT [TableName]
FROM 'C:\' --full path including CSV file.
WITH 
(
ROWS_PER_BATCH = 2,--Max no of rows inserted per batch is 2.
FIELDTERMINATOR = '$' --Used to separate field values
,ROWTERMINATOR = '\n'--Determine end of row
,ERRORFILE = 'b',--Error file generate @ "C:\WINDOWS\system32"
,MAXERRORS = 2 --Max no of error that is allowed at the time of import is 2. More than 2 error will rollback whole transaction.
)
GO

I found few issues while having ',' inside our fields like Mike,”456 2nd St, Apt 5".

My approach towards this kind of situation was to change List Separator for a while and create CSV file.



Hopefully it will be helpfull to others.

Cheers,
Ashish Chotalia

P.S. - Replace "[TableName]" with your database table name.

Thursday, October 14, 2010

Error while deploying report from Performance Point Server to SharePoint

While deploying a report from Performance Point Server to the SharePoint, I faced following error.



I resolved the issue by simply adding safe control entry in my  web.config file.

<SafeControl Assembly="Microsoft.PerformancePoint.Scorecards.WebParts, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="Microsoft.PerformancePoint.Scorecards.WebParts" TypeName="*" Safe="True" />

Hopefully it will resolve your issue as well.

Thanks,
Ashish

Tuesday, September 21, 2010

Set Item selected inside listview.

I had strange issue while setting focus to list view Item. Let me share my exp with you.

I was trying to set focus on specific item of list view once list view is bound with the data. I tried with following code:

lstDetails.Items[i].Selected = true;
lstDetails.Items[i].Focused = true; 

It showed item as selected when I was in debug mode. Once I remove break point nothing was selected.

You need to write following code to item focused.
lstDetails.Items[i].Selected = true;
lstDetails.Items[i].Focused = true;
lstDetails.Items[i].EnsureVisible(); //This will set scroll position inside listview to the focused item.
lstDetails.Focus();     //This will set focus to the parent control that is listview.

Hope it will help you.

Thanks,
Ashish Chotalia

Saturday, September 18, 2010

How to hide listview column.

I would like to share some stuff with you. I come across situation where I need to hide the column for the listview control.

Earlier My approach was to set the column width for the listview with width=0 as shown below.

[ListViewName].Columns.Add("ID", 0);

It worked fine when I run the application, but the problem I found was that still user was able to change the width. To resolve that Issue I tried following thing and It worked like a charm.

Just open the form and Select ListView. Go to events grid and find "ColumnWidthChanged" event.
Create event and put the code as shown below.

private void [ListViewName]_ColumnWidthChanged(object sender, ColumnWidthChangedEventArgs e)
{
        if (e.ColumnIndex == 0)
        {
               this.[ListViewName].Columns[e.ColumnIndex].Width = 0;
         }
}

Cheers,
Ashish Chotalia

P.S. Please replace "[ListViewName]" with your ListView Id.