This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Imports CrystalDecisions.CrystalReports.Engine | |
| Imports CrystalDecisions.Shared | |
| Public Class ClassCetak | |
| Public Shared Sub _ConReport() | |
| Dim _ReportLogonInfos As New TableLogOnInfos | |
| Dim _ReportLogonInfo As New TableLogOnInfo | |
| Dim _ReportConInfo As New ConnectionInfo | |
| Dim _Tables As Tables | |
| Dim _Table As Table |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'Prosesnya adalah membandingkan string dari Object Textbox dengan Kolom di DataGridView | |
| 'Kalo datanya ketemu, akan di set sebagai Current Row | |
| Public Shared Sub _FindRow(ByVal _DataGridView As DataGridView, ByVal _String As String) | |
| Dim data As String | |
| For x = 0 To _DataGridView.Rows.Count - 1 | |
| data = _DataGridView.Rows(x).Cells(1).Value | |
| Try | |
| If UCase(data.Substring(0, _STring.Length)) = UCase(_STring) Then | |
| _DataGridView.CurrentCell = _DataGridView.Rows(x).Cells(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Public Shared Sub _ExporttoExcel(ByVal _DataGridView As DataGridView, ByVal _Form As Form) | |
| Dim Excel As New IO.StreamWriter(Application.StartupPath & "\Export.xls", False) | |
| Dim _Tmp As String = _Form.Text | |
| Dim _totalRow As Integer = 0 | |
| Excel.WriteLine("<?xml version=""1.0""?>") | |
| Excel.WriteLine("<?mso-application progid=""Excel.Sheet""?>") | |
| Excel.WriteLine("<ss:Workbook xmlns:ss=""urn:schemas-microsoft-com:office:spreadsheet"">") | |
| Excel.WriteLine(" <ss:Styles>") | |
| Excel.WriteLine(" <ss:Style ss:ID=""1"">") | |
| Excel.WriteLine(" <ss:Font ss:Bold=""0""/>") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Public Shared Sub _ExporttoExcel1(ByVal _DataGrid As DataGridView, ByVal _form As Form) | |
| If _DataGrid.Rows.Count > 0 Then | |
| Dim _str As String = _form.Text | |
| Dim _totalExport As Integer = _DataGrid.Rows.Count | |
| Dim _dset As New DataSet | |
| _dset.Tables.Add() | |
| For i = 0 To _DataGrid.ColumnCount - 1 | |
| _dset.Tables(0).Columns.Add(_DataGrid.Columns(i).HeaderText) | |
| Next i | |
| 'tambahkan row |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Public Shared Sub _HurufBesar(ByVal root As Control) | |
| Dim _Obj As New ArrayList | |
| _Obj.Add(root) | |
| Do Until (_Obj.Count = 0) | |
| Dim Cur As Control = _Obj(0) | |
| _Obj.RemoveAt(0) | |
| For Each _Obj2 As Control In Cur.Controls | |
| _Obj.Add(_Obj2) | |
| Next | |
| Dim _Btn As TextBox = TryCast(Cur, TextBox) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Public Shared Function _TextAngka(ByVal kode As String, Optional ByVal spasi As Boolean = False) As Boolean | |
| 'ex to use : e.Handled = EtcClass._TextAngka(Asc(e.KeyChar)) | |
| Select Case kode | |
| Case 40 To 57 | |
| Return False | |
| Case 8 | |
| Return False | |
| Case 32 | |
| If spasi Then | |
| Return False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Private Sub _TampilData(ByVal _SQLQuery As String) | |
| Try | |
| Dim sConn As String = "Provider=VFPOLEDB.1;Data Source=" & tPath.Text & ";Password='';Collating Sequence=MACHINE" | |
| Dim oConn As OleDbConnection = New OleDbConnection(sConn) | |
| Dim oCmd As OleDbCommand = New OleDbCommand(_SQLQuery, oConn) | |
| Dim oDa As New OleDbDataAdapter(oCmd) | |
| Dim oDS As New DataSet | |
| oDa.Fill(oDS) | |
| DataGrid1.DataSource = oDS.Tables(0) | |
| Label1.Text = oDS.Tables(0).Rows.Count & " Record ditemukan" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Private Sub Tombol() Handles Button1.Click | |
| Dim sPath As String | |
| OD.Filter = "DBF File (*.DBF)|*.Dbf" | |
| If OD.ShowDialog = Windows.Forms.DialogResult.OK Then | |
| sPath = OD.FileName 'get the path | |
| sPath = StrReverse(sPath) 'reverse the string | |
| sPath = Mid(sPath, InStr(sPath, "\"), Len(sPath)) 'extract from the first slash | |
| sPath = StrReverse(sPath) 'reverse it again | |
| tPath.Text = sPath | |
| End If |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click | |
| If Len(Trim(tPath.Text)) > 0 Then | |
| Dim _FileSize As String = "" | |
| Dim _Dir As New IO.DirectoryInfo(tPath.Text) | |
| Dim AryFi As IO.FileInfo() = _Dir.GetFiles("*.DBF") | |
| Dim Fi As IO.FileInfo | |
| Dim _ListItem As ListViewItem | |
| LvTable.Items.Clear() | |
| Dim i As Integer = 0 | |
| For Each Fi In AryFi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Public Shared Function _Excel2003(ByVal DataImport As DataGridView, ByVal _Path As String) As Double | |
| Dim _Conn As System.Data.OleDb.OleDbConnection | |
| Dim _dataSet As System.Data.DataSet | |
| Dim _dataAdapter As System.Data.OleDb.OleDbDataAdapter | |
| Dim _RowCount As Integer = 0 | |
| Dim _ColCount As Integer = 0 | |
| Dim _ItemCOunt As Long | |
| Dim _FieldCount As Integer | |
| Try | |
| _Conn = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='" + Trim(_Path) + "';Extended Properties=Excel 8.0;") |
OlderNewer