wrap text in cfgrid - cf9

Hi ,

We have been updated to cf9 from cf8 and we noticed that text in cfgrid column in not wrapped. Its just because of changes made in version 3 of ext. Turns out the fix is pretty simple. Look at the css code below which has to be applied on a page where you require to wrap text in cfgrid.

CF8:

<style>
.x-grid-row-selected td{color:black;}
.x-grid-col{white-space: normal ! important;}
.x-grid-cell-text {white-space: normal !important;}
</style>

CF9:

<style>
.x-grid3-cell-inner {white-space: normal ! important; display:block;}
</style>

 

Share |

Date Different Exclude Week ends.

Hello,

Recently I need to find the date difference between two dates excluding weekends. So I have made sql server scalar function to get date difference excluding weekends. You need to pass only two arguments as start date and end date. Refer below example. I hope it may be helpful.

Declare @startDate date, @endDate date;
Set @startDate = CONVERT(date,'03/11/2010');
Set @endDate = CONVERT(date,'03/25/2010');

select dbo.fun_getDateDiffExcludeWeekEnd(@startDate,@endDate)

Basically datediff function start count from next to @startDate so if you want to get count with @startdate you need add +1 in count.

select dbo.fun_getDateDiffExcludeWeekEnd(@startDate,@endDate) + 1

Otherwise you can write it like below syntax.

select dbo.fun_getDateDiffExcludeWeekEnd(dateadd(d,-1,@startDate),@endDate)

Function for get date different with exclude weekends.

CREATE FUNCTION [dbo].[fun_getDateDiffExcludeWeekEnd] 
(
    @start datetime,
    @end datetime
)
RETURNS numeric
AS
BEGIN
    DECLARE @WeedDay numeric = 0;
    DECLARE @TotalDayCount numeric = 0;
    
    SELECT @WeedDay = datepart(weekday,@end);
    
    IF @WeedDay = 1
        BEGIN
            SELECT @end = DATEADD(d,1,@end);
        END
    IF @WeedDay = 7
        BEGIN
            SELECT @end = DATEADD(d,2,@end);
        END
    SELECT @TotalDayCount = (DateDiff(d, @start, @end) - ( DateDiff(ww, @start, @end) * 2));
    RETURN @TotalDayCount
END

Share |

Finding real IP address in coldfusion

Hello,

I was facing one problem before few days as i was storing ip addresses in my database.
when i looked into database i amazed that there were some entries of ip addresses which were not true.

If anyone is connected to internet through Proxy server then using 'CGI.REMOTE_ADDR' just returns the IP address of proxy server not of the user's machine.

What we need to do is to compare 'CGI.HTTP_X_Forwarded_For' variable against 'CGI.REMOTE_ADDR'.

 

<cfif CGI.HTTP_X_Forwarded_For EQ ""><!--- Checking proxy address --->
       <cfset real_ipaddress = CGI.REMOTE_ADDR>
<cfelse>
       <cfset real_ipaddress = CGI.HTTP_X_Forwarded_For>
</cfif>


 

Share |

Tag Equivalents in CFSCRIPT

Hello guys,

We have recently migrated on CF9 and  i want everybody to know about cfscript enhancements made in CF9. You can now do almost every thing in cfscript tag. We have equivalent syntax for tags in CF9 to be used in CFSCRIPT.

Please have a look at link below.

Tag Equivalents in CFSCRIPT

Share |

Install SSL certificate in coldfusion.

Hello Guys,

Before couple of days, we migrated from coldfusion 8 to coldfusion 9. One of our project was using web services to transmit some updates on another application. It seems something wrong since upgradation.  The error which was repeatedly occured was 'javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated'. It occurs when you use self signed SSL certificate. To get rid of this you have to add the certificate to the list of known certs.

Please perform following steps to do so.

  • Then open a command prompt and go to coldfusion jre/bin directory.



$ cd /opt/jrun/jre/bin


  • You can install a new certificate by following command.



./keytool -import -storepass pleasechange -noprompt -alias newcertificate  -keystore ../lib/security/cacerts -trustcacerts -file newcertificate.cer



  1. alias - You can give any name alias to this.
  2. storepass is the password for the security store.If you haven't changed it it will be set to 'pleasechange'.
  3. file - certificate file which you need to install.

Make sure you have read, write permission to that certificate file.

After sucessfully following above points you still get an error then please restart you coldfusion services. I hope this would help you.

 

 

 

 

 

Share |

Building Your jQuery Plugin

STEP : 1
The first step is to extend the actual jQuery object with the function that we wish to add.
For Example, suppose we need to add the truncation functionality in addtion with the cluetip functionality.

Read more...

Over Clause : Calculating a aggregate of column and entire record set without using group clause

Hi Friends,

Today, I have seen one interesting function of sql server. Most of people know about it who are familiar with sql server but I was not knowing about it and I am very surprised by over() function. Over() function returns aggregate function result without using group by clause. It is built in function of sql server. If you want to create total column with entire data set then use over() function without use any parameter. We can use aggregate function with over().

Read more...

Best web developing technology - coldfusion

Hello All,

Before few days i was surfing on web and found one intersting article written by Ray Camden on adobe's website. We write less code in coldfusion to get maximum result compared to any other language.

What I have found is, CF is a productivity multiplier. It allows single coder to do the work of many people. Coldfusion is easiest , quickest and powerful.

Please check link below.

http://www.adobe.com/devnet/dreamweaver/articles/server_languages.html

Share |
Design by Mark Aplet | Powered by Mango Blog