All of My Ending Waiting to Begin
January 3rd, 2008
I was very amazed when first time i listening to Slipknot Subliminal Verse. A Song titled Circle very make me amazed.. the lyric that i think was very cloud. I Love the sentence in the lyric that state : “All of My Ending Waiting to Begin…..”
You know.., all of our ending is need to begin.. just like the ran race, it’s need the word “Begin!” for the race started. So, ending is not end of everything, because ending also a process that will to be end. Absolutely you can’t understand what i talking about. Just imagine the circle. Enjoy
CIRCLE
Give me the dust of my father
Stand on the face of the ancients
Bare the secret flesh of time itself
Follow me (Follow me)
I’ve come so far behind again
Follow me (Follow me)
Wish so hard I’m there again
Follow me (Follow me)
Follow me (Follow me)
All that I wanted were things I had before
All that I needed I’ve never needed more
All of my questions are answers to my sins
All of my endings waiting to begin
I know the way that I faulter
Can’t be afraid of my patience
There’s a sacred place where Razel keeps safe
Follow me (Follow me)
I’ve seen so much I’m blind again
Follow me (Follow me)
I feel so bad I’m in love again
Follow me (Follow me)
All that I wanted were things I had before
All that I needed I’ve never needed more
All of my questions are answers to my sins
All of my endings waiting to begin
Generating Excel Report with PHP
December 30th, 2007
INTRO
As a web application developer we often displaying data or displaying report of data from database to our page. Example, sales data, statistical data, and many more as you has done. Now, how if our users want to get data with different format? Maybe users will want to analyze the data in different way. Because, impossible to analyze data in HTML format. It’s easy if we analyze the data in Excel format.
WHAT IS Spreasheet_Excel_Writer
Spreadsheet_Excel_Writer is a set of class from PEAR repository. We can generate Excel document, complete with excel functions and formatting. We can using formula, working in multipl sheet, and much more tasks that often you has done usually with Excel. You can find Spreadsheet_Excel_Writer at PEAR repository site, or if you are using all in one web development package such as XAMPP, there available complete enough classes from PEAR repository, and one from the among is Spreadsheet_Excel_Writer class. You can download the package here ( Spreadsheet_Classess ) after download the package,now you can use Spreadsheet class without depend to PEAR repository structure, you can use the class everywhere.
THE CLASS INFORMATION
The library contains three other classes of which you should be aware, although you may not find yourself having to work with them directly:
- Spreadsheet_Excel_Writer_Validator makes it possible to add cell validation rules. Right now, there’s basically no documentation for this class. It seems to be experimental code, so I’ll be avoiding it here. Basically, it appears to provide the ability to perform basic validation on data entered into an Excel cell by an end user. More complex rules, such as validating against a list of cells, can be implemented by extending the class. The Spreadsheet_Excel_Writer_Workbook class provides the method addValidator() to create an instance of the validation while the Spreadsheet_Excel_Writer_Worksheet allows validators to be assigned to cells with the setValidation() method.
- Spreadsheet_Excel_Writer_Parser, which is a parser for Excel spreadsheet functions that allows you to check whether a function is valid Excel syntax. This may help you trap errors when adding functions to the spreadsheet within PHP.
- Finally, Spreadsheet_Excel_Writer_BIFFwriter is used to generate the Binary File Format for storing Excel files. If you’re interested in Excel hacking, it may be interesting to study what it’s doing but, otherwise, the library hides you from this class completely, so you don’t need to worry about it.
And also another important supporter class that i had to group into one directory.
Let me introduce some basic method that we usually use for generating excel document.
- addWorkSheet()
This method used for creating new worksheet - write()
used for put a data to cell. - writeRow()
used for put data to cell. The different between write() and writeRow() is, write() just render data once into selected cell each we call, and if writeRow(), will render data depend on how many data passed into the writeRow(). The data in writeRow() saved as array() - send()
used for telling browser the type of raw data will come from server - close()
used for erasing class data in memory that we had to instatiate before.
And next, i will explain in more detail only this two important method (because this method is most frequently used) the method is write() and writeRow() method.
write()
what kind of things we passed to this method? first you must imagine we are in front of Excel window now. Illustrated as below :

