Saturday, July 12, 2008

Turn Off Document Map SSRS

Document Map is always on by default. How can i have it turned off by default.

Enter the following URL in the address bar:


http://localhost/ReportServer?/reportPath/&rc:DocMap=false

Means set the
&rc:DocMap=false
at the end of url manually to hide it.
Its the only solution possible

Using Style sheet SSRS

Using Style sheet SSRS

  • Add the <HTMLViewerStyleSheet> setting to the Reporting Services configuration file.
  • Specify the style sheet on a report URL.


...
MyStyleSheet
...


Be Carefull don't include .css in the end..
put the style sheet in
By default, the Styles folder is located at <drive>:\Program Files\Microsoft SQL Server\MSSQL.n\Reporting Services\ReportServer\Styles.

DateInterval Enumeration not working in SSRS

DateInterval Enumeration not working in SSRs

Try this

DATEADD(DateInterval.Month,-12,cdate(Parameters!StartDate.Value))

or alternative try this


DATEADD("m",-12,Parameters!StartDate.Value)

How to split the column in matrix

To split a column in the matrix do the following:-
1. Drag the rectangle to the matrix text box.
2. Then drag several text box to the rectangle.
3. These text box will split the matrix column

How to set currency as poound in Reporting services SSRS

How to set Currency as pound in SSRs.
1. Select the textbox and view properties.
2. In properties Set the numeral Language to the language to which you r currency belongs

Reporting services not displaying unicode characters

If the reporting services is not displaying the Unicode character in reports then do the following:-
You have to install the language pack on your system
1. Goto Control panel -> Regional
and Language option -> Language tab .
2. Click on Install files for complex scripts and right to left languages.
3. It will prompt a message box, You have to insert the operating system Cd to get it installed.

Wednesday, June 4, 2008

Some date time query

Some date time questions
1. You have Week no stored in your database and you wanna convert the week no to the corresponding month name

Here is sol
declare @weekno int, @year int
select datename(month,(dateadd(d,((@weekno-1)*7) - (datepart(dw,convert(varchar,@year)+'/1/1')-1),convert(varchar,@year)+'/1/1')))




2. You have Let say month as int in you database and you want to convert it to month name

declare @hello int
set @hello = 4
select datename(month,cast('2008' + '/' + CAST(@hello AS VARCHAR(2)) + '/01' AS DATETIME))


3. You Want to calculate the no of days for a particular year of a particular month
Declare @NoOfDays1 int
Declare @ month1 datetime
set @NoOfDay1 = datepart(dd,dateadd(dd,-1,dateadd(mm,1,cast(cast(year(@month1) as varchar)+'-'+cast(month(@month1) as varchar)+'-01' as datetime))))



4. You have date time stored in database as date and you want to change it to int
Declare @startday as datetime
select CONVERT(INT, Convert(varchar(10),convert(datetime,@Startday),112))



Will add more to the list later...

Sunday, February 17, 2008

Installing Reporting server 2005 Installation on home premium VISTA??

hi,

Does Anybody Tried Installing Reporting server 2005 Installation on home premium VISTA??

I tried it.

I used Developer Edition Of sql server 2005. As U cant Install Enterprise version, as it does not support it.

Here is What i found...



1. You need Sql server 2005 Sp2 Installed.

2. To install Reporting server U need IIS.
IIS is not Present/installed by default.
U can enable IIS by going to Control Panel\Programs and Features , Click Turn windows On / off.
Then check the box of IIS.

But this doesn't Solve the problem...

Coz for Sql server 2005 to be installed U need Windows Authentication check box.

And This Windows Authentication Box Is not Available in scaled Down version of IIS 7.0... The IIS version which is shipped with the Home Premium is scaled down version of IIS 7.0

So The Conclusion is U cant Install Sql server 2005 reporting services on Vista Home Premium...


Hope I am correct...
If not Correct me... wink.gif

Thursday, September 13, 2007

Cookies

Cookies:-

Cookies
provide a useful means in Web applications to store user-specific information. For example, when a user visits your site, you can use cookies to store user preferences or other information. When the user visits your Web site another time, the application can retrieve the information it stored earlier.

A cookie is a small bit of text that accompanies requests and pages as they go between the Web server and browser. The cookie contains information the Web application can read whenever the user visits the site. Imagine that when users request a page from your site, www.contoso.com, your application sends not just a page, but a cookie containing the date and time. When the user's browser gets the page, the browser also gets the cookie, which it stores in a folder on the user's hard disk. Later, the user requests a page from your site again. When the user enters the URL www.contoso.com, the browser looks on the local hard disk for a cookie associated with the URL. If the cookie exists, the browser sends the cookie to your site along with the page request. Your application can then determine the date and time that the user last visited the site. You might use the information to display a message to the user, check an expiration date, or perform any other useful function.

Cookies are associated with a Web site, not with a specific page, so the browser and server will exchange the www.contoso.com cookie information no matter what page the user requests from your site. As the user visits different sites, each site might send a cookie to the user's browser as well; the browser stores all the cookies separately.


Limitations
§ Most browsers support cookies of up to 4096 bytes. That is plenty of space for storing a few values on the user's computers, but you would not want to try to store a dataset or some other potentially large piece of data in a cookie. More practically, you probably do not want to store a big collection of user information in a cookie.

§ Browsers also impose limitations on how many cookies your site can store on the user's computer. Most browsers allow only 20 cookies per site; if you try to store more, the oldest cookies are discarded.

