Buat laporan dengan Php..?

Mentok waktu di suruh buat laporan! maunya kaya crystal report, ternyata ga ada! jd pake HTML aja deh!!
masih aja ada masalah, walaupun boleh tanpa tombol print yaitu pake File -> Print.. tapi gw kurang puas dengan itu! tanya-tanya temen an konsultasi sama mbah google ternyata dapet juga dengan ga habis 1 hari!

ni codingnya :
Buat tombolnya printnya di halaman preview report

<input type=”button” name=”btn_cetak” onClick=”cetak(<?php echo $param;?>)” value=”Cetak”>

Buat script javascript diantara tag<head></head>

<script language=”javascript”>
function cetak(param){
window.open(“cetak.php?param=”+param,”cetak”,”width=500,heigth=500,scrollbars=1″)
}
</script>

Di cetak php
<body onload=”window.print()”>
<?php
$param=$_GET[’param’];
$sql=”select ….. from … where field=’$param’”;
//buat tampa button
?>
</body>

Sehingga jika cetak.php diload maka akan langsung muncul dialog priint
eh, itu dapet dari orang! (bukan gw yg buat) ini cuma media penyampaian aja.. (semoga membantu) maklum blom menguasai (masih ngeja nih). Tapi itu gw juga masih blom puas!! karena bisa ngeliat hasilnya kalo udah di print aja! ok akhirnya cari-cari lagi dan mbah google sangat amat baik ngasih gw script seprti ini :

<html>
<head>
<title>Tes</title>

<style type=”text/css”>
@media print {
input.noPrint { display: none; }
}
</style>

</head>
<body>

<?php
class orang {
var $nama = ‘Nyoba Print’;
var $tinggal = ‘Di HTML’;
}
$new_plesh=new orang();
echo “Tugas saya adalah “.$new_plesh->nama;
echo “<br>”;
echo “Tinggal di :”.$new_plesh->tinggal;

?>
<form><input class=”noPrint” type=”button” value=”Print” onclick=”window.print()”></form>

</body>
</html>

dengan itu gw baru berasa puas!

pertamanya sih tombol printnya pun ikut ke print, tapi pas pake css itu selesai juga 1 masalah gw! alhamdulillah

thx ya Allah…

About these ads

Ditandai:

15 gagasan untuk “Buat laporan dengan Php..?

  1. mitsikuri 3 Februari 2009 pukul 6:38 pm

    postingan yg bagus sekali , thanks ya atas infonya

  2. c_tea 23 Februari 2009 pukul 12:51 pm

    yupz….membantu c..tapi zu2r, q masih bingung ttg cara memberi nomor per halaman, kan yang diprint datanya bwanyak tuh…..
    thank’s

  3. eksa 25 Februari 2009 pukul 1:54 pm

    coba nanti saya uploadkan….

  4. iwank 13 Juli 2009 pukul 8:53 pm

    trims atas info na..
    tapi yg bikin saya bingung,, gmn klo laporan nya itu diambil dr database ?!
    kasie script na donk mas ?! makasie…

  5. luea 14 Juli 2009 pukul 9:33 am

    Alkhamdulillah, akhirnya laporanku bisa diprint. terima kasih mas info nya.

    To : iwank
    scriptnya juga bisa kl datanya diambil dari database. untuk script yang di bawah ini :
    nama;
    echo “”;
    echo “Tinggal di :”.$new_plesh->tinggal;

    ?>

    tinggal di ganti aja. InsyaAlloh jadi.

  6. Pian 4 Februari 2010 pukul 12:55 am

    Thanks info-y sob

  7. Ade 17 Mei 2010 pukul 9:56 pm

    wihh mantep tutorialnya mas

    thx bgt ^^

  8. rie 25 Juni 2010 pukul 5:59 am

    thx gan….untuk setting halamanaya gimana ya gan?

  9. joent 30 Mei 2011 pukul 2:30 pm

    mas knapa title sama alamat dan jam juga ikut di print ya??
    gimana cara ngilanginnya mas?
    btw, makasih mas buat infonya :)

  10. Ay Ay Riyanti 17 Juli 2011 pukul 9:24 pm

    pgen cpet2 nyoba…
    maksud dari .$new_plesh->tinggal tu ap ya??? harus diketik juga yah,,
    aq jg mw ngprint data dari database pi qo salah truz yah listingnya???
    sblumnya makasi y mas,, tlg dijawab yahhh..:)

  11. fadixz 8 Maret 2012 pukul 2:39 pm

    sangat membantu ni tutor -nya. ane mau ni gan….. gimana cara meletakkan tempat, tanggal dan tanda tangan atasan. maksud ana kayak bikin surat/cetak surat ( yang biasanya tempat, tanggal dan nama a tasan terletak di bawah sebelah kanan di bagian surat terakhir dari beberapa halaman.

  12. dharma 15 Juni 2012 pukul 3:41 pm

    agan2 yang diatas,leh mnta bantaun g???
    klo ada yang ssukses minta tolong donnk kirmin email ke
    dharmawan.agus@yahoo.co.id

    aq butuh banget ini soale//..

    tq gan

  13. mahsun's 13 Maret 2013 pukul 9:41 am

    Makasi gan, ilmunya lumayan buat tambah ilmu kanuragan… Hahahaha

  14. promotional discounts by sears 18 Juli 2013 pukul 9:51 am

    One of the most effective approaches to perform couponing properly would be to follow the recommendations of other consumers.

    It may be your friend, family, as well as the net
    opinions. Following a pattern, where in fact the engaged people are
    being benefited is obviously reliable. While you can very quickly get
    data for employing a promotion with sears promotion signal, it saves your time as well.

    This can also work vice versa, where you can help others while sharing your experience on the web or during socialization.

    Richard Sears was a lot in tune towards the progressions in his land and used them together with his
    new business, because it happened. Mail request buying became
    still another pattern, as individuals we’re beginning to go west and more railroads were being built. Clients from on the place were excessively empowered to truly have the capacity to ask such excellent things while never having to leave their homes.
    At sears promotion could be applied on automotive products, apparels, jewelries, and masses more. You can get a voucher which can be applied on any particular brand or product category. You will find coupons which may be employed in a specific amount of purchase. In this case, there might not be any limit for selecting the products. Consequently, it can be easily understood that how beneficial the deals can be so far as your purchase from Sears is concerned. Starting from the ladies shoes to even the mattresses and the exercise tools, the said coupons can be acquired in a number of items, as stated earlier.

  15. Hershel 22 Juli 2013 pukul 11:21 pm

    s perfect diamond necklace, his soul mates, but if he’s not able to start a relationship he then will leave behind you. Perhaps all your family might or might not setup an all in one romantic dinner gorgeous honeymoons too several everywhere on the they favorite place. ” The creators of “Family Guy” drew in Jonathan Lipnicki as being a rather hideous looking grumpy faced putz.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Logout / Ubah )

Twitter picture

You are commenting using your Twitter account. Logout / Ubah )

Facebook photo

You are commenting using your Facebook account. Logout / Ubah )

Google+ photo

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

Ikuti

Get every new post delivered to your Inbox.

%d bloggers like this: