|
If I understand what you want, no, it can't. The DataGridView does not offer an kind of TreeView support.
You might want to try a better explaination of what you're looking for so we can possibly suggest something that might work for you.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hai VB'ers...
I have 2 problem :
1. How to send varibles from VB to Software NERO Burning Room? (variables like : the speed of burn, source file that we wanna burn, etc)
2. How to launch/call software (like: nero) from VB with VB codes?
Thxs b4...
Best Regrads,
Harry
|
|
|
|
|
harry_tan wrote: 1. How to send varibles from VB to Software NERO Burning Room? (variables like : the speed of burn, source file that we wanna burn, etc)
I stand under correction, but I doubt that this possible unless Ahead software have supplied COM/.NET visible libraries that expose methods developers may make use of, OR if you went through a HUGE mission of reverse engineering the bits that you need (which is more likely than not illegal).
What is it that you would like to do? There may be an alternative means.
harry_tan wrote: 2. How to launch/call software (like: nero) from VB with VB codes?
That one's easy -
System.Diagnostics.Process.Start("nero.exe")
|
|
|
|
|
Thxs's Kulazfuk...
I wanna make a program that can make a back up to CD media.
The flow of the logic of my program that i want is like this (I have 2 alternative logic) :
1.The program that i have been made send variables to Software CD Burning, after that the program launch/call that software with configuration that i have send it before.So, the user only to choose/click button "Burn" in that software and the process of burn it's begin.
2.The program that i have been made send variables to Software CD Burning, after that the program launch/call that software with configuration that i have send it before (this software CD Burning run like a background process) and automically execute the process of burn (so, the user don't need to choose/click button "Burn" in that software to begin the process of burn).
Do you have a conclusion/idea from the logic that i have been wrote?
Or do you have another logic that more logically, safe and legal?
I have tried the code that you have been told abot execute software from VB (System.diagnostics.process.start ("nero.exe")) but it can not work. It is error.
The VB showed :
Run-Time Error '424'
Object Required
I use VB 6.0
Why that error could show?And how to make that error can not show again?
Thxs b4...
Best Regrads,
Harry...
-- modified at 23:41 Thursday 26th October, 2006
|
|
|
|
|
You really can't control another application to do this. What you need is a library that offers CD burning support. I've never used any so I can't make any recommendations. Just Google for "CD Burning library" and you'll come up with plenty of them.
The code errored out because it was VB.NET code. It won't work in VB6.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thx's a lot for your comments Dave Kreskowiak and Kulazfuk...
If some one out there can help me about to launch/call another software from VB 6.0 codes?
Thxs b4...
Best Regrads,
Harry
|
|
|
|
|
Hi Harry,
Dave Kreskowiak is right, in VB6 that line of code will not work. I don't use VB6 so I can't suggest an alternative.
Sorry.
|
|
|
|
|
Ic...ic...
Thxs a lot for responses about my problems.
If someone out there can help me about how to call/launch another software with VB 6.0 codes?
Thxs b4...
Best Regrads,
Harry
|
|
|
|
|
I am trying to use Win32 API in Visual Basic 6.0 to get the text from a third party program that is using an Edit Control
Window within a #32770 DialogBox. But I am unable to find any SendMessage method to grab the content of the Edit window.
A DialogBox Class window acts as parent to a #32770 child. The #32770 child has an Edit child of its own. The entire dialog
is not a standard msgbox; instead, the dialog displays a list of financial data, with a horizontal scroll bar and no Windows
method to highlight and copy to clipboard.
I have the handles easily available to the dialog parent, #32770 child, and Edit child.
How do I use a Win32 API call (like SendMessage) to get the multi-line data found in this 32770-Edit dialog box?
The standard, methods for grabbing text, like wm_gettext, em_getline, etc. isn't working for me on the parent/#32770/edit
dialog.
Thanks for any direction.
|
|
|
|
|
artofsuntzu wrote: The standard, methods for grabbing text, like wm_gettext, em_getline, etc. isn't working for me on the parent/#32770/edit
WM_GETTEXT was about the only way you could get the contents of the control. It's not always possible to get the text from another application. Calling the API function GetWindowText sends a WM_GETTEXT message to the target window. If WM_GETTEXT fails, there's just about nothing you can do about it, short of implementing an OCR solution.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello,
I need you help with a crystal report problem. The report is very simple, and I have already done the layout. Howerver, I need to deploy. I am using crystal reports version 10.
I have found some information on the internet about using ODBC using the DNS. And using the code below to write the connection. However, I tried wroking the code but didn't work for me. Here is it anyway.
code (put in a separate module called modCrystal.vb - to keep things tidy): -
<br />
Option Explicit On<br />
Option Strict On<br />
<br />
Imports System<br />
Imports CrystalDecisions.CrystalReports.Engine<br />
<br />
Public Function LoadCrystalRPT(ByVal strReport As String) As ReportDocument<br />
Dim cryDoc As New ReportDocument<br />
<br />
With cryDoc<br />
.Load(strReport)<br />
.SetDatabaseLogon(USER_ID, PASSWORD)<br />
<br />
' This will override the table locations<br />
Dim cryTables As Tables = .Database.Tables<br />
Dim cryTable As Table = Nothing<br />
<br />
Dim cInfo As CrystalDecisions.Shared.ConnectionInfo = New CrystalDecisions.Shared.ConnectionInfo<br />
Dim lInfo As CrystalDecisions.Shared.TableLogOnInfo = New CrystalDecisions.Shared.TableLogOnInfo<br />
<br />
With cInfo<br />
.ServerName = ODBC_DSN_NAME<br />
.DatabaseName = DATABASE_NAME<br />
.UserID = USER_ID<br />
.Password = PASSWORD<br />
End With<br />
<br />
For Each cryTable In cryTables<br />
With cryTable<br />
lInfo = .LogOnInfo<br />
lInfo.ConnectionInfo = cInfo<br />
.ApplyLogOnInfo(lInfo)<br />
<br />
.Location = DATABASE & ".dbo." & cryTable.Location<br />
End With<br />
Next<br />
<br />
Return cryDoc<br />
End With<br />
End Function<br />
to use: -
cryReport.ReportSource = LoadCrystalRPT("C:\path\to\report.rpt")
where cryReport is the crystal reports viewer component.
==============
this code is for Crystal Reports v11, it may work with v10
but i can't guarantee it
==========================
I am not sure if the above method is the best, and the above is complicated for me to understand. Do you have any examples in using dataset or other methods? What is the industry method of doing this?
Thanks in advance,
Steve
|
|
|
|
|
What are you using as a datasource to populate the dataset? SQL Server? Is there any particular reason that you're using ODBC?
I have a sample on binding a crystal report to a dataset at runtime but I'm not sure if that's what you're after.
|
|
|
|
|
Hello,
Thanks for your reply. The reaaon I was using ODBC using the DNS to connect to a sql server 2005, as I thought it would be easy for the deployement.
However, if you have a sample that can be deployed, then I would be happy to use it.
Thanks,
Steve
|
|
|
|
|
I think you'll find that using SQL will be much easier on deployment, maintenance and performance. Also, AFAIK Microsoft have stopped support for ODBC.
Damned but it looks like I've deleted that sample I'm sure I had it on this machine but it's gone AWOL. Sorry. However I'm still determined to help you (if that helps any), so I'll summarize what it contained. It'll need modification to suit your needs but the basic idea is still there. This is the method I've used for countless Crystal Reports and it works every time.
Here goes -
• Create a connection to the database.
• Create data adapter objects (aka TableAdapters in .NET 2.0) to perform commands against the database (Select, Insert, Delete, Update, etc)
• Create a dataset to represent your data.
• Create the Crystal Report that is to bind to the dataset using the "Report Expert" wizard.
• When you want to run the report, call the fill method of the data adapter passing the dataset as an argument to the method. e.g.
Try
conn.Open() 'previously created connection
dsDataSet.Clear()
daAdapter.Fill(dsDataSet) '<- code for .NET 1.1
'daAdapter.Fill(dsDataSet.DataTable) '<- code for .NET 2.0
Catch ex as exception
Messagebox.Show(ex.Message)
Finally
conn.Close()
End Try
• Declare an instance of the report you created using the Report Expert outside of any subs (this way you can re-use it easily) e.g.
Private rptDataReport As rptReport
• When you want to view the report, create the new instance & set its SetDataSource property to the dataset e.g.
Private Sub LoadReport()
rptDataReport = New rptReport '<- new instance
rptDataReport.SetDataSource(dsDataSet)
End Sub
• Finally, load the report into the report viewer
CrystalReportViewer.ReportSource = rptDataReport
Hope that helps. If you get stuck, let me know.
|
|
|
|
|
Hello,
Thanks for all your responses. I have gone with typed dataset. However, I have a problem displaying the data in the report. I have created an typed dataset.xsd called DS_JobSheet.xsd. I have previewed the data and it displays everything. I have created the reports.
In the report I have select database expert | project Data | ADO.Net Dataset. I have select my dataset and selected the table.
I have dragged the fields on to the report. I think everything seems to be ok here.
The code for filling the report is below. I have added a grid to the report to see if that gets filled and it does. I just don't understand why my report does not show any data.
I have imported
CrystalDecisions.CrystalReports.Engine
CrystalDecisions.Shared
Can any correct if I have done something wrong.
Many thanks,
Steve
<br />
Private Sub frmJobSheet1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
Dim customerReport As New rptJobSheet1()<br />
Dim DS_JobSheet As DataSet 'DS_JobSheet is the .xsd data schema, data has been generated <br />
Dim IDNumber As Integer<br />
Dim cnn As New SqlConnection()<br />
Dim da As New SqlDataAdapter()<br />
Dim cmd As New SqlCommand()<br />
<br />
cnn.ConnectionString = "server=steve02\ssd02; database=serviceMaster; pwd=a123; user id=sa"<br />
<br />
cmd.CommandType = CommandType.Text<br />
cmd.CommandText = "SELECT * FROM Incident"<br />
DS_JobSheet = New DataSet<br />
<br />
Try<br />
cnn.Open()<br />
cmd.Connection = cnn<br />
<br />
da.SelectCommand = cmd<br />
da.Fill(DS_JobSheet)<br />
<br />
Catch ex As Exception<br />
MessageBox.Show(ex.Message)<br />
End Try<br />
<br />
IDNumber = 68 'Display record for ID number 68 this number exists in the database table<br />
<br />
customerReport.SetDataSource(DS_JobSheet)<br />
<br />
<br />
Me.CrystalReportViewer1.Refresh()<br />
Me.CrystalReportViewer1.SelectionFormula = "{Incident.IncidentID} = " & IDNumber & " "<br />
Me.CrystalReportViewer1.ReportSource = customerReport 'Application.StartupPath & "\JobSheetReport\rptJobSheet1.rpt"<br />
<br />
<br />
Me.UltraGrid1.DataSource = DS_JobSheet.Tables(0).DefaultView 'Data is displayed in the datagrid so this is ok<br />
Me.UltraGrid1.Refresh()<br />
<br />
Me.CrystalReportViewer1.Show()<br />
<br />
End Sub<br />
-- modified at 12:38 Thursday 26th October, 2006
|
|
|
|
|
Hi Steve,
I don't see anything wrong but you obviously have a problem if no data is showing up. If anywhere, think your problem lies in the report selection formula statement -
Me.CrystalReportViewer1.SelectionFormula = "{Incident.IncidentID} = " & IDNumber & " "
Have you tried filling the dataset and viewing all the data without filtering it by the variable IDNumber? Does data show up then?
Is it possible to take an alternative approach to viewing the data? If I'm reading your code correctly, I see that you're filling the dataset with all the records from the database and then displaying only one record from there using the IDNumber variable. Loading and displaying the report would be much faster if you filled the dataset only with the record that you need.
|
|
|
|
|
Hello,
Thanks for your response.
Still can't get it working. I have done the following.
customerReport.Database.Tables(0).SetDataSource(DS_JobSheet2)'doesn't work
and removed the following
'Me.CrystalReportViewer1.SelectionFormula = "{Incident.IncidentID} = " & IDNumber & " "
Datagrid is being populated, as it fills the grid.
I think it must have something to do from filling the dataset and passing that to the CR.
My friend tried a simpliar example, and he had the same problem.
What can it be?
Any help would be so grateful,
Steve
|
|
|
|
|
Hi Steve, check your mail
|
|
|
|
|
<br />
Dim CrystalReportViewer1 As CrystalDecisions.Windows.Forms.CrystalReportViewer = New CrystalDecisions.Windows.Forms.CrystalReportViewer<br />
Dim Report As CrystalDecisions.CrystalReports.Engine.ReportDocument = New CrystalDecisions.CrystalReports.Engine.ReportDocument<br />
CrystalReportViewer1.ActiveViewIndex = 0<br />
CrystalReportViewer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle<br />
CrystalReportViewer1.DisplayGroupTree = False<br />
CrystalReportViewer1.Dock = System.Windows.Forms.DockStyle.Fill<br />
CrystalReportViewer1.Location = New System.Drawing.Point(0, 0)<br />
CrystalReportViewer1.Name = "CrystalReportViewer1"<br />
<br />
Dim QueryString As String = "select * from TableName" 'Your Query here<br />
Dim Connection As New OleDbConnection(funcs.con) 'Your Database Connection Here<br />
Connection.Open()<br />
<br />
Dim Adapter As OleDbDataAdapter = New OleDbDataAdapter(querystring, connection)'Passing the query in the connection<br />
Dim DataSet As DataSet = New DataSet() 'DataSet<br />
Adapter.Fill(DataSet)<br />
Dim DataTable As DataTable = New DataTable 'DataTable<br />
DataTable = DataSet.Tables(0) 'filling the datatable here<br />
Report.Load(Application.StartupPath & "/ReportName.rpt") 'Report Name Here<br />
Report.SetDataSource(DataTable)<br />
CrystalReportViewer1.ReportSource = Report<br />
|
|
|
|
|
Hi,
I need to access a database on a remote computer using ado.net. I'm using Ms Sql server 2000, and my computer is not on the same domain as the remote computer, but I physically have access to this computer. Can somebody help me about the procedure to use ? I already accessed ms sql 2000 databases but it was on my computer, so the server was '(local)'. How do I do for a distant one ? Is there a way of using the remote computer IP adressm, or something else ?
Thanks for helping.
p.f. Goudjo-Ako
Bringing our energy together !
|
|
|
|
|
alter your current connection string to point to the remote SQL Server IE:
User id=YOURUSERNAME; password=YOURUSERsPASSWORD; Data Source=YOURREMOTESQLSERVER; Initial Catalog=YOURDATABASENAME;
Hope this is helpful.
|
|
|
|
|
User id=username; password=userpassword; Data Source=120.120.120.120; Initial Catalog=dbName;
Data Source=IP Address where your database is located.
i thing it is use full for you...!
Pavan Pareta
|
|
|
|
|
this statement wont work
imports microsoft.office.core.commandbar
which dll should i import??
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
Office.dll
---
b { font-weight: normal; }
|
|
|
|
|
i'm not getting microsoft.office.core.commandbar class in office.dll
i've got .commandbarclass there but .commandbar is not there.
again adding ref. to office causes me ambiguty with Microsoft.Office.Core in commanbar etc objects.
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|