§ A cookie limitation that you are likelier to run into is that users can set their browser to refuse cookies. You cannot do much to get around this problem except to avoid cookies altogether and use a different mechanism to store user-specific information.

Add more to it u know.





Wishes
Whocares

How to find sql server version installed and service pack installed.

How to find sql server version installed and service pack installed.

Some time there is need to find what service pack your sql server already have.

1. Go to Sql query analyser

SELECT @@VERSION

It will give u the output something like this:-
=>For Sql server 2000

Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05 Copyright © 1988-2003 Microsoft Corporation Enterprise Edition on Windows NT 5.0 (Build 2195: Service Pack 4)


=>For sql server 2005
Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) Oct 14 2005 00:33:37 Copyright © 1988-2005 Microsoft Corporation Enterprise Edition on Windows NT 5.0 (Build 2195: Service Pack 4)

But Something is missing here, the service pack info of sql server is missing.

2. Go to Query analyser
SELECT SERVERPROPERTY('productversion')as ProductVersion, SERVERPROPERTY ('productlevel')as ProductLevel, SERVERPROPERTY ('edition') as ServerEdition

=>Output of query for Sql server 2000 is

ProductVersion : ProductLevel : ServerEdition
8.00.760 : SP3 : Enterprise Edition

=>Output of query for Sql server 2005 is

ProductVersion : ProductLevel : ServerEdition
9.00.1399.06 : RTM : Enterprise Edition

How to get only Column name returned as result., Info

Sometimes in programming we just need to return the column name for a given table.

To solve this

1. Write a simple query:-

select name from syscolumns where id = object_id ('Typeurtablenamehere')


to see more attributes write
select * from syscolumns where id = object_id ('Typeurtablenamehere')

2. Also other method:-

select * from tablename where 1=0

It will give only the column name as output..


3. Also One more:-

select Column_NAME from information_schema.columns where table_name = 'Typeurtablenamehere'


Add more to this if some other methods is there also.

Enjoy....
..
.

Wednesday, May 23, 2007

Some Date time Facts in sql server

How to convert Datetime to only time
select CONVERT(VARCHAR(10), GETDATE(),101)

It will convert the date into varchar in mm/dd/yyyy format.

select CONVERT(VARCHAR(10), GETDATE(),103)
It will convert date in to varchar in dd/mm/yyyy format.

How to convert Datetime in format date and time 00.00.00

select convert(datetime, convert(varchar, getdate(), 101))

How to find Date difference
Use DATEDIFF(d, startdate, endddate) to return the number of day
DATEDIFF(yy, startdate, endddate) to return the number of year
DATEDIFF(m, startdate, endddate) to return the number of months


Convert datetime to String, suppose if u want to compare
select CONVERT(VARCHAR(10), GETDATE(),112)

convert datetime to string in format yyyymmdd,
09/05/2006 = 20060905
02/06/2007 = 20070206

Sleepy sleepy..............

Time to sleep....
Enjoy.....

Any other query regarding this, reply to the post.

Thursday, May 17, 2007

How to add the assembly from GAC

1. Go to Visual studio command Prompt
2. type gacutil /l Myassembly
3. Note down the version and Public key token
4. for example version 1.0.0.0 and public key token= 4596487adasfaf
5. now click on the project where u want to add the reference.


In browse give path C:\WINDOWS\assembly\GAC_MSIL\Myassembly\version__Publickey token\myassembly.dll


Replace the version and publickeytoken with ur assembly version.
For example:-

C:\WINDOWS\assembly\GAC_MSIL\Myassembly\1.0.0.0__4596487adasfaf\myassembly.dll


Another doin same

Go TO
1. HKLM/Software/microsoft/fusion
2. Right click in right pane and click new , create new dword value' DisableCacheViewer'(without quotes) and set it value to one.
3. Now go to c: WINDIR/Assembly Folder, search for ur DLL and add reference to it through the Visual studio add reference browse option.


Only one of the methods of how to do it......



It will add the required reference.

Tuesday, May 8, 2007

Performance difference between Count(*) vs Count(1)

Both will give the same performance.

Lets consider the scenerio,

Case 1:- Sql server stores internally everything in pages of size 8kb.
So if we using count (1) or the count (*), actually we r dealing with these 8kb(8060 bytes to be precise)
So it doesnot matter if we use count(1) or Count(*), we r dealing with 8kb interal storage of pages.

Case2:-

Suppose we have a index in the table for which we r retreiving count(*) and count(1)

Sub case(A):- Suppose index is on the column which i am using in count.
In this case count(*) and count(1) will both use the same index and perform same.

Sub case(B): Suppose index is not on the column which we r using count(1)
In this case COunt (*) will use the default index but count(1) will not use it.
So count(1) will be slower if index is not on one.



If u like this post reply.

Wishes
whocares

Design Mode disabled in Asp.Net

Sometime in Asp.net The Design mode is disabled. So the solution is not to reinstall the .Net or all that stuff , but to Go to Visual studio Command prompt window and write the below command and Press enter.
devenv /resetskippkgs

Enjoy.......

Monday, May 7, 2007

How to find The occurence of a particular Column in a database

How to find The occurence of a particular Column in a database

SELET O.Name
FROM sysobjects AS O
JOIN syscolumns AS C
on C.id = O.ID
WHERE C.Name = 'columnName'

sysobjects :To find the tables
syscolumns:-To locate a specific column