InfoPath: Hide command text for conditionally inserting row in repeating table

June 2nd, 2010 No comments

Problem 1: Allow the users to insert a row in repeating table based on condition evaluation.

Solution:

  1. Select the repeating table, right click on it to open up context menu.
  2. Click on “Repeating Table Properties…” > “Display Tab” > “Conditional Formatting…” button. It will open up “Conditional Formatting” dialog.
  3. Click on “Add…” to open up “Conditional Format” dialog.
  4. Select the condition and check “Don’t allow user to insert or delete this control” as shown in the image below.
  5. Click OK button on every open dialog.
  6. Now preview the form. Based on evaluated condition, clicking on “Add Employee” will either allow or don’t allow you to insert a new row.

Problem 2: Above mentioned solution does not hide the command text “Add Employee” so user may try to click on it but nothing happens. The problem is to hide a command text.

Solution: Read more…

Categories: Infopath Tags:

InfoPath: Conditionally Hide Hyperlink Control

April 30th, 2010 No comments

You may have been to a situation where you have to conditionally hide the hyperlink control but unlike many other InfoPath controls, hyperlink controls does not support conditions. But there is a way to hide this control. :)

Here is my main data source.

IsVisible is a boolean field and Hyperlink is a string storing URL. I want to show the URL only when IsVisible is “true”.

Solution: Read more…

Categories: Infopath Tags:

InfoPath: A proper way to blank out Whole Number, Date using JScript

April 29th, 2010 No comments

Problem:

When you blank out data in InfoPath using JScript, you would probably use the following method.

XDocument.DOM.selectSingleNode("my:xpath/my:node").text = "";

Above code works well when “my:node” is of data type String. If the data type is Number or Date, above code will work but on the user interface you will see an error “Only integers allowed.” and “Only date allowed.”

Only integer allowed Read more…

Categories: Infopath Tags: , , ,

InfoPath Error: Reference to undeclared namespace prefix “dfs”

March 17th, 2010 2 comments

Error:

If you are trying to get/set values using XPath on Secondary Data Source, you might get the error “Reference to undeclared namespace prefix: dfs”.

Cause:

When you are trying to use XPath expression on Secondary Data Source, you must have to declare the namespace that is going to be used in the code. By default, InfoPath does NOT add namespace for Secondary Data Source. You have to add it manually.

Resolution: Read more…

InfoPath Hyperlink Control: Show Hyperlink Based on Filtered Data

March 11th, 2010 No comments

In InfoPath, Hyperlink control does not support filtering data when you select a field for repeating group. But you can definitely avert this limitation using a trick. For example, I have secondary data source “Data” as xml file with the following content

<?xml version="1.0" encoding="utf-8" ?>
<Settings>
    <Setting Name="Users" Value="2" />
    <Setting Name="WebAddress" Value="http://blog.vishalon.net" />
</Settings>

Now I want to get a hyperlink out of “Value” attribute of “Setting” node whose “Name” is “WebAddress”. Read more…

Extended Function getTagFromIdentifierAndTitle to get Fill-In enabled Dropdown

January 26th, 2010 No comments

The function “getTagFromIdentifierAndTitle” is used by SharePoint particularly for changing form fields. But it is good enough only if you have straight forward fields. If you have enabled “Fill-in” values, it will not be able to find the correct element. Here is a extended version of this function to get the “Fill-in” enabled field.

function getTagFromIdentifierAndTitle(tagName, identifier, title)
{
	var len = identifier.length, colonindex, splittitle, taglen, titlelen = title.length, slen;
	var tags = document.getElementsByTagName(tagName);
	for (var i=0; i < tags.length; i++)
	{
		var tempString = tags[i].id;
		taglen = tags[i].title.length;
		if(taglen<titlelen)
			continue;
		splittitle = tags[i].title.replace(title,"");
		slen = splittitle.length;
		if(slen == taglen || (slen > 0 && splittitle.indexOf(":") == -1))
			continue;
		if ((identifier == "" || tempString.indexOf(identifier) == tempString.length - len))
		{
			return tags[i];
		}
	}
	return null;
}
Categories: Javascript, SharePoint Tags:

Write in 9 Indian Scripts in Joomla using TinyMCE and FCKEditor Plugin

January 23rd, 2010 15 comments

Today I am going to explore various ways to easily type in Indian languages like Bengali, Gujarati, Hindi, Marathi, Sanskrit, Kannada, Malayalam, Oriya, Punjabi, Tamil and Telugu very easily in your favourite CMS Joomla.

There are 3 methods you can use depending on your editor choice.

  1. Using JCE Editor
  2. Using FCKEditor
  3. Using TinyMCE editor

Using JCE Editor

