Monday, March 23, 2015

Menampilkan ireport menjadi pdf pada browser menggunakan jsp

Assalamualaikum wr wb, Kali ini saya ingin berbagi informasi sedikit tentang JSP dan Ireport dari jaspersoft, setelah beberapa hari pusing dengan cara menampilkan hasil report dari .jasper ke PDF pada browser melalui jsp akhirnya mendapatkan hasil dari http://javaknowledge.info/calling-jasper-report-from-java-web-application-using-jsp/
Pastikan library ireport sudah dimasukkan pada library projek anda yang saya gunakan adalah :
-mysql-connector
-commons-beanutils
-commons-digester
-common-logging
-groovy-all
-iText
-jasperreports-5.5.0
(library di atas kecuali mysql-connector sudah ada pada C:\Program Files\Jaspersoft\iReport-4.1.2\ireport\modules\ext. jika anda sudah menginstall ireport, disini karena saya menggunakan ireport 5.5.0)

Sebelumnya silahkan anda membuat sebuah report pada ireport, compile > lalu copy paste file .jasper dan .jrxml pada tempat folder web application anda, di dalam aplikasi saya membuat folder khusus untuk file ireport yaitu folder "report"
Langsung saja ini adalah file cetak_pegawai.jsp yang terdapat pada folder "cetak"

<%--
    Document   : cetak_data_pegawai
    Created on : Mar 12, 2015, 3:04:46 PM
    Author     : damnkid
--%>
<%@ page  import="java.io.*"%>
<%@ page  import="java.sql.Connection"%>
<%@ page  import="java.sql.DriverManager"%>
<%@ page  import="java.util.HashMap"%>
<%@ page  import="java.util.Map"%>
<%@ page  import="net.sf.jasperreports.engine.*"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%
   
            Connection con_data_pegawai = konekpack.koneksidb.setKoneksi();
            File reportFile = new File(application.getRealPath("/report/data_pegawai.jasper"));//your report_name.jasper file
            Map parameters = new HashMap();
            byte[] bytes = JasperRunManager.runReportToPdf(reportFile.getPath(), parameters, con_data_pegawai);

            response.setContentType("application/pdf");
            response.setContentLength(bytes.length);
            ServletOutputStream outStream = response.getOutputStream();
            outStream.write(bytes, 0, bytes.length);
            outStream.flush();
            outStream.close();
%>

Shift + F6 tunggulah beberapa saat maka tampilan browser anda berubah menjadi pdf viewer....


yang terpenting disini menurut saya adalah mengetahui dimana posisi file .jasper anda melalui application.getRealPath(), silahkan bertanya jika ragu...

Selamat mencoba..  ^_^ 

  

Friday, December 5, 2014

Membuat dan Menyimpan Tanggal hari ini di java

Assalamualaikum wr wb, kepada teman-teman yang butuh tutorial membuat tanggal hari ini saya membuat nya di jsp

for coding :

<%--
    Document   : entri_absen_pegawai
    Created on : Nov 5, 2014, 10:29:49 PM
    Author     : damnkid
--%>
<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>


<%
    SimpleDateFormat dte = null;
    dte = new SimpleDateFormat("dd-MM-yyyy");
    String tgl_peg = dte.format(new Date());



%>
<%
Connection con_entri_apeg;
    con_entri_apeg = konekpack.koneksidb.setKoneksi();
    Statement stt_apeg = con_entri_apeg.createStatement();
  %>
<%     
    String entri_absens_apeg = "insert into absen_pegawai value("
                           
                            +"'"+tgl_peg+"',"
                           
                           
                            + ")";
                            stt_apeg.executeUpdate(entri_absens_apeg);
   

%>

Friday, November 1, 2013

JSP (Penting) untuk yang ingin membuat JSP Session dan Cookies

Alhamdulillha Hirabbilalamin berkat file ini saya akhirnya menemukan titik terang untuk menyimpan sebuah variabel yang akan dipanggil menjadi nama pengguna dalam web Tugas akhir saya yaitu "session"

