Stupid attachments in Sharepoint, adding email attachments

You would think taking  attachments from a  Sharepoint list and adding them to a mail message would be easy.  Well, not that easy.  They make you jump through hoops and stream the attachment with the file name.  Would have been nice to just take an attachment off a list and then add it to an email using the same attachment object.  Oh well.  Here's the code I use to take an attachment off a list item, look at the file name, then attach it to an email using System.Mail.  MailMessage mail = new MailMessage();   SmtpClient smtp = new SmtpClient this.workflowProperties.Web.Site.WebApplication.OutboundMailServiceInstance.Server.Address);   mail.Subject = "Subject" mail.To.Add(wfConfig.EmailTo); mail.CC.Add(wfConfig.EmailCC); mail.From = new MailAddress(wfConfig.EmailFrom); mail.Body ="body": mail.IsBodyHtml = true;    //Attachment(s)      if (workflowProperties.Item.Attachments.Count > 0) {       foreach (string fileName in workflowProperties.Item.Attachments)      {       SPFile file = workflowProperties.Item.ParentList.ParentWeb.GetFile(           workflowProperties.Item.Attachments.UrlPrefix + fileName);                if (file.Name.ToUpper().Contains(DocNameToCheck))           {             Attachment attachment = new Attachment(file.OpenBinaryStream(), [...]

By |2011-01-25T21:35:47+00:00January 25th, 2011|Uncategorized|4 Comments

The Sharepoint way for Application Error Alerts

 By creating a list of application errors, you can take advantage of all the Sharepoint goodness like metadata, alerts, etc.  This post shows how to add a complete Error Management system for custom sharepoint errors, with alerts .  It’s really pretty simple, use the existing Sharepoint lists and alerts to help you stay up to date with any application errors. Create a list to hold your application errors.  See below for a screenshot. Title Application URL Message Inner Exception Source Stack Trace   click to expand  2. From your custom code, create a utility method (I usually have this in a utility class) to add items into the Application Error list.  Pass in the Error, the url, the Title, and the url to your web that contains the error list.  I tend to use constants as much as I can. Note that I also write the error into the Event Log, [...]

By |2022-12-11T19:44:49+00:00January 25th, 2011|Sharepoint on Premise|0 Comments

How to get SSRS Report Usage from Sharepoint in Sharepoint Integrated Mode

SQL Reporting Services in Sharepoint Integrated Mode (MOSS 2007) has always been a little quirky to install, but can be very convenient to organize reports, by leveraging all the Sharepoint metadata, permissions, grouping, filtering and other user interface features. Reporting Services defaults to 60 days for the execution log.  To change it, go to Central Administration, Application Management, Reporting Services, Set Server Defaults and change the Report Processing Log. To find out how often reports are being used in your sharepoint installation, you can query the RSSharepoint.Catalog table, join on the Execution Log, and then join against the SP databases to get the metadata for the reports.  Below is a sample query: (replace list ID with your Report Library list ID)  --Gets metadata from SP database Use WSS_Content_XX_DB1 SELECT  A.tp_leafname As RDL, A.ntext2 as Description, A.ntext3 as Business_Group, A.ntext4 as Application INTO #Temp1 FROM AllUserData A INNER JOIN AllLists L ON [...]

By |2022-12-11T19:44:49+00:00January 19th, 2011|Sharepoint on Premise|0 Comments

Microsoft Support Lifecycles

As developers we always look for the latest technology, but after many years, clients tend to keep applications beyond their expected time.  I am lucky? enough to have an application that has been in use for close to 10 years.  The problem with this is that the underlying server software is no longer supported and we have to migrate the application. So, the decision is keep it on an unsupported platform, or move to a newer platform. Here's the site that shows the support dates for MS products: http://support.microsoft.com/lifecycle/search/default.aspx?sort=PN&alpha=windows&Filter=FilterNO Here's a sample of the support lifecycles: Windows Server products are at the top and all the Sharepoint products are at the bottom. Products Released General Availability Date Mainstream Support End Date Extended Support End Date Service Pack Support End Date Windows 2000 Advanced Server 3/31/2000 6/30/2005 7/13/2010   Windows 2000 Datacenter Server 11/13/2000 6/30/2005 7/13/2010   Windows 2000 Professional Edition [...]

By |2022-12-11T19:44:49+00:00January 18th, 2011|Sharepoint on Premise|0 Comments

Welcome

Blue Surf Tech is now Surfpoint Technology, Inc.,  providing consulting services for large enterprises and medium-sized businesses. Located in San Diego, California, Surfpoint Technology offers expertise in Microsoft based technology solutions.

By |2011-01-17T03:09:45+00:00January 17th, 2011|Uncategorized|0 Comments
Go to Top