Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 21st November 2011
PHPmaster PHPmaster is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 332
Rep Power: 14
PHPmaster mempunyai hidup yang Normal
Default ₪₪₪₪₪₪ [HELP]MASALAH Print Pada CRYSTAL REPORT..BONUS CENDOL ₪₪₪₪₪₪

Master2 programmer..mau tanya donk..

kan ane ada buat program..pake VB.NET

ketika di design, saya sudah menset paper size saya dengan ukuran yang saya inginkan..



namun, jika ketika program dijalankan, saat hendak melakukan print, papersizenya kembali ke LETTER

jadi ketika selesai di print, ada bagian lembar kosong yang lebih..



printer default juga sudah saya set dengan ukuran yang saya inginkan...

kalau mau print dari word atau excel paper size sudah sesuai dengan yang saya inginkan..namun hanya dari crystal report saja yang papersizenya kembali ke Letter..



nih SS nya bos..




Spoiler for design:



















Spoiler for diprogram:




















ini codingan Print+savenya gan..




Code:

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim success As Boolean = False
Dim dt As DataTable = Me.SPdataset.Sells
Dim con As New SqlConnection(My.Settings.SPDBConnectionString)
Dim cmd As SqlCommand = con.CreateCommand
cmd.Connection = con
con.Open()
cmd.Transaction = con.BeginTransaction
Try
cmd.CommandText = "INSERT INTO tr_FakturPenjualan VALUES('" & txtNoFP.Text & "','" & Now.ToString() & "','" & txtNoSO.Text & "')"
cmd.ExecuteNonQuery()
For i As Integer = 0 To dt.Rows.Count - 1
Dim no_brg As String = dt.Rows(i)("KodeBarang")
Dim qty As String = dt.Rows(i)("Qty")
Dim harga As Integer = dt.Rows(i)("Harga")
cmd.CommandText = "UPDATE ms_Barang SET Stok = Stok -" & qty & ",Hargajual = " & harga & "WHERE KodeBarang ='" & no_brg & "'"
cmd.ExecuteNonQuery()
Next
cmd.Transaction.Commit()
MessageBox.Show("Save success", "Save Success", MessageBoxButtons.OK, MessageBoxIcon.Information)
success = True
Catch ex As Exception
cmd.Transaction.Rollback()
MessageBox.Show("Save failed", "Save failed", MessageBoxButtons.OK, MessageBoxIcon.Warning)
End Try
con.Close()
If success Then
Dim ds As New ReportDataSet
Dim ta As New ReportDataSetTableAdapters.view_ReportFJTableAdapt er
ta.Fill(ds.view_ReportFJ)
Dim dv As New DataView(ds.view_ReportFJ)
dv.RowFilter = "KodeFakturPenjualan ='" & txtNoFP.Text & "'"
Dim oRpt As New ReportDocument

Try
oRpt.Load("FJReport.rpt")
oRpt.SetDataSource(dv)
Dim f As New frmViewReport
f.CrystalReportViewer1.ReportSource = oRpt
f.Text = "Faktur Penjualan"
f.Show()
Catch ex As Exception
MessageBox.Show("File 'FJReport.rpt' not found." & Chr(10) & Chr(13) & "Please Contact your System Administrator for assitance.", "Report Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try


Dim dd As New ReportDataSet
Dim tt As New ReportDataSetTableAdapters.view_ReportFJTableAdapt er
tt.Fill(dd.view_ReportFJ)
Dim da As New DataView(ds.view_ReportFJ)
da.RowFilter = "KodeFakturPenjualan ='" & txtNoFP.Text & "'"
Dim oRpot As New ReportDocument
Try
oRpot.Load("SuratJalan.rpt")
oRpot.SetDataSource(da)
Dim f As New frmViewReport
f.CrystalReportViewer1.ReportSource = oRpot
f.Text = "Surat Jalan"
f.Show()
Catch ex As Exception
MessageBox.Show("File 'SuratJalan.rpt' not found." & Chr(10) & Chr(13) & "Please Contact your System Administrator for assitance.", "Report Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
txtNoFP.Text = generateNoFJ()
txtTanggal.Text = Now.ToString("d/M/yyyy")
btnReset.PerformClick()

End If
End Sub





ditunggu yah bos bantuannya..





thankss

</div>

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 12:36 PM.


no new posts