silahkan dipelajari bagi yang membuat projek menggunakan JSP

klik di sini

sumber :
http://lecturer.eepis-its.edu/~yuliana


Alhamdulillah hirabbilalamin

Thursday, October 24, 2013

Perintah Sql Alter Table

Sintaks untuk menambahkan kolom

ALTER TABLE table_name ADD column_name datatype;
Untuk Contoh: Untuk menambahkan kolom "pengalaman" ke meja karyawan, query akan seperti
ALTER TABLE employee ADD experience number(3);

Sintaks untuk menjatuhkan kolom

ALTER TABLE table_name DROP column_name;
Untuk Contoh: Untuk drop kolom "lokasi" dari tabel karyawan, query akan seperti
ALTER TABLE employee DROP location;
Sintaks untuk memodifikasi kolom
ALTER TABLE table_name MODIFY column_name datatype;
Untuk Contoh: Untuk memodifikasi gaji kolom dalam tabel karyawan, query akan seperti
ALTER TABLE employee MODIFY salary number(15,2);

The SQL RENAME Perintah ini digunakan untuk mengubah nama tabel atau objek database.
Jika Anda mengubah nama benda setiap referensi untuk nama lama akan terpengaruh. Anda harus secara manual mengubah nama lama ke nama baru dalam setiap penyebutan.

Sintaks untuk mengubah nama tabel

RENAME old_table_name To new_table_name;
Untuk Contoh: Untuk mengubah nama karyawan meja ke my_employee, query akan seperti
RENAME employee TO my_emloyee; 

Sumber: http://beginner-sql-tutorial.com/id/sql-alter-table.htm

Monday, April 22, 2013

Biografi Inspirasi

Berikut salah satu manusia yang menjadi inspirasi dari penulis yakni Abraham Lincoln presiden USA ke 16 dan Bpk B.J. Habibie pemimpin tauladan kita

BIOGRAPHY OF ABRAHAM LINCOLN


Abraham Lincoln
Abraham Lincoln / (February 12, 1809 – April 15, 1865) was the16th President of the United States, serving from March 1861 until his assassination in April 1865. Lincoln led the United States through its greatest constitutional, military, and moral crises the American Civil War preserving the Union, abolishing slavery, strengthening the national government and modernizing the economy. Reared in a poor family on the western frontier, Lincoln was self-educated, and became a country lawyer, a Whig Party leader,Illinois state legislator during the 1830s, and a one-term member of the United States House of Representatives during the 1840s.
After a series of debates in 1858 that gave national visibility to his opposition to the expansion of slavery, Lincoln lost a Senate race to his arch-rival, Stephen A. Douglas. Lincoln, a moderate from a swing state, secured the Republican Party presidential nomination in 1860. With almost no support in the South, Lincoln swept the North and was elected president in 1860. His election was the signal for seven southern slave states to declare their secession from the Union and form the Confederacy. The departure of the Southerners gave Lincoln's party firm control of Congress, but no formula for compromise or reconciliation was found. Lincoln explained in his second inaugural address: "Both parties deprecated war, but one of them would make war rather than let the Nation survive, and the other would accept war rather than let it perish, and the war came."
When the North enthusiastically rallied behind the national flag after the Confederate attack on Fort Sumter on April 12, 1861, Lincoln concentrated on the military and political dimensions of the war effort. His goal was now to reunite the nation. As the South was in a state of insurrection, Lincoln exercised his authority to suspend habeas corpus, arresting and temporarily detaining thousands of suspected secessionists without trial. Lincoln averted British recognition of the Confederacy by skillfully handling the Trent affair in late 1861. His efforts toward the abolition of slavery include issuing his Emancipation Proclamation in 1863, encouraging the border states to outlaw slavery, and helping push through Congress the Thirteenth Amendment to the United States Constitution, which finally freed all slaves nationwide in December 1865. Lincoln closely supervised the war effort, especially the selection of top generals, including commanding general Ulysses S. Grant. Lincoln brought leaders of the major factions of his party into his cabinet and pressured them to cooperate. Under Lincoln's leadership, the Union set up a naval blockade that shut down the South's normal trade, took control of the border slave states at the start of the war, gained control of communications with gunboats on the southern river systems, and tried repeatedly to capture the Confederate capital at Richmond, Virginia. Each time a general failed, Lincoln substituted another until finally Grant succeeded in 1865.
An exceptionally astute politician deeply involved with power issues in each state, Lincoln reached out to War Democrats and managed his own re-election in the 1864 presidential election. As the leader of the moderate faction of the Republican party, Lincoln found his policies and personality were "blasted from all sides": Radical Republicans demanded harsher treatment of the South, War Democrats desired more compromise, Copperheadsdespised him, and irreconcilable secessionists plotted his death. Politically, Lincoln fought back with patronage, by pitting his opponents against each other, and by appealing to the American people with his powers of oratory. His Gettysburg Address of 1863 became the most quoted speech in American history. It was an iconic statement of America's dedication to the principles of nationalism, republicanism, equal rights, liberty, and democracy. At the close of the war, Lincoln held a moderate view of Reconstruction, seeking to reunite the nation speedily through a policy of generous reconciliation in the face of lingering and bitter divisiveness. Six days after the surrender of Confederate commanding general Robert E. Lee, however, Lincoln was assassinated by actor and Confederate sympathizer John Wilkes Booth. Lincoln's death was the first assassination of a U.S. president and sent the nation into mourning. Lincoln has been consistently ranked both by scholars and the public as one of the greatest U.S. presidents.



