Search


Tuesday, December 16, 2008

Calculating a Duration in Infopath C# code

//Calculating a Duration

//In some scenarios, it might be a requirement to calculate

//the total number of days in a given period.

//For example, in an expense report solution,

//you might need to identify the duration of the reporting period based

//on a start date and end date. In the GetDuration function,

//two date string values are passed as arguments to retrieve a duration string value.

private string GetDuration(string startDate, string endDate)

{

string retValue = string.Empty;

if (startDate != string.Empty && endDate != string.Empty)

{

long longStartDate = DateTime.Parse(startDate).ToFileTimeUtc();

long longEndDate = DateTime.Parse(endDate).ToFileTimeUtc();

long longDayCount = (longEndDate - longStartDate) / 864000000000 + 1;

retValue = longDayCount.ToString();

}

return retValue;

}

Calculating a Duration in InfoPath

   1: //Calculating a Duration 
   2: //In some scenarios, it might be a requirement to calculate 
   3: //the total number of days in a given period. 
   4: //For example, in an expense report solution, 
   5: //you might need to identify the duration of the reporting period based 
   6: //on a start date and end date. In the GetDuration function, 
   7: //two date string values are passed as arguments to retrieve a duration string value. 
   8: private string GetDuration(string startDate, string endDate) 
   9: { 
  10:     string retValue = string.Empty; 
  11:     if (startDate != string.Empty && endDate != string.Empty) 
  12:     { 
  13:         long longStartDate = DateTime.Parse(startDate).ToFileTimeUtc(); 
  14:         long longEndDate = DateTime.Parse(endDate).ToFileTimeUtc(); 
  15:         long longDayCount = (longEndDate - longStartDate) / 864000000000 + 1; 
  16:         retValue = longDayCount.ToString(); 
  17:     } 
  18:     return retValue; 
  19: }

How to Deploy an InfoPath 2007 Form Containing Managed Code to a Browser-Enabled WSS v3 Library

InfoPath Forms Services is NOT part of WSS v3. It is a separate install, or you can install it as part of the MOSS 2007 Beta 2 install. The RTM version, last I heard, will be available as a separate SKU or as part of MOSS 2007 Enterprise Edition. Assuming you have already created an InfoPath form containing managed code, this document will explain the steps necessary to deploy it to a WSS form library that is “web-enabled” by InfoPath Forms Services. Publish the Template to the File System (or file share) Note: In Office 2007 you can’t publish an InfoPath form containing managed code directly to a WSS form library because it has to be first approved by a WSS Administrator. 1. Open the Design Tasks task pane and choose Publish Form Template. 2. Choose the first option, to publish to SharePoint, and click Next. 3. Enter the location of the SharePoint site you want to publish to. 4. You will be presented with the screen below. Make sure the checkbox is checked to enable the form to be filled out in a browser and click Next. 5. You must choose a location to save the template file, which will be uploaded to the SharePoint site by the site administrator. 6. Specify any columns you want to be made available as WSS columns in the form library. 7. Verify that the information is correct and click Publish. The form will be published to the specified file share location. Upload the Template to the Central Administration Form Templates Library 1. Go to the Central Administration site for your farm (or web server if there's only one) 2. Click on the Application Management tab, go down to the InfoPath Forms Services section, and choose Manage Form Templates. 3. The Form Template library is opened, which is where admin-approved form templates for the farm are stored. 4. Click Upload Form Template. Choose your saved template file and click the Verify button. You will be shown any errors or warnings related to your template file. Read any warnings (hopefully there are no errors) and click OK. 5. Choose your template file again (Why is it not persisted in the text box between postbacks??). In the Upgrade section, you can choose to upgrade the form template if it already exists. You can also choose how to handle current sessions that are using the form template. 6. Click the Upload button to upload the form template. It is now available as a Feature to be activated on any site collections in the farm. Activate the Form Template on a Site Collection 1. You can activate a form template feature from the Manage Form Templates page of Central Administration (the same page where you uploaded the template). On the context menu of the newly uploaded form template, choose Activate to a Site Collection. 2. In the Activation Location section of the page, choose the appropriate Site Collection and click the OK button. Note: You may actually have to change Web Applications to find the site collection you are looking for. A Web Application maps to an IIS virtual server. Associate the Form Template with a Form Library 1. Create a new form library (or use an existing one, it really doesn't matter),go to the settings page. and choose Advanced Settings. 2. Choose Yes for Allow management of content types. For Opening browser-enabled documents, choose Display as a web page. 3. Click the OK button to go back to the Form Library Settings page. 4. There should now be a Content Types section which displays the Content Types enabled for the form library. The form template feature that you activated added a new content type to the Site Content Type Gallery. 5. Choose Add from existing site content types and find your form template. Click on it and click Add, then click OK. 6. Go back to your form library, click the New dropdown, and choose your form template. It will be opened in the browser window where it can be filled out and saved or submitted.