You have to first install JCE Editor along with plugins. It is assumed that JCE editor is your default editor. You can check/set it by going to Administration > Site menu > Global Configuration and look for Default WYSIWYG Editor.

  1. Download IndicIME plugin for TinyMCE and put it at WEBROOT\plugins\editors\jce\tiny_mce\plugins so that “indicime” will become sub-folder of plugins.
  2. Now navigate to Administration > Components > JCE Administration > Plugins. Click on “New Plugin” button on the right side.
  3. Fill in the form as described below and “Save” the plugin.
    Description: IndicIME
    Plugin Name: indicime
    Plugin Icon: indicime,indicimehelp
    Layout Icon: indicimehelp

  4. Now navigate to Administration > Components > JCE Administration > Groups. Select the Group(For ex. Default). Go to Layout tab and you will see a button as indicated in image with red square. You can drag this button and drop it in Current Editor Layout anywhere you like and “Save” it.
  5. Now clear browser cache (It is very important) and try to add new article. IndicIME and IndicIME help buttons will show up.
  6. Enjoy typing in Indian languages.

Using FCKEditor

You have to first download FCKEditor for Joomla and install this plugin. It is assumed that FCKEditor is your default editor. You can check/set it by going to Administration > Site menu > Global Configuration and look for Default WYSIWYG Editor.

  1. Download IndicIME plugin for FCKEditor and put it at WEBROOT\plugins\editors\fckeditor\editor\plugins so that “indicime” will become sub-folder of plugins.
  2. Now browse to WEBROOT\plugins\editors\fckeditor\editor and open the file “jtoolbarsetconfig.xml”
  3. At the very bottom, you will get “customplugins” node. Add the following line at the end.
    <add name="indicime" lang="en"/>

    So it will look like this.

  4. Now when you analyze this xml file, you will notice that it contains button list for three types of toolbars named “Advanced”, “Creative” and “Blog”. In each of these toolbars, you may want to add the IndicIME so find a good place to paste the following code as shown in the image.
    <plugingroup>
    <plugin name="indicime" acl="*">
    <params>
    <param name="IndicIMEScripts" value="My Bengali:bengali;My Gujarati:gujarati;My Devnagari: devnagari" />
    </params>
    </plugin>
    <plugin name="indicimehelp" acl="*"/>
    </plugingroup>

    Using this code, you will be able to customize the language list. If you don’t want to customize the list, remove the text “<params>…</params>”.(Make sure it is “<params>” and not “<param>”)

  5. Now clear browser cache (It is very important) and try to add new article. IndicIME and IndicIME help buttons will show up.
  6. Enjoy typing in Indian languages.

Using TinyMCE Editor

It is assumed that TinyMCE editor is your default editor. You can check/set it by going to Administration > Site menu > Global Configuration and look for Default WYSIWYG Editor.

  1. Download IndicIME plugin for TinyMCE and put it at WEBROOT\plugins\editors\tinymce\jscripts\tiny_mce\plugins so that “indicime” will become sub-folder of plugins.
  2. Now from Administration menu, navigate to Extensions > Plugins > Editor – TinyMCE.
  3. On the right hand side, Open the section “Plugin Parameters” and choose “Extended” Functionality.
  4. Now open the section “Advanced Parameters” and at the very bottom, add “indicime” custom plugin and “indicime,indicimehelp” custom button.
  5. Now when you try to add new article, it will show you IndicIME and IndicIME Help.
  6. Enjoy typing in Indian languages.

Limitation of using TinyMCE is that if you want to customize the list of languages, you need to change php code heavily.

Write in 9 Indian Scripts in Drupal 6 using TinyMCE and FCKEditor Plugin

December 22nd, 2009 7 comments

Here is a procedure on how to enable Drupal 6 to write in Indian language Bengali / Gujarati / Hindi / Marathi / Sanskrit / Kannada / Malayalam / Oriya / Punjabi / Tamil and Telugu.

Prerequisite:

  1. Download Wysiwyg project and install it at WEBROOT\sites\all\modules\wysiwyg. Enable this module by navigating to Administer > Site Building > Modules.
  2. Download TinyMCE / FCKEditor and install it at WEBROOT\sites\all\libraries\tinymce(/fckeditor).

There are two ways to enable Drupal 6 to allow user to type in Indian scripts.

  1. Using TinyMCE
  2. Using FCKEditor

Both are equally capable with almost same functionality but it is just a matter of personal choice which one to use.