As you can see above, letter A,B,C,D,etc is named column. And number 1,2,3,etc is named row. It’s funny if i tell you something like this
but, no problem because this will relate with the methods.
In Excel, rows starting from ” 1 ” as u can see above. But in PHP, in the Spreadsheet class, rows is starting from zero. And the starting column is start from zero in Excel, and also in PHP. The letter A equal Zero, B equal 1, C equal 2 and so on..
basic uses of write() method is like this :
$worksheet->write(which_row,which_column,’the data’,cell_style);
which_row : is an integer value that represent the position of row
which_column : is an integer value that represent the position of column
the data : is an string value
cell_style : is a object data type that contain many property of cell style.
example use : $worksheet->write(0,0,’Hello iam in first row and first column’,$xls->addFormat(array(’color’ => ‘red’)));
The above explanation will look like the picture below :

And next, the writeRow() method.
basic uses of writeRow() method is like this :
$worksheet->write(which_row,start_from_which_column,the_data_in_array,cell_style);
which_row : is an integer value that represent the position of row
start_from_which_column : is an integer value that represent the start position of column
the_data_in_array : is an array data type that contain data
cell_style : is a object data type that contain many property of cell style.
example use :
$column = array(’Name’, ‘E-Mail’,'Address’,'Contact Number’);
$worksheet->write(0,0,$column,$xls->addFormat(array(’color’ => ‘red’)));
Do you remember the different of write() and writeRow() method? i hope you remember
. The above explanation is look like this :

