DCSIMG
Dudi Nissan's Blog

Dudi Nissan's Blog

SharePoint, ASP .Net, SQL

Links

SharePoint 2010 Custom Fields

SQL Reporting Services: Display Static Map Image from Google Maps Inside Report

ניתן להציג תמונה קבועה של מפה מתוך Google Maps בתוך דוח של SQL Reporting Services:



השלבים (דוגמא בלבד):
1. הוספת רכיב מסוג Image לדוח.
2. במאפייני התמונה להגדיר את Images Source כ-External.

3. הגדרת ערך Expression של התמונה:
="http://maps.googleapis.com/maps/api/staticmap?center=הפנינה 2, רעננה, ישראל&zoom=17&size=514x340&sensor=false&language=he"


SharePoint 2013: "Upload files using Windows Explorer instead" is very slow

 נתקלתי באיטיות גבוהה בתהליך העלאת קבצים לספריית מסמכים של SharePoint 2013 בסביבה ללא תקשורת אינטרנט:


הפתרון
אי סימון ההגדרה Automatically detect settings בדפדפן:

לפי הכתוב במאמר משנת 2011 כאן.
Posted: Apr 02 2013, 12:55 AM by dudin | with no comments
תגים:,

SQL Reporting Services: Add Scroll to Report Parameters

ב-SQL Reporting Services בדוח אשר כולל פרמטרים רבים, החלק של הפרמטרים "תופס" חלק גדול מהדף.
ניתן להוסיף סרגל גלילה כדי לשנות מצב זה.
לדוגמא - יש למצוא את ה-id של ה-class אשר "עוטף" את הפרמטרים של הדו"ח (באמצעות IE Developer Tools), ולהוסיף את הגדרת ה-CSS הבאה:

#ctl31_ctl04
{
   height: 80px;
   overflow-y: scroll !important;
}

התוצאה - הצגת דוח עם גלילה לפרמטרים:


מידע כיצד ניתן לבצע שינוים ב-CSS של Reporting Services ניתן למצוא באתר מיקרוסופט כאן

SQL Reporting Services: Change Report Parameters Order

ב-SQL Reporting Services ניתן לשנות את סדר הפרמטרים של Report.

לפני השינוי - פרמטרים של Report:


עריכת קובץ ה-RDL עם עורך XML - שינוי סדר הפרמטרים בחלק של ReportParameters:


התוצאה - סדר הפרמטרים של ה-Report השתנה:

SQL Reporting Services: Display Report Parameters on the Right Side (Right to Left)

ב-SQL Reporting Services, פרמטרים בדוח מוצגים כברירת מחדל בצד שמאל.
עבור אתרים בעברית, ניתן לשנות את הגדרת ברירת המחדל ולהציג את הפרמטרים בצד ימין (מימין לשמאל).
אחת האפשרויות למימוש הינה ע"י שינוי ב-CSS - יש להוסיף ל-class בשם ParametersFrame את ההגדרה
direction: rtl כך:

מידע כיצד לבצע שינויים ב-CSS של Reporting Services ניתן למצוא באתר מיקרוסופט כאן.

התוצאה - הצגת הפרמטרים בצד ימין (מימין לשמאל):

SharePoint 2013: How to Find Lists ServerTemplate Id

בשימוש של SPSiteDataQuery אחד הפרמטרים שניתן להשתמש ב"שליפת נתונים" הינו Server Template Id - לדוגמא <Lists ServerTemplate='101' />
כדי לדעת את ה-ServerTemplate של רשימה מסוימת, ניתן להיכנס להגדרות הרשימה ואז View Source של הדף.
יש לחפש את g_wsaListTemplateId - המספר המופיע ליד המשתנה, הוא ה-Id המבוקש לשאילתא.



הערה: אחד האתרים שניתן לראות את רשימת ה-Server Template לפי סוג ה-List ניתן למצוא כאן
Posted: Mar 11 2013, 04:50 AM by dudin | with no comments
תגים:,

Change Web Reference Url Dynamically Issue

ב-Net. ניתן לשנות את ה-URL של ה-Web Reference בזמן ריצה בקוד באופן דינמי.
במידה וכתובת ה-web reference כולל WSDL, אם מבצעים שינוי בזמן ריצה, אין לכלול את ה-WSDL ב-url עצמו.
לדוגמא:
הוספת web reference לשרת הפיתוח:

