|
Hello,
I'd like to be able to create a crystal report containing strings that are contained within textboxes and labels on a from, using the click event of a button.
Is this easily done?
Thanks
|
|
|
|
|
I am having difficulty. I tried to figure how to describe it in one sentence, but couldn't.
We have a supplier who supplies what they call a PC Developer Kit. In VB6.0, it allows you to add a project reference (it is linked to an .exe). This would give you access to several data types that you can use to get information from their equipment via an Ethernet connection. I'm using the following statement in VB6.0:
Dim Robot1 as Robot<br />
Dim ioDIN as ioType<br />
<br />
Set Robot1 = New Robot<br />
Set ioDIN = Robot1.IOTypes(DigInType).Signals.Item(Index:=0)
I'm trying to figure out 1) if it possible to use this in .NET, and 2) if so, how.
I've tried (VB.NET code):
Dim Robot1 as Robot<br />
Dim ioDIN as ioType<br />
<br />
Robot1 = New Robot<br />
ioDIN = Robot1.IOTypes(DigInType).Signals.Item(0)
I get an unhandled COM exception with "Illegal port number" and it is pointing to the 0.
Then I tried (VB.NET code):
Dim Robot1 as Robot<br />
Dim ioDIN as ioType<br />
<br />
Robot1 = New Robot<br />
ioDIN = Robot1.IOTypes(DigInType).Signals.Item(1)
I get the error: Unable to cast COM object of type 'System.__ComObject' to interface type 'Robot.IOType'. Now it is pointing to the 1.
What is going on when you reference an .exe? How does it give you access to new data types? I'm not sure what the (Index:=0) is exactly doing in the VB6.0 code and why it needs to be that way. I did find out that I can make it work the same by changing it to (1). Is there a way to convert the code to something that would work in VB.NET?
Any help with any part of this is appreciated.
Brad
The secret to creativity is knowing how to hide your sources. - Albert Einstein
|
|
|
|
|
What you're doing is right, in terms of accessing the COM objects. The issue lies elsewhere ( the threading model, perhaps ? )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello Folks,
I would like to open an excel and app with visual studio 2005 without using COM. It seems like I should be able do this with the Microsoft.Office.Tools.Excel.
It seems like I should be able to open an excel application like I could with Microsoft Excel 11.0 Object Library. I don't want to use the Microsot Excel Oject Libaray because when I try to use it with Microsoft.Office.Tools classes I get a lot if InvalidCastExceptions like when I try to set a Microsoft.Office.Tools.Excel.Workbook = to an Excel.Workbook.
Is there a Microsoft.Office.Tools.Excel.Workbook method equivalent to Excel.Worbooks.open("c:/myxl.xls")?
It seems strange that we have save and save as in Microsoft.office.Tools.excel.workbook but no open.
Also, I cannot seem to add a reference to microsoft.interop.office how can I add a refrence to this if I need to.
Please help. This is driving me nuts.
|
|
|
|
|
|
Search the arcticles for a Winsock clone written in VB.NET, author Chris Kolkman.
|
|
|
|
|
Hi,
I'm using VB.NET 2005, and would like to color a cell on a DataGridView if an exception has been invoked. I have the following code snippet:
' ############ GET THE NEW 'FROM' DATE ############<br />
<br />
Try<br />
tblRow.Item("From") = Convert.ToDateTime(strNewFromDate)<br />
<br />
Catch ex As Exception<br />
<br />
' Problem with this date field, so leave blank<br />
<br />
' Add 1 to the number of warnings count<br />
intNumberOfWarnings += 1<br />
<br />
' Colour the cell in error<br />
<br />
End Try
Is there a clever bit of code I need to use that will allow me to color this particular cell?
|
|
|
|
|
suppose in combo box i have given 3 feilds .....
and i can validate them accordin to codition...
but i want to also validate when i have selected nthin..
lets take an example...
if in box i selected "A"
then its assigning temp = 10
and nw again if m selectin nthin i.e is blank, then it shud store temp = 0;
can v do combobox1.selected= " "
then temp = 0.
m gettin error...
please tell the exact manner of coding...
|
|
|
|
|
Can you make an effort to explain more clearly your problem?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
look if v have 3 options in combobox say A, B, C
if i select A then in temp variable 10 shud be assigned..
like
if combobox1.selected = "A"
then temp = 10
if combobox1.selected = "B" then
temp = 8
nw if i select nthing means combobox is empty
then temp = 0
tell me its coding..
thanks
|
|
|
|
|
if you're using VB6, try the following:
Select Case cmbLetters.Text
Case "A"
lTemp = 10
Case "b"
lTemp = 8
Case Else
lTemp = 0
End Select
(where cmbLetters is you ComboBox)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Sir/Madam,
I have two records in my database.From the form , I am chosing the id and want that record to get displayed in the crystal report.There are two tables in the database and there is a primary and foreign key relationship between them.Now the problem is , both the records are comming.I have created links between both tables in the reports.Is there any way to create the crystal report dynalically or can i pass the parameter to show the report.
Parameter means that id which has primary and foreign key relationship.
But I don't know the code how to pass the parameters.
and parameters should be passed at both ends (I mean in the crystal reports as well as on the coding side)??
I don't want to generate the window that ask me which id u want to select .
Please help.
Thanks and regards
Pankaj
|
|
|
|
|
Sir/Madam,
I wanted to know in which condition I should write the following line of code.I mean what is the utility of that.
application.Run(new formname)
Thanks and regards
Pankaj
|
|
|
|
|
amaneet wrote: I wanted to know in which condition I should write the following line of code.I mean what is the utility of that.
It runs you windows forms based application. If you don't write that no form will appear.
|
|
|
|
|
Sir/Madam,
I wanted to know the basic difference between implicit and explicit conversion.
Thnaks and regards
Pankaj
|
|
|
|
|
Link :Data Type Conversion[^]
In Visual Basic, data can be converted in two ways: implicitly, which means the conversion is performed automatically, and explicitly, which means you must perform the conversion.
|
|
|
|
|
wht i want to do is
on first click --text in label change
on second click again text change?
how to do this
|
|
|
|
|
You have to do a two states button, either using the text itself to identify the current state or by means of an auxiliary variable.
For instance:
(1) If myButton.Text="ON" Then myButton.Text="OFF" Else myButton.Text="ON"
(2) IF bIsON = True Then
bIsON = False
myButton.Text="OFF"
Else
bIsON = True
myButton.Text="ON"
End If
where,of course, bIsOn must be a variable of the Form (or a Static one inside the event handler).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
You don't add the event twice. You haven't given enough detail about the problem to describe an accurate solution. Where is this text comming from? How is it stored? Change the text to what?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have been given a project which was developed by someone who has just left our company and is not contactable.
He developed the project and put it live but didn't save a development copy. The live version doesn't contain the .vb files
and just everything is saved and compiled as .dll.
Does anyone know how I could open the .dll filesd to see the .VB code??
macca
|
|
|
|
|
|
i want to create dynamic crystal report,
in which columns will be chosen at runtime
|
|
|
|
|
Iam having a table containing 7 columns which already have information. But I want to display a single field data/information present in the field into a grid
How to set this using Dataset?
Priya
|
|
|
|
|
Add a table to the dataset then in columns tab in this table add the number of columns u want. then in the grid put the datasource = the dataset and dataMember the table u have just created.
good luck
|
|
|
|
|
If iam giving like this means I will get all the columns to the datagrid.but I want only one or two columns then how to code that
Priya
|
|
|
|