Archive for May, 2009

Function Terbilang (Number to text) in Indonesian Language using crystal report

After googling the net to find anyone who post on how to create function Terbilang in crystal report, finally I found one site thats really works.

The original source is from here:
Read the rest of this entry »

  • Share/Bookmark

Function Terbilang (Indonesia Currency) vb.net

This function is used to convert from numeric to text in indonesia language. This function was coded for vb.net

    Public Function Terbilang(ByVal nilai As Long) As String
        Dim bilangan As String() = {"", "satu", "dua", "tiga", "empat", "lima", _
        "enam", "tujuh", "delapan", "sembilan", "sepuluh", "sebelas"}
        If nilai < 12 Then
            Return " " & bilangan(nilai)
        ElseIf nilai < 20 Then
            Return Terbilang(nilai - 10) & " belas"
        ElseIf nilai < 100 Then
            Return (Terbilang(CInt((nilai \ 10))) & " puluh") + Terbilang(nilai Mod 10)
        ElseIf nilai < 200 Then
            Return " seratus" & Terbilang(nilai - 100)
        ElseIf nilai < 1000 Then
            Return (Terbilang(CInt((nilai \ 100))) & " ratus") + Terbilang(nilai Mod 100)
        ElseIf nilai < 2000 Then
            Return " seribu" & Terbilang(nilai - 1000)
        ElseIf nilai < 1000000 Then
            Return (Terbilang(CInt((nilai \ 1000))) & " ribu") + Terbilang(nilai Mod 1000)
        ElseIf nilai < 1000000000 Then
            Return (Terbilang(CInt((nilai \ 1000000))) & " juta") + Terbilang(nilai Mod 1000000)
        ElseIf nilai < 1000000000000 Then
            Return (Terbilang(CInt((nilai \ 1000000000))) & " milyar") + Terbilang(nilai Mod 1000000000)
        ElseIf nilai < 1000000000000000 Then
            Return (Terbilang(CInt((nilai \ 1000000000000))) & " trilyun") + Terbilang(nilai Mod 1000000000000)
        Else
            Return ""
        End If
    End Function
  • Share/Bookmark

SQL Server Management Objects with VB.net

SQL Serverâ„¢ Management Objects (SMO) offer developers a robust toolset for operations such as backing up and restoring databases, and issuing Data Definition Language (DDL) commands. Using SQL SMO you can also connect to SQL Server, iterate through a collection of database objects and perform a variety of tasks against them.

I have been created simple program using vb.net 2008 and sql server 2005 using SQL SMO.
Read the rest of this entry »

  • Share/Bookmark

Microsoft SQL Server 2005 Cursor Example

DECLARE @id INT
DECLARE @name varchar(25)
DECLARE db_cursor CURSOR FOR
SELECT id,name From myTable
OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @id, @name

WHILE @@FETCH_STATUS = 0
BEGIN
– do something
FETCH NEXT FROM db_cursor INTO @id, @name
END

CLOSE db_cursor
DEALLOCATE db_cursor

  • Share/Bookmark

Virtuemart, Remove SKU and Price in list view

When you are having virtuemart in Product List Style = Flat Product List, you will see SKU and Price. Some people might not want to show SKU or price column. In virtuemart you cannot simply hide it, but there is other ways that you have to do it manually.

Here is step by step how to remove SKU or price column or other column in virtuemart list view.

1. search file name browse_listtable.tpl.php in /components/com_virtuemart/themes/default/templates/browse/includes

2. go to line 15 to 18:
remove code :
$tableheader[] = $VM_LANG->_('PHPSHOP_CART_SKU');
if( _SHOW_PRICES && $auth['show_prices'] ) {
$tableheader[] = $VM_LANG->_('PHPSHOP_CART_PRICE');
}

3. After remove go to line 36 to 39:
remove code:
$data[$row][] = $product['product_sku'];
if( _SHOW_PRICES && $auth['show_prices'] ) {
$data[$row][] = $product['product_price'];
}

Notes:

I’m using joomla v1.5.10 and virtuemart v.1.1.3

  • Share/Bookmark