Surendra Sharma

Surendra Sharma

Search This Blog

Monday, October 27, 2014

How to inherit templates in Sitecore

During working with templates in Sitecore, there are situations when you want to implement inheritance mechanism. So here is simple way to do it.

Suppose we want to create “Slide” template having header and footer. In programming terms every Slide should get inherit from Header and Footer. So we will create two template like “Header” and “Footer” as below







After header and footer, we will create “Slide” template as below




As every slide contains header and footer, so let’s assign “Header” and “Footer” template.
Select “Slide” template -> Click on Content tab -> Assign “Header” and “Footer” template from “__Base Template” fields as below



You can verify this association from “Inheritance” Tab of “Slide” Template as below



Now whenever you will create content item of “Slide” template, you will get fields with sections of Footer, Header and Slide and as below






Please leave your comments or share this technique if it’s useful for you.

Monday, October 6, 2014

How to convert column values in date in Excel

Recently I come across with interesting situation.

My friend called me and ask for technical help. I thought he wants to ask something in .NET or SQL Server as I am working with these technologies. But my surprise he asked me something interesting question related with Microsoft Excel.

Here is the problem

His COBOL program is generating excel file which contains month, day and year columns. He wants complete date column by applying just the excel formula in generated sheet.

Solution :

I had not any Internet connection at that time so I opened Excel in my Laptop.

Just created with text column for Month, day, Year and Final date in blank Excel file and started to play with available functions in Excel.

Microsoft already paid attention with these kind of situation by providing Date() function.

Syntax:

=DATE(year, month, day)

Just pass cell details in parameters and you will get the desired result as shown below.

Example:

= DATE(E3, C3, D3)




Please leave your comments or share this tip if it’s useful for you.

Monday, September 8, 2014

Form 28 / Form no. 28 / No Objection Certificate (NOC)

Recently I want NOC from RTO for moving my vehicle. For that one need form 28. If it’s a state wise transfer then you need 3 copies of Form 28 for inter-state, we require 4 copies.

RTO in India is the perfect example of mismanagement. RTO Employees are worst and local agents are best. But I tried to get NOC from my own.

First problem I faced to get form 28. RTO office has form 28 copies but all are in Marathi. If you demand for English one then RTO employees show you the route of Xerox shop where shop guys selling it in 4 Rs.

You can even download form 28 from RTO website, but the worst thing is that it’s a 3 page PDF while actual form is only 2 pages which should be printed on both side of paper.

Here is scanned copy of form 28 that I got from Xerox guy.  Download it free and take a print. That’s it. No need to pay 4 Rs. to those greedy people.





Please leave your comments or share this if it’s useful for you.

Friday, September 5, 2014

Asa Kyo

This is my second poem 'Asa Kyo'

Kyo tere bare me mai din bhr sochta hu,
Kyo tere liye mai din-raat aanhe bhrta hu,
Kyo tere liye mai din rat bin pani machli sa tdpta hu,
Kyo tujh pe duniya ka sara pyar lutane ko jee chahta hai,
Kyo hr pl ek teri hi kmi mhsus hoti hai,
Kyo tujhe pa lene ke bavjud tujhe khone ka dr lga rhta hai,
Kyo ye mera dil ek tera hi hona chahta hai,
Kyo subh se sham, sham se subh ek tera hi dil pe phra rhta hai,
Kyo ek tere sath hi jeene ki dil mera dua mangta hai,
Kyo ye mera mn ek tere liye hi bekrara rhta hai,
Mai na janu ye kya hai, ye kyo hai,
Agar pyar yhi hai , to mujhe ye hua hai, tujh se, Anu se,
Or tu hi mera pyar hai, tu hi mera pyar hai.

TUM

I started to write a poem ( Kavita ) for my dear one.
Let me know about my first attempt to write a poem in Hindi. Your suggestions are welcome for motivation.

Registan Ki tpti dhoop me thndi chanv ka ahsas si lgti tum,
Bhtke smndr me kinara lgane vali kshti si lgti tum,
Ucche aasman me timtimate tare si lgti tum,
Badlo se brse pani ki phli fuhar si lgti tum,
Gulista ke ghne drkhto ki hriyali si lgti tum,
Thnd me grmi ka ahsas si lgti tum,
Andhere me ummid ki roshni ka ahsas si lgti tum,
Chmn ke phulo ki tbssum si lgti tum,
Driya ke bhte pani ki kl-kl ki aavaj si lgti tum,
Pahado pe Uncche jhrno ke trnnum si lgti tum,
Mujhe mere hi hone ka ahsas si krati tum,

Mere khud ka 'Anu' ke ho jane ki khvaish puri si krati tum.

My Shayaris - II


1.    Koi h jisko hum yaad karte hai ...
koi hai jisse milne ki rb se fryad krte hai..
jld vo mil jaye to jindgee svr jaye,
uske bina ek ek pl jeena mushkil hai

2.    koi mere mhboob ko mere naam ka chirag la de,
koi mere mhboob ko mere naam ka chirag la de,
ki mai uski yaado ka gulam bn chuka hu

3.    Bandhan rishtoo ka nhi..ahsas ka hota h
Jaha ahsas hota h vhi pyar hota h

4.    tere pyar me mera koi thikana nhi rha hai,
pta koi puchta hai to hm teri gliyan btate hai

5.    Aaine ki jrurt nhi hai mujhe,
Aaine ki jrurt nhi hai mujhe,
hmare liye to hmare dilbr ki aakhen hi kafi hai.


6.    tu mere baichen dil ka sukun hai,
tu mere baichen dil ki aarzoo hai,
tere bina na mera koi mukkml jahan,
jeene ki mere sirf tu hi jrrut hai

Thursday, August 14, 2014

Sybase IQ error Syntax error near 'SET' on line

Many times you may get Sybase IQ error like Syntax error near 'SET'. Suppose if I am trying to execute below statements

SET TEMPORARY OPTION Temp_Extract_Column_Delimiter =',';
SET TEMPORARY OPTION Temp_Extract_Row_Delimiter = '';
SET TEMPORARY OPTION Temp_Extract_Name1='\\\\XYZServer\\Backup\\test.txt';
SELECT column1, column2, column3 FROM tblTest
SET TEMPORARY OPTION Temp_Extract_Name1='';
commit;

Then Sybase IQ display below error

ERROR[42000][Sybase][ODBC Driver][Sybase IQ]Syntax error near 'SET' on line 5

Solution:

It simply means end SELECT query with semicolon “;”.
Every statement in Sybase IQ should be end with semicolon.

SELECT column1, column2, column3 FROM tblTest;
SET TEMPORARY OPTION Temp_Extract_Name1='';


Please leave your comments or share this tip if it’s useful for you.