0% found this document useful (0 votes)
63 views17 pages

مكتبة نور - انشاء تقارير كريستال ريبورت ، فيجوال بيسك 2012 PDF

This document contains code for an employee database application in Visual Basic. It includes code to load employee data from an Access database into a data grid, display selected record details in text boxes, and generate a Crystal Report from the data table. The code handles loading data, updating the user interface, and generating reports from the employee records stored in the Access database.

Uploaded by

Abdullah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views17 pages

مكتبة نور - انشاء تقارير كريستال ريبورت ، فيجوال بيسك 2012 PDF

This document contains code for an employee database application in Visual Basic. It includes code to load employee data from an Access database into a data grid, display selected record details in text boxes, and generate a Crystal Report from the data table. The code handles loading data, updating the user interface, and generating reports from the employee records stored in the Access database.

Uploaded by

Abdullah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Module

CrystalReportViewer1
CrystalReportViewer1
Crystal Report

Add Module ‫ اختار‬Project ‫من قائمة‬


Imports System.Data
Imports System.Data.OleDb

Module Module1
Dim constring As String = "provider=Microsoft.Jet.oledb.4.0; Data source=" & Application.StartupPath & "\pri.mdb"
Dim connect_microsoft As New OleDbConnection(constring)
Public Tb As New DataTable
Public Report As New CrystalReport1
Public Sub contable_loder()
Tb.Clear()
Dim comand_load As New OleDbCommand("select * from empl ", connect_microsoft)
connect_microsoft.Open()
Tb.Load(comand_load.ExecuteReader)
Form1.DataGridView1.DataSource = Tb
connect_microsoft.Close()
End Sub

Public Sub conview_loder()


Form1.TextBox1.Text = Form1.DataGridView1.CurrentRow.Cells(0).Value
Form1.TextBox2.Text = Form1.DataGridView1.CurrentRow.Cells(1).Value
Form1.TextBox3.Text = Form1.DataGridView1.CurrentRow.Cells(2).Value
Form1.TextBox4.Text = Form1.DataGridView1.CurrentRow.Cells(3).Value
Form1.TextBox5.Text = Form1.DataGridView1.CurrentRow.Cells(4).Value
Form1.TextBox6.Text = Form1.DataGridView1.CurrentRow.Cells(5).Value
Form1.TextBox7.Text = Form1.DataGridView1.CurrentRow.Cells(6).Value
End Sub
Public Sub butomreport()
Dim Report As New CrystalReport1
Report.SetDataSource(Tb)
Form2.CrystalReportViewer1.ReportSource = Report
Form2.CrystalReportViewer1.Zoom(100%)
Form2.CrystalReportViewer1.Refresh()
Form2.Show()
End Sub
Public Sub viewdata()
Form1.DataGridView1.Columns("code").HeaderText = "‫"القومي‬
Form1.DataGridView1.Columns("nameacount").HeaderText = "‫"المودع‬
Form1.DataGridView1.Columns("nameto").HeaderText = " ‫"حاملة‬
Form1.DataGridView1.Columns("bankname").HeaderText = "‫"البنك اسم‬
Form1.DataGridView1.Columns("numteket").HeaderText = " ‫"الحساب‬
Form1.DataGridView1.Columns("value").HeaderText = "‫"المبلغ‬
Form1.DataGridView1.Columns("note").HeaderText = "‫"المفقط المبلغ‬

Form1.DataGridView1.Columns(0).Width = 65
Form1.DataGridView1.Columns(1).Width = 150
Form1.DataGridView1.Columns(2).Width = 150
Form1.DataGridView1.Columns(3).Width = 100
Form1.DataGridView1.Columns(4).Width = 70
Form1.DataGridView1.Columns(5).Width = 70
Form1.DataGridView1.Columns(6).Width = 130
End Sub
End Module
Datagridview1
2
1
3 4
3
5
6
7

8
9
10

11
13
12

14
15
6 16
6
16
6
17
6
18
6
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="PR.My.MySettings.priConnectionString"
connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\bin\Debug\pri.mdb"
providerName="System.Data.OleDb" />
</connectionStrings>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version ="v4.0" sku =".NETFramework,Version=v4.0"/>
</startup>
</configuration>
Public Class Form1

Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click


contable_loder()
viewdata()
End Sub

Private Sub DataGridView1_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles


DataGridView1.CellContentClick
conview_loder()
End Sub

Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click


butomreport()
End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

End Sub
End Class

You might also like