|
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
|
|
|
|
|
|
hi guys
iam new to windows forms, iam a web developer.
Can i ask for a function that copies employees from one list box to another when pressing on a button.
where display memeber is empName and value =id
any help?
thanks
|
|
|
|
|
Are you wanting to move the entire list of names to the listbox or only selected names?
|
|
|
|
|
Actually i want to do both. I want to move only selected items first then to have an option like a check box or so to be able to move all. Thanks in advance.
|
|
|
|
|
Hi everybody !
I'm programming control interfaces using a PocketPC running under Windows Mobile 5, and I use VB.NET.
I'm trying for a while to create my own control component (actually it's should be a speedometer), but I'd like to NOT refresh all the control when I change the value it should displays
I explain myself :
I've got what I call a background : a line, an ellipse, a filled ellipse and a fille rectangle
I've got a needle (to display the speed) : an array of points connected by a polygon and a filled polygon
What I'd like to do is to refresh only the needle, not the background (because it blink because of the powerlessness and the speedlessness of the PocketPC)
I found on this site that I have to override the "OnCreateControl " sub, but it does'nt exist ! (so I can't override it)
Thank you for your help
Regards,
Ch'Portos.
Yop Yop !!
|
|
|
|