Arsip: Parameter utk report
more 17 years ago
l1th1um
ane g bikin report. Datasetny ane bikin Query seperti ini
SELECT DISTINCT D.Tahun, D.Januari, d1.IdCustomer, d1.Nama, D2.Januari
FROM "pembayaran.DB" D, "customer.db" d1, "pemakaian.DB" D2
WHERE
(d1.IdCustomer = D.IdCustomer)
AND (D2.IdCustomer = d1.IdCustomer) AND (D.Tahun = :thn)
ORDER BY d1.IdCustomer
trs di form laporan nya pake 2 ComboBox
- CBTahunLaporan
- CBBulan Laporan
di even onclick ane bkn prosedur
procedure TForm2.Button5Click(Sender: TObject);
var
begin
DM.QReport.Close;
DM.QReport.ParamByName('thn').AsInteger := StrToInt(CBTahunLaporan.Text);
DM.QReport.open;
LapBulananSQL.QRBulan.Caption := CBBulanLaporan.Text;
LapBulananSQL.QRTahun.Caption := CBTahunLaporan.Text;
LapBulananSQL.Preview;
end;
tapi koq yang muncul semua tahun, ga spesifik tahun dari CBTahunLaporan
terus
D.Januari
mo ane bikin parameter jg. ane coba
D.:bulan
ternyata salah :D
more 17 years ago
ImanD
sebelum ke report coba test dulu query secara manual sesuai dengan harapan ga?klo ngga, ditampilin di dbgrid dulu...coba test!
more 17 years ago
mas_kofa
tapi koq yang muncul semua tahun, ga spesifik tahun dari CBTahunLaporanbiasanya kalo pake distinct "select distinct field1, field2,...........from....." yang tampil hanya filed pertama aja field1........... kenapa spt itu.........? ampe skrg aku belom tau jawabannya..??
more 17 years ago
l1th1um
hasil query sih udah muncul, cmn pengen pake parameter. nah pas parameter itu g jalan. sy nyoba tampilin januari pake
D.Januarinah klo diganti jadi
D.:bulanitu jadi salah. mungkin kesalahan format, cuman g tau gmana yang benernya :D kemudian parameter tahun, even saya masukin taunny 2007, tapi 2008 juga ikut masuk k report
more 17 years ago
Anonymous
SELECT DISTINCT
D.Tahun,
D.Januari,
d1.IdCustomer,
d1.Nama,
D2.Januari
FROM
"pembayaran.DB" D
INNER JOIN "customer.db" d1 ON (d1.IdCustomer = D.IdCustomer)
INNER JOIN "pemakaian.DB" D2 ON (D2.IdCustomer = d1.IdCustomer)
WHERE
(D.Tahun = :thn)
ORDER BY d1.IdCustomer
silahkan di coba?!
more 17 years ago
ImanD
cobain dgn ini:
procedure TForm2.Button5Click(Sender: TObject);
begin
with DM.QReport, LapBulananSQL do
begin
Close;
SQL.Text:=Format('SELECT DISTINCT D.Tahun, D.%s, d1.IdCustomer, d1.Nama, D2.Januari '+
'FROM "pembayaran.DB" D, "customer.db" d1, "pemakaian.DB" D2 '+
'WHERE (d1.IdCustomer = D.IdCustomer) AND (D2.IdCustomer = d1.IdCustomer) AND (D.Tahun=%s) '+
'ORDER BY d1.IdCustomer',);
Open;
QRBulan.Caption := CBBulanLaporan.Text;
QRTahun.Caption := CBTahunLaporan.Text;
Preview;
end;
end;
more 17 years ago
l1th1um
koq ga keluar apa2 yah bos?
ane coba di DataModule Masukin
SELECT DISTINCT D.Tahun, :bulan, d1.IdCustomer, d1.Nama, :bulan2 '+
'FROM "pembayaran.DB" D, "customer.db" d1, "pemakaian.DB" D2 '+
'WHERE (d1.IdCustomer = D.IdCustomer) AND (D2.IdCustomer = d1.IdCustomer) AND (D.Tahun=:tahun) '+
'ORDER BY d1.IdCustomer',);
di Event onclick ane kasih
DM.QReport.ParamByName('bulan').AsString := concat('D:'+CBBulanLaporan.Text);
DM.QReport.ParamByName('bulan2').AsString :=concat('D:'+CBBulanLaporan.Text);
DM.QReport.ParamByName('thn').AsInteger := StrToInt(CBTahunLaporan.Text);
di Params dah diset, bulan sama bulan2 type data string, tahun integer
skrg muncul, cuman nilainya nol
gmana yah ?more ...
- Pages:
- 1
reply |
Report Obsolete
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 4 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 5 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 12 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 12 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 12 years ago
Random Topic
- find connection string
by nurez in Tip n Trik Pemrograman more 17 years ago - CheckListBox ?
by umarbakri in Hal umum tentang Pascal Indonesia more 18 years ago - program multi user (duplicate primary key)
by ricky_seldjatem in Tip n Trik Pemrograman more 16 years ago - [ask]gimana buat form supaya memiliki style windows XP
by R960XT in Form Enhancement & Graphical Controls more 18 years ago - [ask] tombol, mikrokontroller, assembler dgn Delphi
by cimprodot05 in Network, Files, I/O & System more 13 years ago - Buat program untuk Air lines (pemesanan tiket)
by Brams in Tip n Trik Pemrograman more 17 years ago - Fuzzy MADM in deLpHi
by irmains in Tutorial & Community Project more 15 years ago - baca nilai null ?
by boy_borland in Tip n Trik Pemrograman more 18 years ago - shutdown windows?
by sulth4n in Tip n Trik Pemrograman more 19 years ago - Help .. Terjemahin in delphi Dunk ...
by daryl_sukma_gumilar in Hal umum tentang Pascal Indonesia more 15 years ago