BIOGRAPHY OF B.J. Habibie

B J Habibie
Prof. DR (HC). Ing. Dr. Sc. Mult. Bacharuddin Jusuf Habibie or BJ Habibie is known as (73 years) is a man of Pare-Pare (South Sulawesi), born June 25, 1936. Habibie became President of the 3rd Indonesia for 1.4 years and two months as Vice President of the Republic to-7. Habibie is a "blaster" among the Javanese [mother] with Macassar / Pare-Pare [her father].
Small the days, Habibie has shown wit and high spirits on science and technology especially in Physics. During the six months he attended the Mechanical Engineering Institute of Technology Bandung (ITB), and proceeded to Rhenisch Wesfalische Tehnische Hochscule - Germany in 1955. By financed by his mother, R.A. Tuti Marini Puspowardoyo, young Habibie spent 10 years to complete the study of S-1 to S-3 in Aachen, Germany.

Unlike the average Indonesian students who received scholarships abroad, lectures Habibie (especially S-1 and S-2) are financed directly by the mother who did business catering and indekost in Bandung after her husband left to go (father Habibie). Habibie, Business, Design and Construction of Aircraft in the Faculty of Mechanical Engineering. During the five-year study in Germany Habibie finally earned his diploma Dilpom-Ingenenieur or techniques (note: technical diploma in Germany is generally synchronized with the title Master/S2 in other countries) with summa cum laude.

Mr. Habibie continue the doctoral program after marrying his high school friend, Mrs. Hasri Ainun Besari in 1962. Together with his wife living in Germany, Habibie must work to pay tuition fees as well as the cost of their household. Habibie had an interest in Aircraft Design and Construction. In 1965, Habibie S-3 finish his studies and received an honorary Doctor Ingenieur (Doctor of Engineering) with performance index summa cum laude.