הוספת web reference לשרת ה-Production:


הקוד בזמן ריצה:

MyService Service_ = new MyService();
// Do not include wsdl in the url //
Service_.Url = "...asmx"; // Correct without "?wsdl"
Service_.Url = "...asmx?wsdl"; // Incorrect

SharePoint 2013 Setup Error - Can't Install AppFabric (Offline Environment)

בסביבה ללא תקשורת אינטרנט (Offline), נתקלתי בבעיה של התקנת Prerequisite של AppFabric עבור התקנת SharePoint 2013.
הודעת השגיאה:
Microsoft.ApplicationServer.Setup.Core.SetupException:
      AppFabric Server upgrade failed because backing up configuration for V1 failed. Please try again.
      ---> System.Management.ManagementException:
Not found
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementObject.Initialize(Boolean getObject)

הפתרון
בדיקה בשרת העלתה התקנה של AppFabric במחשב בתיקייה c:\windows\system32\AppFabric
הסרה של האפליקציה ולאחר מכן התקנה באמצעות הפקודה PrerequisiteInstaller.exe כפי שכתוב במאמר כאן פתרה את הבעיה.

SharePoint 2013: Custom Web Service

SharePoint 2013  באמצעות Visual Studio 2012, מאפשר ליצור Custom Web Service לפי הצורך.
להלן השלבים:
1. יצירת פרוייקט מסוג SharePoint 2013 - Empty Project


2. הוספת פריט מסוג Windows Service


3.קוד לדוגמא של ה-class


using
System.Web.Services;
using Microsoft.SharePoint;