Ho ho… i think that’s enough for you to begin to Strike it!
LET’S STRIKE !
As you had to read above, now we will making some basic and simple excel document. Let’s write following code in your favourite editor.
Just for information, my directory structure is like this : C:\xampp\htdocs\Excel\ExcelWriter , ExcelWriter directory contain all of classes.
xls1.php
- <?php
- require_once('ExcelWriter/Writer.php');// class instantiation
- $xls = new Spreadsheet_Excel_writer();// Creating new worksheet
- $worksheet =& $xls->addWorksheet('My First');// defining some data for writeRow() method
- $data = array('Happy','New','Year', '2008');// Putting data into selected row and column
- $worksheet->write(0,0,'Hello iam in first row and first column');
- $worksheet->write(0,1,'Hello iam in first row and 2nd column');
- $worksheet->write(0,2,'Hello iam in first row and 3rd column');
- // keep track the rows if you want to put data in a new row
- $worksheet->writeRow(1,0,$data);
- $xls->send('my_first.xls');
- $xls->close();
- ?>
Just run, and you will get pure xls / Excel document format with data that we have to put with write() method. You must know it, why we call write() method from object variable $worksheet ? and why we call addWorksheet() method from object variable $xls ?
That’s because relate with class structure. object $xls handling all tasks outside of worksheet ( creating new worksheet, setting our worksheet cells,etc) and object $worksheet handling all tasks inside of our worksheet ( putting data to cell, adding formula to cell, changing cells color, etc ) . What object $xls doing is affect globally our worksheet, and $worksheet just handling the internal cells tasks. Woww…
it’s difficult enough to explain, try to understand by yourself
. And, you must remember, we must keep track our rows, if we want to put data in a new row
Ok, now we can to generate very simple excel document
SETTING THE CELL
Now i introduce some common method for setting our cells. With this methods, we can setting height, width, foreground color, text color, and merging the cells.Below is list of the methods that we will use :
- setColumn()
Used for setting the width of a single column or a range of columns.
Basic use : $worksheet->setColumn(whichFirst_column_on_the_range,whichLast_column_on_the_range,width); - setRow()
This method is used to set the height and format for a row.
Basic use :
$worksheet->setRow(which_row,height_for_the_row,row_styles); - setMerge()
Sets a merged cell range.
Basic use : $worksheet->setMerge(whichFirst_row,whichFirst_column,whichLast_row,whichLast_column); - setCustomColor()
Setting custom color from limited alternative from fgcolor properties. With this method we can set the foregroung color of our cells with our favourite color from our favourite color palette. All colors is in RGB Format.
Basic use : $xls->setCustomColor(index,red_value,green_value,blue_value); - addFormat()
Adding format ( cell properties ) to a or range of cell. The cell properties is saved as array()
Basic use :
$worksheet->write(0,0,”TITLE”,$xls->addFormat(array(’align’ => ‘center’,'bold’ => 1,’size’ => 13)));
setCustomColor() method must have a index, and the index is defined by ourself. The value is up to you, and must keep in range of number from 8 up to 64. And must have a call at the top of writing tasks with write() method. Call setCustomColor() method before you call methods for writing because its index will be use in addFormat() method properties.
Let’s try to setting our cell height,width,foreground color, adding format and merging the cells.
- <?php
- require_once('ExcelWriter/Writer.php');
- // class instantiation
- $xls = new Spreadsheet_Excel_writer();
- // Creating new worksheet
- $worksheet =& $xls->addWorksheet('My First');
- // start writing data
- $xls->setCustomColor(11,163,178,204);
- $worksheet->setMerge(0,0,0,3); // Merge the columns
- $worksheet->setColumn(0,3,23); // this column set will affect all columns below the very first column.
- $worksheet->setRow(0,30);
- $worksheet->write(0,0,"TITLE",$xls->addFormat(array('align' => 'center','bold' => 1,'size' => 13,'font-name' => 'Helvetica','color' => 'white','fgcolor' => 11)));
- $xls->send('my_first.xls');
- $xls->close();
- ?>
My Long Time No See Sweet Younger Sister
December 14th, 2007
I got striked in my office when i was developing an existing project. After receive a phone call from my mother that very sweet, very loves me
. She told me. Winda my sister had been married. Watefak?! i had to unbelieve that for a while. And this morning ( 08:00 am ) my sister from her homestay in Bali call me. Wow! this is a surprise! she call me and asked all about me after the separation the two of us since she follow her aunt go to Italia. At the time, approximately she was 7 years old. (sorry winda
if your big brother is wrong ) and she was going to play in kindergarden, in my country called Taman Kanak-Kanak.. and i’am was 8 years old and i was going to school in primary school. Woww.. We did not meet again approximately more than fifteen years. Woww.. that’s a very very long time for me
and now she back to carry out the religious ceremonyin accordance with her religion beforehand.
Why i write this post? this is a representation to state my longing that was very very deep to her, my sweet younger sister who was very naughty, and fussy :p
I miss her.. but you know, at that time we were just still a children i did not know what the name of f***k’n lost. Losing someone that actualy really really i love. As a brother absolutely.
I couldn’t speak and write anymore. I just praying to the God, “God led her always, don’t ever make she sad, may she be always happy with her husband. teach her in order to be able to become a good wife for her husband. i hope she will be successfully, and let luck always was with her. Thank You God, Om Shanti Shanti Shanti Om…”
Ok Winda..
i’am was happy as your brother
I love you… Strike it!
Hello World..
December 12th, 2007
Hello World!
That is very simple word if you want say hello with everyone and every other God masterpiece, without exception. And.. that is a simple word that used by person who was studying new programming language as their program output
. Hehehe because i’am also interested in computer programming.
This blog post is like the baby’s crying that just want to say “Heyyy!!! i’am born! hooraayyy…..” yeaahh my first blog and yet another wordpress blog has been born. I want to socialized my self,enclose me in this community, and give me suggestion,comment in each of my posts .
I’am Indonesian. My blog content is mixed in english and indonesian language. That mean i want to showed up i’am a indonesian that was learning english, and sometime i need to writing in my language for telling specific contents of my head to other Indonesian people. Because it’s easier to tell in Indonesian and it seems Unethical if i writing about my country using english, because i’am Indonesian
in Indonesian i say ” sah sah saja… ”
Thank you, enjoy ![]()
Bangunlah Jiwanya, Bangunlah Badannya……
December 7th, 2007
Indonesia tanah airku, Tanah tumpah darahku.
Disanalah aku berdiri, Jadi pandu ibuku.
Indonesia kebangsaanku, Bangsa dan Tanah Airku.
Marilah kita berseru “Indonesia bersatu.”
Hiduplah tanahku, Hiduplah negriku,
Bangsaku, Rakyatku, semuanya.
Bangunlah jiwanya, Bangunlah badannya
Untuk Indonesia Raya……
Wowww..!! Dada ini bergetar jika mendengarkan lagu kebangsaan kita. Tapi sayang.., ada saja orang-orang yang kakak kikik kakak kikikk saat mengumandangkan lagu tersebut saat Upacara Bendera (biasanya disekolah-sekolah). Sedihnya hati ini. Apakah harus Upacara di Istana Negara baru harus bisa silent semuanya?
Ooopss… sementara jng mikirin itu ahh.. bukan itu yang saya mau utarakan di tulisan saya ini.
Di pertengahan tahun ini, muncul berita Bangsa kita sedang di hina-hina dimaki-maki oleh negara tetangga kita tercinta. Wowww wowwww dan wowww..!! hanya itu yg ada dalam benak saya. Yaa Tuhan…, setelah Banjir, Gempa yang selalu menerpa, dan Beberapa saat yang lalu Tsunami mengguncang Aceh. Dan gempa yang selalu tetap melakukan RoadShow nya ke seluruh Indonesia. Lalu apalagi? kita mendapatkan cobaan, ujian, yaitu dihina - hina oleh negara tetangga kita.
Marah..? Yaaa… tentu saja! Tidak dipungkiri akan terjadi peperangan antar kita dan mereka. Tapi saya, dan kita harapkan itu tidak akan pernah terjadi. Mungkin teman-teman sudah membaca semua sebuah blog yang dibuat oleh saudara kita orang Malaysia. Saya sediiiihhh sekaliiii…, saya terhenyak. dan dada ini bergetar mengapa Bangsaku diperlakukan seperti ini?
GANYANG MALAYSIA! GANYANG MALAYSIA!! Itu terussss terdengar di telinga saya… Hey kawan! Stop! tunggu dulu…, coba kawan-kawan baca lagi blog mereka ( kecuali tulisan mereka tentang Bendera kita dan Lambang Pancasila kita ) .
Ok, kita marah karena kita kaget dan shock. Tapi setelah itu mari coba kita telaah, kita ingat kembali… apa yang sudah kita ( terutama pejabat2 pemerintah yang hanya memikirkan badannya sendiri ) lakukan terhadap Bangsa ini?? Mengapa kita sampai seenaknya mengirim TKI ke Malaysia sebegitu banyaknya. Dan tidak sedikit TKI kita yang bermasalah disana. Apakah pemerintah kita tercinta hanya bisa bergantung kepada negara lain untuk memperkerjakan penduduknya? ke Malaysia, Brunei, Hongkong, halaaahhhhhh begitu banyaknya saudara kita yang tersiksa dan terlantar disana, walaupun ada beberapa (sedikit) yang meraih bahagia. Saya menemukan beberapa artikel yang sangat menyadarkan saya akan cobaan ini.
kawan-kawan bisa membacanya di :
http://www.gatra. com/artikel. php?id=110079
http://kompas.com/ver1/Internasional/0712/03/031649.htm
Malaysia sudah membangun jiwa mereka dengan menghargai kesenian-kesenian daerah walaupun kesenian itu adalah milik kita. Karena kesenian,budaya,dan semua kekayaan Indonesia adalah Jiwa dari Bangsa Indonesia. Yang terjadi di negara kita? Hutan - hutan ditebang seenaknya hanya untuk badan sendiri, kekayaan perut bumi kita digali tanpa ada pemikiran untuk bagaimana jika terjadi masalah dikemudian hari (lumpur lapindo) dan banyak lagi kalau mau kita ingat-ingat lebih jauh. jarang sekali pemerintah melakukan hal - hal yang berorientasi membangun Jiwa Bangsa dan Tanah Air kita tercinta. Bangsa dan Tanah Air Indonesia.
Hey! Stop! tidak saatnya sekarang untuk mencari cari kebrobrokan Bangsa kita. Bukan saatnya untuk Ganyang - ganyang - an. Bukan saatnya untuk saling menyalahkan. Ingat lagu kebangsaan kita! Bangunlah Jiwanya, Bangunlah Badannya… untuk Indonesia Raya….. hey? kalimat itu sangat sakral! jangan sembarangan! bangunlah jiwa kita terlebih dahulu, baru bangun badan kita. Ya itu hanya teori…. tapi cobalah untuk kita hayati dan praktekkan. “Halaaahhh kau cuma omong besar saja! mana aksimu?” mungkin kawan-kawan ada yang berpikiran seperti itu. Ya! saya sadar saya belum melakukan apa-apa.
Saya merasa dipukul dengan sangat keras! oleh Malaysia dan terbangun dari mimpi yang sangaaaaat panjang karenanya. Mereka sudah berbaik hati memberi tahu kelemahan kita, memberi tahu segala kekurangan kita. Bahkan dengan sangat detail dan jelas. Jarang sekali ada orang yang mau memberitahu kekurangan - kekurangan kita,yang sampai-sampai kitapun jadi tidak tahu ada kekurangan dalam diri kita. Ya…walaupun begitu mereka masih tetap berstatus “Maling” karena dengan seenaknya maen embat hak milik orang lain.
Fuuiihhh…. (lega rasanya) tulisan ini saya buat untuk merepresentasikan teriakan hati dan jiwa saya. Juga tulisan ini untuk tetap membuat saya selalu sadar. Malu kan.. udah sadar dan gembar gembor, tetapi besok sudah lupa, sama juga boong. Kalau seandainya saya lupa, tulisan ini akan mengingatkan saya.
Bangunlah Jiwanya Bangunlah Badannya untuk Indonesia Raya…………..
MERDEKA!
