Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / May 2007

Tip: Looking for answers? Try searching our database.

calculating date difference in Infopath 2007 excluding weekends ,h

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rao - 10 May 2007 12:38 GMT
i am new guy in Sharepoint. i want to  calculate the date difference bn two
dates. and also excluding sat nd sundays, and public holidays.
  plz help its very urgent.
 regards
rao
S.Y.M. Wong-A-Ton - 12 May 2007 04:15 GMT
You'll have to write code to get this done. Look into using a TimeSpan
object. A Google search on "Date difference C#" and "TimeSpan C#" should
produce plenty of hits to get you started. Since public holidays differ per
country and per year, you'll have to somehow save those dates in a file or
database, retrieve them, and exclude them from your date difference
calculation.
---
S.Y.M. Wong-A-Ton

> i am new guy in Sharepoint. i want to  calculate the date difference bn two
> dates. and also excluding sat nd sundays, and public holidays.
>    plz help its very urgent.
>   regards
>  rao
Rao - 12 May 2007 09:22 GMT
Thank u for u r reply. i ll tryyyyy
rao

> You'll have to write code to get this done. Look into using a TimeSpan
> object. A Google search on "Date difference C#" and "TimeSpan C#" should
[quoted text clipped - 10 lines]
> >   regards
> >  rao
Rao - 12 May 2007 09:30 GMT
but my doubt is how integrate this .net code to infopath form.when i am
writingb the code in c# , can i open the infopath form in browser.
plz dont mind tell me cleary. in my project  iam using  event handlers to
store the data in database where the data is available in sharepoint list.
and  also i am using sharewebsite  iam opening in .net to retrive the data
from database to infopath form using Xpathnavigator concepts.
  plz help .its very urgent

> You'll have to write code to get this done. Look into using a TimeSpan
> object. A Google search on "Date difference C#" and "TimeSpan C#" should
[quoted text clipped - 10 lines]
> >   regards
> >  rao
S.Y.M. Wong-A-Ton - 14 May 2007 07:03 GMT
If you're using a browser form, it is best to put the list of dates for
public holidays in a SharePoint list and then access that list as a secondary
data source from code in the InfoPath form. Reading from a file or a database
tends to raise security issues. You will need to admin deploy your form to
SharePoint if you use code.

Hope this helps. It is very difficult for me to understand what you really
mean, so if you still have questions, try posting them again.
---
S.Y.M. Wong-A-Ton

> but my doubt is how integrate this .net code to infopath form.when i am
> writingb the code in c# , can i open the infopath form in browser.
[quoted text clipped - 18 lines]
> > >   regards
> > >  rao
Rao - 14 May 2007 08:31 GMT
thanx  for ur reply
ok. let me clearly explain u.
now i wrote code in websrvices. it is working in websrvice. then  i am
using dataconnection in infopath form. i am able to retrive the noof days
calculation result. but when i am in open in priview mode i am  getting these
errors: 1.infopath contacted a datasorce but failed to retrive the data.the
form will load without requested data. 2. some errors were not applied.
here i  cheked the automatically retrive the datab  when form opend.
if i unchek this optin during establishing connection ,i am getting no
errors nd also no result,
after this i  published this form in my site through document library.
, then i want see my infopath form in browser . how do , which link i hv
use???//
tell me clearly.
plz help
client is waiting for my result
plzzzzzzzz
regards
ravinder rao

> If you're using a browser form, it is best to put the list of dates for
> public holidays in a SharePoint list and then access that list as a secondary
[quoted text clipped - 29 lines]
> > > >   regards
> > > >  rao
Rao - 15 May 2007 14:25 GMT
hi
i solved the problem of leaves calculation through webservice. but  
excluding holidays  is not solved .   u said na, put the holidays list in
custom list nd then compare. plz tell me how to do.
and more problem is when user enter the leave btween certain dates . dont
allow once again to apply leave btween those days.and i want display to the
user "u  already applied the leave on this date" tell me the procedure. how
to do.
plz help me. its urgent

> If you're using a browser form, it is best to put the list of dates for
> public holidays in a SharePoint list and then access that list as a secondary
[quoted text clipped - 29 lines]
> > > >   regards
> > > >  rao
S.Y.M. Wong-A-Ton - 17 May 2007 07:00 GMT
If you created a web service, you can let the web service retrieve a list
from somewhere (it does not have to be a SharePoint list, but could be a file
or database table) and then filter out the holidays for you. Since I do not
know how you built the web service, I cannot make any suggestions for this.
My suggestion for using a SharePoint list was in case you used code within
the form itself.

I do not understand your second question.
---
S.Y.M. Wong-A-Ton

> hi
> i solved the problem of leaves calculation through webservice. but  
[quoted text clipped - 39 lines]
> > > > >   regards
> > > > >  rao
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.