Senin, 19 Oktober 2009

Cetak Crystal Report di asp.net menggunakan stored Procedure

Try
Dim objCommand As New SqlCommand("spLapAbsensiRemark", MyConnect.open)
Dim objDataAdapter1 As New SqlDataAdapter(objCommand)
objCommand.CommandType = CommandType.StoredProcedure
objCommand.CommandTimeout = 0
objCommand.Parameters.Add("@PeriodeStart", SqlDbType.VarChar, 10).Value = vawal
objCommand.Parameters.Add("@PeriodeEnd", SqlDbType.VarChar, 10).Value = vakhir
objCommand.Parameters.Add("@vperusahaan", SqlDbType.VarChar, 30).Value = vbengkel

objDataAdapter1.Fill(objDataset1, "LapAbsensiRemark")
Xdoc3.Load("D:\MasagungHrd\Program\Report\rptDaftarAbsensiRemark.rpt")
Xdoc3.SetDataSource(objDataset1.Tables("LapAbsensiRemark"))
CrystalReportViewer4.ReportSource = Xdoc3
objCommand.Dispose()
MyConnect.close()
Catch When Err.Number <> 0
msg = "alert('Tampil Report Karyawan Tdk Masuk Error');"
Page.ClientScript.RegisterStartupScript(Me.GetType(), "Pesan", msg, True)
End Try

1 komentar:

  1. Wih Mas Muhajir betul2 microsoft punya. Mas ngak pingin migrasi open source.

    BalasHapus