http://geekswithblogs.net/jgmeyer/archive/2006/06/26/83087.aspx

Friday, December 12, 2008

SharePoint References

SharePoint Plan for performance and capacity (Office SharePoint Server) http://technet.microsoft.com/en-us/library/cc262971(TechNet.10).aspx Plan for performance and capacity (Windows SharePoint Services)http://technet.microsoft.com/en-us/library/cc288124(TechNet.10).aspx White paper: Intel Performance Testing of Windows SharePoint Services (WP)http://technet.microsoft.com/en-us/library/cc288383(TechNet.10).aspx How to Optimize a SharePoint Server 2007 Web Content Management Site for Performance http://msdn.microsoft.com/en-us/library/bb727371.aspx White paper: Planning and Monitoring SQL Server Storage for Windows SharePoint Services: Performance Recommendations and Best Practices http://technet.microsoft.com/en-us/library/cc287996(TechNet.10).aspx

InfoPath Reference

InfoPath Improving the Performance of InfoPath 2007 Forms

http://msdn2.microsoft.com/en-us/library/bb380251.aspx

A whitepaper about performance and the InfoPath rich client. Because of differences between the client and browser-enabled forms, not everything applies to Forms Services and browser forms, but a must read nonetheless. InfoPath Forms Services best practices

http://technet.microsoft.com/en-us/library/cc261832(TechNet.10).aspx

Microsoft Office Forms Server TechNet TechCenter

http://technet.microsoft.com/en-us/office/bb267350.aspx

InfoPath Forms Services roadmap

http://technet.microsoft.com/en-us/library/cc262885.aspx

InfoPath 2007 features that are unavailable in InfoPath Forms Services http://office.microsoft.com/en-us/infopath/HA102105871033.aspx Forms Server 2007 Home Page

http://office.microsoft.com/en-us/formsserver/FX100490391033.aspx

InfoPath 2007 Home Page

http://office.microsoft.com/en-us/infopath/FX100487661033.aspx Planning and architecture for Office Forms Server 2007

http://technet.microsoft.com/en-us/library/cc303371(TechNet.10).aspx

Plan InfoPath Forms Services

http://technet.microsoft.com/en-us/library/cc262498(TechNet.10).aspx

Office Developer Center: InfoPath 2007 Resource Center

http://msdn.microsoft.com/en-us/office/aa905443.aspx

InfoPath Forms Services Architecture

http://msdn2.microsoft.com/en-us/library/ms772323.aspx

Form Development and Deployment Lifecycle

http://msdn.microsoft.com/en-us/library/ms772031.aspx

Creating InfoPath Form Templates That Work With Forms Services

http://msdn2.microsoft.com/en-gb/library/aa945450(VS.80).aspx

Support: Microsoft Help and Support: Forms Server 2007 Solution Center

http://support.microsoft.com/ph/11846

Auto-Increment / Counting field for InfoPath repeating tables/sections

DOWNLOAD THE SAMPLE instruction: http://blogs.microsoft.co.il/blogs/yanivl/

december 12 2008

http://msdn.microsoft.com/en-us/library/ms439657.aspxsite definitions, templates, and features used in Windows SharePoint Services, describing how they are related and how they can best be used to customize sites. Features provide the following capabilities: Scoping semantics for determining where custom code runs Pluggable behavior for installing or uninstalling Features within a deployment Pluggable behavior for activating or deactivating Features at a given scope A scoped property bag for storing data required by a Feature within its scope The basis of a unified framework for distributed deployment of Windows SharePoint Services solutions Rules ===== i should be like event handler