Question sir,
I'm creating a report using crystal report in vs 2012 and I have this problem. The data in my reports are duplicating while the concatenated field is now showing? I don't know where the problem. Please help.
Dim rpt As New Active_Assets
Dim con As New MySqlConnection
Dim cmd As New MySqlCommand
Dim da As New MySqlDataAdapter
Dim ds As New DataSet("DataSet1")
Try
con = New MySqlConnection("server=localhost;userid=root;password=123456;database=asset_db")
cmd.Connection = con
cmd.CommandText = "SELECT asset_info.asset_code, booking_date, asset_name, asset_amount, asset_info.department_code, asset_info.group_code,asset_info.supplier_code, employee_code, business_unit_code,supplier_name,group_name, concat(min(months_left), ' MONTHS') FROM asset_info join tbl_account_group on asset_info.group_code = tbl_account_group.group_code join tbl_department on asset_info.department_code = tbl_department.department_code join tbl_supplier on asset_info.supplier_code = tbl_supplier.supplier_code join tbl_depreciation on asset_info.asset_code = tbl_depreciation.asset_code where asset_status = 'ACTIVE' group by asset_info.asset_code order by asset_number "
con.Open()
cmd.CommandType = CommandType.Text
da.SelectCommand = cmd
da.Fill(ds, "asset_info")
da.Fill(ds, "tbl_employee")
da.Fill(ds, "tbl_supplier")
da.Fill(ds, "tbl_department")
da.Fill(ds, "tbl_accout_group")
da.Fill(ds, "tbl_depreciation")
rpt.SetDatabaseLogon("root", "123456")
rpt.Database.Tables(0).SetDataSource(ds)
CrystalReportViewer1.ReportSource = rpt
con.Close()
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
con.Dispose()
End Try