Friday, January 29, 2010

Hide "Cannot be blank" in InfoPath Services

In InfoPath form services, fields that have validation will display "Cannot be blank" message when hovered over the field. This can be annoying (very annoying:@). To disable this read this or change C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\INC\Core.js

change line from
objVisualizationDiv.style.display = "inline";
to
objVisualizationDiv.style.display = (strHelperName == "ErrorTip") ? "none" : "inline";


or comment out
border: 1px solid #B22828; background:. . .
with in .errorDiv section of ifsmain.css file in same foler

ref: read this

Thanks,

Thursday, October 15, 2009

InfoPath to Word Wizard

I downloaded and installed "InfoPath SDK" but when I tried to run %Program Files%\Microsoft Office 2003 Developer Resources\Microsoft Office InfoPath 2003 SDK\Tools\WordPrint.hta, I got the error
The InfoPath to Word Wizard requires the file WordPrint.dll, which is missing or is not properly registered

I got answers from http://www.infopathdev.com/forums/t/7609.aspx and http://www.infopathdev.com/forums/p/3434/13713.aspx#13713

which basically said that the dll is not registered by SDK installer so
1. Browse to WordPrint directory
2. Copy WordPrint.dll to c:\windows\system32
3. in command prompt type "regsvr32 WordPrint.dll"

thanks to infopathdev

Wednesday, September 2, 2009

Getting Announcement from SharePoint 3 using web service

I am writing because I had to digg, may be other won't have to spent more time like me.

My need:
I needed a page separate from sharepoint to list announcement.

My problem:
I am new to sharepoint and never did program with sharepoint.

What I did:
Of course, I googled! and here are the references first:
1. Get list items from sharepoint
2. Display xml data
3. Get attachment url

I first added a web reference:
1. Right click on Project name is 'Solution Explorer'
2. Choose "Add Web Reference...", 'Add Web Reference' window will open.
3. In 'URL:' box type the sharepoint address similar to http://testBox/dev/_vti_bin/Lists.asmx
4. It will give you error on right panel under 'Web services found at this URL:' saying "The document at the url http://testBox/dev/_vti_bin/Lists.asmx was not recognized as a known document type. ..." and 'Add Reference' button disabled.
5. Add ?WSDL or click on "Service Description" in the left panel to avoid error described in 4.
6. After no. 5 you will be able to see web service(s) in the given url and add the web reference.

Now move on to the second part. Once the web reference is added, there will be 'Web References' in solution explorer.
- Now follow the steps in reference 1, it will pull all the information in the list; I used "Announcements" for my purpose.



protected void Page_Load(object sender, EventArgs e)
{
string webPart = "http://testBox/dev";
XmlNode xmlData = GetItems(webPart);
- To display what you got, follow codes in reference 2. I first printed on scree with Response.Write. At this point you can see xml data returned by web service


protected void Page_Load(object sender, EventArgs e)
{
string webPart = "http://testBox/dev";
XmlNode xmlData = GetItems(webPart);

ChildDisplay(xmlData, 0);
}

- In ChildDisplay function you can filter your required data or do whatever your need be with the obtained data.
- As for the reference 3, I took

listQueryOptions.InnerXml = "<IncludeAttachment>TRUE</IncludeAttachment>";
to get url for the attachment.
- I will need to download and store the attachment in to a folder.


Monday, August 24, 2009

Sending email using CDO

Set myMail = CreateObject("CDO.Message")
myMail.Subject = "Sending email with CDO"
myMail.From = "fromAddress@domain.com"
myMail.To = "toAddress@domain.com"
myMail.TextBody = "This is a message."

myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server

myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.domain.com"

'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25

myMail.Configuration.Fields.Update

myMail.Send

set myMail=nothing

Monday, July 20, 2009

ViewState and ListBox

ViewState is to retain value when a page is post back from server.
To preserve value and not to re-populate ListBox or DropDownList in asp.net use following
if (!IsPostBack) //fill the lists
{
  //for network dropdown
  query = "select network from network";
  reader = da.readData(query);

  while (reader.Read())
  {
    Network.Items.Add(reader["network"].ToString());
  }
}
TextBox "readonly" and viewstate
(ref http://aspadvice.com/blogs/joteke/archive/2006/04/12/16409.aspx)
To retain data in a TextBox (datetime picker) in PostBack action use server side code
TextBox1.Attribute.Add ("readonly", "readonly");

rather than the client side


I had trouble figuring out this but this may help some other.

Tuesday, June 2, 2009

Liberum Help Desk ERD




Here is the ERD of Liberum Help Desk. Not the best one but will give you a general idea on how database is maintained. As you can see, naming and links are confusing. The lines should be viewed as links rather than relations. All relations are maintained in code than in database.

If you want a copy let me know and I can email you one.

Thanks,

Thursday, May 7, 2009

Relay email from postfix to exchange

Background:

I am new to this linux world!


Need:

Set up system in Ubuntu linux that would generate a email message. The box is ip'ed 192.168.10.10 and the exchange mail server is ip'ed 192.168.10.2. Hope you got the scenario.


What I did:

$sudo apt-get install postfix mailx

installed postfix and mailx, again I don't know much about them but postfix is a MTA and mailx, I used to check operation of postfix.


While installing postfix I gave in the information what I had but it did not work.