I have a form that can show the result of my student.
The problems are:
1. I want to print the result by pressing "Oke" button and input it into Nama, NIM, Tugas, Ulangan, UTS, UAS, hasil and skor to Microsoft Word template that I've created.
This is the docx template: this is the docx template :
Docx Template[
^]
2. I don't know how the code is and how to do that.
Please help me.
What I have tried:
This is the program's look:
The Program[
^]
The VB.NET Code is :
Public Class Form2
Private Sub PenilaianBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
Me.Validate()
Me.PenilaianBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.MahasiswaDataSet)
End Sub
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.PenilaianTableAdapter.Fill(Me.MahasiswaDataSet.penilaian)
NimTextBox.Text = ""
NamaLabel1.Text = ""
NimLabel1.Text = ""
TugasLabel1.Text = ""
UlanganLabel1.Text = ""
UtsLabel1.Text = ""
UasLabel1.Text = ""
HasilLabel1.Text = ""
SkorLabel1.Text = ""
End Sub
Private Sub btnoke_Click(sender As Object, e As EventArgs) Handles btnoke.Click
Try
Dim dt = PenilaianTableAdapter.GetDataBycaridata(NimTextBox.Text)
If dt.Rows.Count <> 0 Then
NamaLabel1.Text = dt.Rows(0).Item(1)
NimLabel1.Text = dt.Rows(0).Item(2)
TugasLabel1.Text = dt.Rows(0).Item(3)
UlanganLabel1.Text = dt.Rows(0).Item(4)
UtsLabel1.Text = dt.Rows(0).Item(5)
UasLabel1.Text = dt.Rows(0).Item(6)
HasilLabel1.Text = dt.Rows(0).Item(7)
SkorLabel1.Text = dt.Rows(0).Item(8)
Else
MsgBox("NIM Yang Anda Input Salah Atau Data Anda Belum Diinput. Silahkan Coba Lagi", MsgBoxStyle.Critical, "Info")
NimTextBox.Text = ""
NamaLabel1.Text = ""
NimLabel1.Text = ""
TugasLabel1.Text = ""
UlanganLabel1.Text = ""
UtsLabel1.Text = ""
UasLabel1.Text = ""
HasilLabel1.Text = ""
SkorLabel1.Text = ""
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Me.Hide()
Form3.Show()
End Sub
End Class