نصائح للـ CSS

أصبحت الـ CSS  شيء لا يستقنى عنه بالنسبى لبرمجي المواقع 

ولا يخفى على أحد أهميتها و فوائدها الجمة
المشكلة أنه خلال تصميم الموقع يقوم المبرمج أو المصمم بكتابة السي اس اس و يكبر الملف مع كل يوم و مع تعديلات هنا و هناك و الأقسام المحتلفة التي تتعلق بصفحة معينة أو تعديلات حتى نجعل الصفحة تظهر مناسبة للانترنت اكسبلولر (دوما هو المشكلة الفايرفوكس و غيره ما عندهم مشاكل)  يصبح الملف كبيرا و فيه الكثير من الشوشرة بحيث يصعب الرجوع إليه او تعديله في المستقبل 
فهذه النصائح (بعضها من بالي و بعضها ما نصحني به الزملاء و أنا أولى بأن اتبعها قبل ان اطلب منكم اتباعها ولكن اضعها هنا لكي نتبعها معا ) :
  1.  النظام ثم النظام ثم النظام :
    من أفضل طرق للمحافظة على ملف السي اس اس هو تنظيمه منذ البداية ، اصنع طريقتك بنفسك مثلا  ضع كل ما يهم في ترتيب الأقسام الرئيسية للموقع في بداية السي اس اس ثم ضع جميع تنسيقات القائمة الجانبية مع بعضها البعض ، و تنسيقات الأزرار في مكان واحد و تنسيقات القسم الرئيسي من الصفحة ايضا في مكان واحد. أو مثلا كترتيب آخر رتب التنسيقات حسب عمومها فمثلا ضع التنسيقات التي تؤثر على كل الصفحة في بدايات الملف و انت تنزل في الملف تبدأ بوضع التنسيقات التي تؤثر في امور اقل في الصفحة
  2. التعريف :
    في مقدمة ملف السي اس اس ضع comment به تعريف بسيط عن نفسك و متى تم انشاء الملف و متى كان آخر تحديث له (سيساعدك و الآخرين كثيرا ) كذلك ضع فيه جدول بالألوان المستخدمة مثلا 
    /*
    author : Ali Lawati
    created : 25/4/2009
    updated: 1/5/2009

    Color used
    CCCCCC : gray
    13437A : blue
    */
    كما ترى سيساعدك جدول الألوان كثيرا حينما تغير شيئا ما في التنسيقات

  3. إعادة استسخدام :
    هناك الكثير من أجزاء ملف السي اس اس التي نقوم بإعادة كتابتها في الكثير من المواقع التي تصممها ، فمثلا لو كانت الصفحة لابد ان تحتوي على قسم رئيسي و قائمة جانبية و قائمة علوية (و يا ما اكثر المواقع العربية التي تطلب هذا الشي)  لهذا فتنسيقات السي اس اس المستعملة لتوزيع الـ div  لكل قسم و قائمة  ستستعمل في كل موقع يحتاج هذه التنسيقات فبدلا من اعادة كتابتها لكل موقع يطلب نفس التنسيق عليك بالإحتفاظ بهذه التنسيقات في ملف خاص و ما عليك سوى إعادة إستخدامه (نسخ و لصق) وقت الحاجة
     
  4. استخدام – عوضا عن _ :
    عند تسمية اجزاء من الصفحة كـ ID  أو CLASS   حاول دوما  عدم استخدام الأندر سكور ” _” لأن المتصفحات القديمة تعاني من مشكلة عن رؤيتها لهذا الشي و ان كا ن لا بد فاستخدم الداش بدلا عنها ” – “ 
  5.  صمم للـ Gecko (الفايرفوكس ) أولا :
    لا بد ان جميع مبرمجي المواقع لاحظوا أن الفايرفوكس أو اكثر متصفح دعما لل standards  و بهذا فاذا صممت موقعك بالتنسيقات السي اس اس التي تتماشى مع الفايرفوكس فغالبا لن تحتاج إلا إلى تعديلات بسيطة لكي تجعل الموقع يظهر بنفس المظهر في الانترنت اكسبلولر و السفاري و الكروم

  6. تأكد انك ما شي مع الستاندردس :
    دوما يفضل ان تكون مع الاستاندردس و يمكنك التأكد من أن تنسيقاتك كذلك من هذا الموقع W3C’s free CSS validator  
    تكمن أهمية هذا لأنه بما انك مع الاستاندردس فلن يضيع جهدك في الإصدارات القادمة من المتصفحات (فلنقل انك لم تهتم بالإستاندردس ) و صنعت تنسيقات لموقعك و هي تعمل بطريقة ممتازة على جميع المتصفحات ولكن بما انها ليست standards  فلا شيء يضمن لك أن الإصدار القادم من الفايرفوكس او الانترنت اكسبلولر سيقى يعرض تنسيقاتك بنفس الطريقة
طبعا  يمكننا الإستمرار بوضع نصائح اكثر و اكثر لكن افضل القتصار على هذه لأن اتباعها سيكون له أثر كبير على جودة المواقع التي نصنعها

Read More

SharePoint List data with SQL Server Reporting Services


SharePoint is becoming more populler every day, companies from around the world are starting using it as main intranet site of their headoffice.

since sharepoint provide (as promissed by microsoft) the highest compatibility with Microsoft Office , exchange server, active directory and combine them all into a intranet portal.
many companies started using this software either publishing site ( where anouncements & news could be easily shared with employees) , or team sites ( to manage work of small teams and assigning tasks to them) , or document center, or other many things.
Having huge amount of requirments of bespoke (custom) softwares that fullfill working enviroments needs developer having access to shareponit started using the lists & content types capabilities to create small & medium custom applications based on sharepoint lists
(well if that is good or bad is another issue but i think these two links clearify them link1 , link2 ).
Any how having these applications raise the need for reporting tool to genirated reports depending on the data entered in sharepoint lists/conent types, and for my suprise Microsoft’s best reporting tool SSRS (SQL Server Reporting Services) don’t have a nice way to provide this functionality. This thing made me search for ways of doing this and here are my findings:
eventhough SSRS do not connect in a straigh forward way to SQL server we can have workarounds :

1- Connecting to SharePoint web service out put XML, the problem here is it sometimes work and sometimes don’t, and also i couldn’t do inner join between different lists may be it is there but it will be trouble to do it.

2- Creating a link table in MS Access 2007 that links to sharepoint lists (amazingly this is very easy ), and then connect to the MS ACCESS link tables from SSRS 2005 : this will work but i am kind of scared of having ACCESS in the middle i always want to avoid using access (do you suggest this way please write comments)

3- Connecting to the views provided in the sharepoints backend database (there is a view for all lists and another view for all list items) : here column names will be troublsome to create the query the clounm names are like (float1,float2,…,date1,date2,date3,….) , also i am not sure if it is good thing to make SSRS talk directly to sharepoints backend database views

well these are the work arounds i could find for using SSRS as a reporting tool for SharePoint , but if you are willing to invest a bit to make this thing possible there are some plug-ins that provide this functionality such as Enesys RS Data Extension but again not sure how good they are in performance and other stuff.

hope this post will help you if you are dealing with SharePoint , feel free to discuss any thing and leave comments.

update 16/5/2009
4- the fourth way is to map the list directly to a database (Well i didn’t wrote that because two things first it is redundancy, second it is hard to keep updating both the database and sharepoint lists when-ever any change happens to any record, but Mr. Allan seems to have a great solution for that in the comments which is “SLAM
(http://slam.codeplex.com)

SLAM allows you to easily maintain SharePoint data by hooking up against lists (or content types!) and having the data automatically synchronized with SQL server in real time. Best of all, it converts SharePoint look-ups to associations (with any multiplicity, one to one, one to many, many to many) that you can easily built queries against.

Thanks a for letting us know about this tool
update 21/5/2009 :
Well this time i tried the 2nd way on production (it works very well while it is on my machine in visual studio) but if we need to add it to the reporting services server it didn’t work on my enviroment not sure if it works on other enviroments



Read More