During a doctoral student, BJ Habibie, has started work to support his family and cost studies. After graduation, BJ Habibie, working in-Blohm Messerschmitt-Bölkow or MBB Hamburg (1965-1969 as Head of Research and Development on Aircraft Structure Analysis, and later served as Head of Methods and Technology Division in the commercial aircraft industry and the military in MBB (1969 - 1973). Top performance and kebriliannya, four years later, he was appointed as Vice President and Director of Technology at MBB Penasihast period from 1973 to 1978 and became Senior Director of technology to the Board of MBB (1978). He became the only Asian person who succeeded in occupying number two position in this German aircraft company.
Before entering the age of 40 years, Habibie was very brilliant career, especially in the design and construction of aircraft. Habibie became "jewel" in Germany and he had "honorable position," both materially and intellectually by the Germans. While working at the MBB of Germany, Habibie contributed various research findings and a number of theories for science and technology in the field of Thermodynamics, Construction and Aerodynamics. Several theoretical formulations known in the world aircraft such as the "Habibie Factor", "Habibie's Theorem" and "Habibie Method".

Habibie is Indonesia's first president who has received many awards, especially in the fields of science and technology both from domestic and foreign. Services in the field of aircraft technology to deliver he received an honorary Doctorate (Doctor of Honoris Causa) from the world's leading berbagaai University, among others, Cranfield Institute of Technology and Chungbuk University.

Thursday, March 21, 2013

GUI Palette pada Eclipse dengan Jwindows Builder



                Sudah lama tidak posting lagi, tidak tahu knapa pengen menulis postingan tentang bagaimana cara mudah mendrag java component pada eclipse (padahal baru liat blog temen heheheh izin crop dikit ya cuy).

Saturday, November 10, 2012

UH  XRPL (Merakit PC)
Pilihlah jawaban a, b, c, d  atau e yang anda anggap paling benar !
  1. Software yang dipasang pada chip komputer untuk mengatur operasi dasar seperti layar, harddisk, memory, VGA adalah ....
a)      BIOS
b)      Bus
c)      Memory
d)     CMOS
e)      Prosesor
  1. Media penyimpan data berkapasitas besar adalah ....
a)      BIOS
b)      Prosesor
c)      Memory
d)     Harddisk
e)      Disket
  1. Papan rangkaian komputer tempat semua komponen elektronik komputer terangkai disebut ....
a)      Peripheral
b)      Prosesor
c)      Keyboard
d)     Harddisk
e)      Motherboard
  1. Suatu rangkaian elektronik yang berfungsi sebagai pemberi sumber tegangan/arus adalah...
a)      Peripheral
b)      Prosesor
c)      UPS
d)     Stavol
e)      Powersupply
  1. Kepala, ujung perekam, bagian dari drive atau disk yang berfungsi untuk membaca atau menulis adalah ....
a)      Head
b)      Prosesor
c)      Disket
d)     Stavol
e)      Powersupply
  1. Peralatan/Komponen pada PC meliputi unit input, unit proses, dan unit output sering disebut dengan ....
a)      Elemen  Komputer
b)      Sistem Komputer
c)      Data  Komputer
d)     Brainware Komputer
e)      User Komputer
  1. Tujuan pokok dari sistem komputer adalah....
a)      Mengolah user
b)      Mengolah brainware
c)      Mengolah software
d)     Mengolah data
e)      Mengolah informasi

  1. Kapasitas 2 Mb adalah ....
a)      2048 Kb
b)      2000 Kb
c)      2024 Kb
d)     1024 Kb
e)      1000 Kb

  1. Yang termasuk Software  adalah, kecuali ...
a)      Microsoft Office 2003
b)      Microsoft Office XP
c)      Adobe Photoshob
d)     CorelDraw X3
e)      Harddisk

  1. adalah alat yang digunakan untuk menerima input dari luar sistem, dan dapat berupa signal input atau maintenance input, disebut dengan ...
a)      Brainware
b)      Input device
c)      Output device


d)     Operator
e)      Storage device



Jawablah Pertanyaan dibawah ini dengan jelas dan singkat !
  1. Jelaskan peristilahan dibawah ini !
a)      BIOS                                                                     f)  Mothebord
b)      Casing                                                                   g)  Peripheral
c)      Processor                                                               h)  Power Supply
d)     CMOS
e)      CPU
  1. Sebutkanlah komponen-komponen pada PC  yang termasuk Input device, Proses, Out Put Device, Periferal dan Storage Device !
  2. Berilah keterangan pada panel konektor dibawah ini !



  4. Apa yang dimaksud dengan computer serta fungsinya bagi kehidupan sehari-hari?
              5. Coba jelaskan istilah yang ada di bawah ini serta berikan 2 contohnya!
-          Hardware
-          Software
-          Brainware




Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Facebook Themes