Using FCKEditor

  1. Download IndicIME plugin for FCKEditor and put it at WEBROOT\sites\all\libraries\fckeditor\editor\plugins so that “indicime” will become sub-folder of plugins
  2. Open the file WEBROOT\sites\all\modules\wysiwyg\editors\fckeditor.inc in text editor
  3. Copy/paste following code at the very bottom in the function wysiwyg_fckeditor_plugins.
    'indicime' => array(
          'path' => $editor['library path'] . '/editor/plugins',
          'buttons' => array(
            'indicime' => t('IndicIME'),
            'indicimehelp' => t('IndicIME Help'),
          ),
          'options' => array (
            'IndicIMEScripts' => t('My Bengali:bengali;My Gujarati:gujarati;My Devanagari:devanagari;English (F12):english'),
          ),
          'internal' => TRUE,
          'load' => TRUE,
        ),
  4. If you want all scripts to be shown, remove “options” line from the above code. “options” is given to show you easy customization of list.
  5. Now navigate to Administer > Site Configuration > Wysiwyg.
  6. For “Filtered HTML” and “Full HTML” input format, select “FCKEditor” and “Save”.
  7. After saving, you will be shown an option for “Edit” for each input format.
    fckinputformat
  8. Click on “Edit” and open section “Buttons and Plugins”. Select “IndicIME” and “IndicIME Help” button for both input format and “Save”.
    indicimebutton
  9. Now navigate to Create Content > Page, you will get Indic IME drop down box for choosing language and help button to show keyboard.fckindicime
  10. Enjoy typing in your own language.

Using TinyMCE

  1. Download IndicIME plugin for TinyMCE and put it at WEBROOT\sites\all\libraries\tinymce\jscripts\tiny_mce\plugins so that “indicime” will become sub-folder of plugins
  2. Open the file WEBROOT\sites\all\modules\wysiwyg\editors\tinymce.inc in text editor
  3. Copy/paste following code at the very bottom in the function wysiwyg_tinymce_plugins.
    'indicime' => array(
            'path' => $editor['library path'] .'/plugins/indicime',
            'buttons' => array(
              'indicime' => t('IndicIME'),
              'indicimehelp' => t('IndicIME Help')
            ),
            'options' => array (
              'indicime_scripts' => t('My Bengali:bengali;My Gujarati:gujarati;My Devanagari:devanagari;English (F12):english')
            ),
            'internal' => TRUE,
            'load' => TRUE,
             ),
  4. If you want all scripts to be shown, remove “options” line from the above code. “options” is given to show you easy customization of list.
  5. Now navigate to Administer > Site Configuration > Wysiwyg.
  6. For “Filtered HTML” and “Full HTML” input format, select “TinyMCE” and “Save”.
  7. After saving, you will be shown an option for “Edit” for each input format.
    IndicIME for TinyMCE with Drupal
  8. Click on “Edit” and open section “Buttons and Plugins”. Select “IndicIME” and “IndicIME Help” button for both input format and “Save”.
    indicimebutton
  9. Now navigate to Create Content > Page, you will get Indic IME drop down box for choosing language and help button to show keyboard.IndicIME for TinyMCE with Drupal
  10. Enjoy typing in your own language.

Update 4th Jan, 2009: I have added code to customize the list of scripts for TinyMCE and FCKEditor. Thanks to Ramana.

Change MS Access application title and icon using VBA

December 15th, 2009 No comments

Here is a code to change MS Access application title and icon using VBA. This code also sets the application icon as form and report default icon.

Dim db As Database
Set db = CurrentDb
db.Properties("AppIcon").Value = CurrentProject.Path & "\Bee.ico"
db.Properties("AppTitle").Value = msgMainTitle
db.Properties("UseAppIconForFrmRpt").Value = True
Application.RefreshTitleBar

Click here for list of all properties exposed by CurrentDB.Properties().

Categories: MS Access Tags: , ,

List of MS Access properties available through CurrentDB.Properties

December 15th, 2009 1 comment

CurrentDB.Properties is nothing but a collection. If you can iterate through a collection, you will be able to get the list of all the properties. Code to iterate through all properties is

Dim i As Integer
For i = 0 To CurrentDb.Properties.count - 1
   Debug.Print CurrentDb.Properties(i).Name
Next

It gave me following list of properties.

Name
Connect
Transactions
Updatable
CollatingOrder
QueryTimeout
Version
RecordsAffected
ReplicaID
DesignMasterID
Connection
ANSI Query Mode
Themed Form Controls
AccessVersion
Build
ProjVer
StartUpForm
StartUpShowDBWindow
StartUpShowStatusBar
AllowShortcutMenus
AllowFullMenus
AllowBuiltInToolbars
AllowToolbarChanges
AllowSpecialKeys
UseAppIconForFrmRpt
Track Name AutoCorrect Info
Perform Name AutoCorrect
AppTitle
AppIcon

I don’t know the data types of the these properties but I put it for quick reference.

Categories: MS Access Tags: ,