[WebService(Namespace = http://tempuri.org/)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

public class SP2013Service : System.Web.Services.WebService
{
   public SP2013Service()
   {
   }

   [
WebMethod]
   public string Temp()
   {
      return "SharePoint 2013";
   }
}



4. קוד של ה-asmx (בתיקייה
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\LAYOUTS)
<%@ WebService Language="C#" Class="SP2013Service, SharePoint2013Project, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2a1afa88b127bad2" %>

הערה: לאחר Deploy ב-Visual Studio 2012, את ה-PublicKeyToken ניתן למצוא בתיקייה, לדוגמא:
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\SharePoint2013Project


5. לאחר Deploy נוסף יתקבל את ה-Custom Web Service:



Posted: Feb 12 2013, 04:25 AM by dudin | with no comments
תגים:, ,

SharePoint 2013: We're having a problem opening this location in File Explorer. Add this web site to your Trusted Sites list and try again

נתקלתי ב-SharePoint 2013 בתחנת משתמש עם מערכת הפעלה Windows 2008 בהודעה הבאה:
We're having a problem opening this location in File Explorer. Add this web site to your Trusted Sites list and try again

ההודעה הופיעה בחלון העלאת קבצים בספריית מסמכים ע"י קישור Upload files using Windows Explorer instead




הפתרון
במערכת הפעלה Windows 2008, יש לבצע את הפעולות הבאות:
1. הוספת Feature בשם Desktop Experience:

2. הפעלת Service בשם WebClient:


כעת ניתן לראות את המסמכים בתצוגת סייר Windows:

Posted: Feb 04 2013, 08:06 AM by dudin | with no comments
תגים:,

Windows Store App: How to Loop through XML by Code

דוגמא ל"ריצה" על קובץ XML בפרוייקט Windows Store App:

string XmlUrl = "http://www.../file.xml";
Uri Uri_ = new Uri(XmlUrl);
Windows.Data.Xml.Dom.XmlDocument xmlDocument =
          
await Windows.Data.Xml.Dom.XmlDocument.LoadFromUriAsync(Uri_);
Windows.Data.Xml.Dom.XmlNodeList Items = 
           xmlDocument.SelectNodes(
"NodeName");

string
NodeText = "";
foreach (Windows.Data.Xml.Dom.IXmlNode Item in Items)
{
   NodeText = Item.SelectSingleNode(
"ITEM_NAME").InnerText;
}

הערה:
מבוסס על מאמר באתר מיקרוסופט כאן

SharePoint and Reporting Services: How to Set Proxy Settings in web.config

בארגונים רבים תקשורת האינטרנט מבוססת על שרת Proxy.
לדוגמא כאשר קיימת תקשורת אינטרנט מ-Web Part ב-SharePoint או ב-Reporting Services ל"עולם", נדרש להוסיף את ההגדרה של שרת ה-Proxy בקובץ web.config

ב-SharePoint ההגדרה נעשית בקובץ web.config של האתר, וב-Reporting Service ההגדרה נעשית בתיקייה לדוגמא בתיקייה
C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer
וההגדרה תחת "Configuration"
<system.net>
   <
defaultProxy
>
      <
proxy proxyaddress=http://proxy_server.co.il/
            
bypassonlocal="true"
/>
   </
defaultProxy
>
</
system.net
>

ב-Reporting Services, רכיב Map מצריך חיבור לאינטרנט.
במחשב פיתוח עם תקשורת אינטרנט באמצעות Proxy (ללא ההגדרה לעיל) תוצג הודעת שגיאה:
Unable to connect to the remote server
והדוח יוצג ללא המפה


לאחר הגדרה של ה-Proxy הדוח יוצג תקין כולל המפה:



הערה: דוגמא ליצירת הדוח עם מפה ניתן למצוא כאן

Free ebook: The Essential Guide to Enterprise Search in SharePoint 2013

הורדה חינם של ebook בנושא The Essential Guide to Enterprise Search in SharePoint 2013 כאן
Posted: Dec 02 2012, 10:11 AM by dudin | with 2 comment(s)
תגים:,

Windows 8 Store app: How to Consume Service Reference in Visual Studio 2012

דוגמאות של "קטע" קוד לשימוש ב-Service Refernce - קובץ xaml.cs:

פרוייקט Windows Store app
public MainPage()
{
   this.InitializeComponent();   
   this.Loaded += MainPage_Loaded;
} 

private
async void MainPage_Loaded(object sender, RoutedEventArgs e)
{  
   App1.ServiceReference1.
Service1Client Service1Client_ =
                new App1.ServiceReference1.Service1Client();  

   System.Collections.ObjectModel.
ObservableCollection<string> Results =
                    
await Service1Client_.InboxAsync();
 
   // Logic code //
}


פרוייקט WPF
public MainPage()
{  
   InitializeComponent();
   
   this.Loaded += new RoutedEventHandler(MainPage_Loaded);
} 

void MainPage_Loaded(object sender, RoutedEventArgs e)
{  
    PhoneApp1.ServiceReference1.
Service1Client Service1Client_ = 
           
new PhoneApp1.ServiceReference1.Service1Client();  
    Service1Client_.InboxCompleted += 
           
new EventHandler<ServiceReference1.InboxCompletedEventArgs>
            (Service1Client__InboxCompleted);
   
    Service1Client_.InboxAsync();
} 

void Service1Client__InboxCompleted(object sender,
                  ServiceReference1.
InboxCompletedEventArgs e)
{

   // Logic code //
}

SharePoint 2010: How to Hide 'Title' Field in Custom List by Code

ברשימה מותאמת אישית (Custom List) ב-SharePoint 2010, לעתים קיים צורך לא להציג את שדה "כותרת" (Title) שהוא שדה ברירת המחדל של הרשימה מסוג זה.
ניתן להסתיר את השדה באמצעות קוד לדוגמא (יש לשנות את הגדרות השדה טרם הרצת הקוד: שינוי הערך ל-No בהגדרה Require that this column contains information):

using (Microsoft.SharePoint.SPSite site =
          
new Microsoft.SharePoint.SPSite("SiteUrl"))
{
   site.CatchAccessDeniedException =
true;
   site.AllowUnsafeUpdates =
true;

   using
(Microsoft.SharePoint.SPWeb web = site.OpenWeb())
   {
      web.AllowUnsafeUpdates =
true;

      SPList
list = web.Lists.TryGetList("ListName");
      if (list != null)
      {
         SPField fld = list.Fields["Title"];
         fld.ShowInDisplayForm =
false;
         fld.ShowInNewForm =
false;
         fld.ShowInEditForm =
false;
         fld.Update();
      }

      web.AllowUnsafeUpdates =
false;
   }

   site.AllowUnsafeUpdates =
false;
   site.CatchAccessDeniedException =
false;
}


Posted: Nov 27 2012, 09:56 AM by dudin | with no comments
תגים:, ,
More Posts Next page »