|
|
what an ashame...
I think, i know whats wrong with my vb project... its not on the code but the versioning of active x component
CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index"
i've found out that my crystal report viewer in my printing form is version 11.5.0.0 (AxInterop.CrystalActiveXReportViewerLib11_5.dll) and i've import or add it from the project components from a specific folder of my project which i downloaded from the intenet before..
which has the functionalities of CRAXDRT.REPORT.SQLQUERYSTRING and CRAXDRT.REPORT.RECORDSELECTIONFORMULA
and my installed crystal report developer XI R2 is using crystal report viewer 11.5.3700.0 which has only the functionality of CRAXDRT.REPORT.SELECTIONFORMULA
so it means my project will use or refer to crystal report library of version 11.5.3700.0, because that is the only crystal report installed in my pc...
that's why whenever i've sqlquerystring it gives the error
CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index"
because this can not find the functionality of SQLQueryString from CRAXDRT.Report v11.5.3700.0
but the there's something makes me puzzle? why does SQLQueryString from crystalreportviewer v11.5.3700.0 is missing? it is much higher version and must supposed to be stay there?
this is crystalreportviewer11.5.3700.0 and it works using CRViewer11_5_37.selectionformula but when i type CRViewer11_5_37.SQLQueryString? there is no such .SQLQueryString and i can only find it at xraxdrt.report.SQLQueryString?
******************
<br />
Imports CrystalDecisions.CrystalReports.Engine<br />
Imports CrystalDecisions.Shared<br />
<br />
Public Class frmCrystalReport<br />
<br />
Public strSelectionfrm As String<br />
<br />
Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo)<br />
Try<br />
Dim myTableLogOnInfos As TableLogOnInfos = Me.AxCRViewer1.LogOnInfo<br />
For Each myTableLogOnInfo As TableLogOnInfo In myTableLogOnInfos<br />
myTableLogOnInfo.ConnectionInfo = myConnectionInfo<br />
Next<br />
Catch ex As Exception<br />
MsgBox(ex.ToString())<br />
End Try<br />
End Sub<br />
<br />
Private Sub ConfigureCrystalReports()<br />
Try<br />
Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()<br />
myConnectionInfo.DatabaseName = DataSource<br />
myConnectionInfo.UserID = "admin"<br />
myConnectionInfo.Password = "xxxxx"<br />
myConnectionInfo.ServerName = "xxx.mdb"<br />
<br />
'Your filter formula comes here<br />
CRViewer11_5_37.SelectionFormula = strSelectionfrm <br />
<br />
'Your the complete path and filename of your .rpt<br />
CRViewer11_5_37.ReportSource = strCReportSource<br />
<br />
' Or like this <br />
CRViewer11_5_37.ReportSource = "D:\folder1\report.rpt"<br />
<br />
SetDBLogonForReport(myConnectionInfo)<br />
CRViewer11_5_37.Show()<br />
<br />
Catch ex As Exception<br />
MsgBox(ex.ToString())<br />
End Try<br />
End Sub<br />
<br />
Private Sub frmCrystalReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
Me.MdiParent = frmMain<br />
ConfigureCrystalReports()<br />
End Sub<br />
<br />
End Class<br />
********************
this is crystalreportviewer11.5.3700.0 and it works using crxReport.RecordSelectionFormula but when i use crxReport.SQLQueryString it gives me the error "Database connector error"
************************
<br />
Public crxApp As CRAXDRT.Application<br />
Public crxReport As CRAXDRT.Report<br />
Public crxDataBase As CRAXDRT.Database<br />
Public crxTable As CRAXDRT.DatabaseTable<br />
Public crxTables As CRAXDRT.DatabaseTables<br />
<br />
Public strSelectionfrm As String<br />
Public strCReportSource As String<br />
<br />
Private Sub frmCrystalReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
Try<br />
<br />
crxApp = New CRAXDRT.Application<br />
<br />
crxReport = crxApp.OpenReport(strCRSource, 1)<br />
<br />
For Each crxTable In crxReport.Database.Tables<br />
crxTable.Location = DataSource 'My .mdb source path<br />
crxTable.SetLogOnInfo("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & crxDataBasePath, "xxxx.mdb", "admin", "xxxxxx")<br />
<br />
'crxReport.SQLQueryString = sqlQueryString<br />
<br />
crxReport.RecordSelectionFormula = strSelectionFormula<br />
<br />
AxCRViewer11_5_0.ReportSource = crxReport<br />
AxCRViewer11_5_0.ViewReport()<br />
<br />
crxDataBase = Nothing<br />
crxTable = Nothing<br />
crxTables = Nothing<br />
crxReport = Nothing<br />
crxApp = Nothing<br />
<br />
Catch ex As Exception<br />
MsgBox(ex.ToString())<br />
End Try<br />
End Sub<br />
************
and this one is im trying to figure it out..
"RAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index"
something this doesn't compatible with versioning of crystal report viewer? correct me if im wrong.. im just observing... note.. im just a biginner like others.. ehehe
<br />
crxConnectionProperty <br />
********
<br />
Private Sub frmCrystalReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
Try<br />
ChildFormAutoSizeFit(Me)<br />
Me.Cursor = Cursors.WaitCursor<br />
Me.MdiParent = frmMain<br />
<br />
crxApp = New CRAXDRT.Application<br />
<br />
crxReport = crxApp.OpenReport(strCRSourcePath, 1)<br />
<br />
For Each crxTable In crxReport.Database.Tables<br />
<br />
crxConnectionProperty = crxTable.ConnectionProperties("Data Source")<br />
crxConnectionProperty.Value = "T:\System\Employee\Database"<br />
<br />
crxConnectionProperty.Value = "T:\System\Employee\Database"<br />
crxConnectionProperty = crxTable.ConnectionProperties.Item("Initial Catalog")<br />
crxConnectionProperty.Value = "mydatabase.mdb"<br />
crxConnectionProperty = crxTable.ConnectionProperties.Item("User ID")<br />
<br />
crxConnectionProperty.Value = "admin"<br />
crxConnectionProperty = crxTable.ConnectionProperties.Item("Password")<br />
crxConnectionProperty.Value = "xxxxx"<br />
<br />
Next crxTable<br />
<br />
crxReport.Database.Verify()<br />
<br />
<br />
crxReport.SQLQueryString = strSelectionfrm<br />
<br />
AxCRViewer11_5_0.ReportSource = crxReport<br />
AxCRViewer11_5_0.ViewReport()<br />
<br />
Catch ex As Exception<br />
MsgBox(ex.ToString())<br />
Finally<br />
Me.Cursor = Cursors.Default<br />
crxDataBase = Nothing<br />
crxTable = Nothing<br />
crxTables = Nothing<br />
crxReport = Nothing<br />
crxApp = Nothing<br />
End Try<br />
End Sub<br />
modified on Friday, April 18, 2008 1:03 AM
|
|
|
|
|
How to extract OLE Object from MS-Access Table using visual basic 6 ?
if you have any sample please refer.
also tell me is it possible to identify the OLE Object types (such as word,excel etc...)
|
|
|
|
|
This[^] is about the best anyone can do for you. It's going to take quite a bit of research to find the answer to this problem.
|
|
|
|
|
Hi Everyone -
I created an application that I've sent out to some friends which I thought was pretty flawless... apparently not. Two of the people were using the application for I would say about a week and no problems... then they got the message "Exception has been thrown by the target of an invocation".
I have it pinned down to the Timer that is causing the issue, because the error would pop-up every 30 seconds, and the timers interval is set to 30k ms, so I know that much. Under certain conditions the timer will open up a new instance of a form - which I'm guessing is where the exception is being thrown.
I haven't been able to come across this problem when I'm personally using the application in debug mode, so I don't know what to do.
Also, I was convinced this was a data driven issue, so I asked my friend to send me a copy of the database the application uses, hoping I could replicate the issue for myself - no such luck.
Any advice?
Thanks,
Tommy
|
|
|
|
|
You may receive this exception when you use the Invoke() method (of a form perhaps). The cause of this exception is another exception which occurred inside the method being invoked.
Since you don't know what actually went wrong inside the method that was being invoked, we will need to get the inner exception of the method.
To catch the exception, enclose the line within a try/catch block and get the InnerException.
Sometimes the error might also pop up when the solution file CPU references become corrupt. To check for it, try the following steps:
1: Open the .sln file in notepad
2: Change All References to"AnyCPU" (note the missing space) to "Any CPU"
3: Save
4: Open the solution again.
Regards,
Dave
Dave Traister
Software Engineer
ComponentOne LLC
www.ComponentOne.com
|
|
|
|
|
Probable cause may be that your secondary thread (from the time) is attempting to interact with the UI (open a form) this is not recommended. There are various articles in CP discussing these issues.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Can you point me to one of the articles? No luck finding one.
|
|
|
|
|
I'm developing a multi-lingual application and ultimately want to use satellite assemblies. The application differentiates between the different *.resx files (using a hub/spoke model) swimmingly but upon converting them to a *.dll I'm overcome with errors. The errors appear are the result of excluding the *.resx files and including the *.dlls in the application. Can anyone help me see the error in my ways? Thanks!
Code forth and prosper...
kIT
|
|
|
|
|
You may want to read this[^] section on Globalization and Localization and how the .NET Framework handles it. It sounds like you're trying to implement your own version of it.
|
|
|
|
|
hi
how can i now in the code wich tab is active
what is the function that tell me
i try focus but it do not give me good result
If TabPage1.Focus() Then
i hope you can help
|
|
|
|
|
Hello,
You can use the 'SelectedTab' or 'SelectedIndex' property for the Tab control to determine the
currently selected tab. You can use either of them. Only difference is that the SelectedIndex
will return the index of the tab page (0 being the starting tab). SelectedTab returns the page.
So you can use me.TabControl1.SelectedTab.Name.
So you can try something like this:
<br />
If Me.TabControl1.SelectedIndex = 0 Then<br />
MsgBox("Page1")<br />
Else<br />
MsgBox("Page2")<br />
End If<br />
I hope this will help.
Regards,
Allen
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
thanks it work
|
|
|
|
|
Can someone tell me what I am doing wrong? I am new to VB and am totally lost.
I have created a listbox with a add and multiply button. I have been able to get the add button to add more then 2 numbers but not the multiply button. How do I get the multiply button to multiply 2 or more numbers?
Public Class ArithmeticCalculatorForm
' handles Enter Button Click events
Private Sub enterButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles enterButton.Click
'clears previous results
If resultLabel.Text <> "" Then
resultLabel.Text = ""
operandsListBox.Items.Clear()
End If
'display results in ListBox
operandsListBox.Items.Add(Val(inputTextBox.Text))
inputTextBox.Clear() 'clears results from TextBox
inputTextBox.Focus() 'transfers focus to TextBox
'clears previous results and listbox to enable new entries
If operandsListBox.Items.Count < 2 Then
addButton.Enabled = False
multiplyButton.Enabled = False
End If
If operandsListBox.Items.Count >= 2 Then
addButton.Enabled = True
multiplyButton.Enabled = True
End If
End Sub
Private Sub addButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addButton.Click
Dim total As Integer = 0
Dim operand As Integer = 0
Dim operandCounter As Integer = 0
Dim results As Double = 0
'sums operands in operandsBox
Do
results = operandsListBox.Items.Item(operandCounter)
total += results
operandCounter += 1
Loop While operandCounter < operandsListBox.Items.Count
results = total
resultLabel.Text = String.Format("{0:G}", results)
addButton.Enabled = True
inputTextBox.Focus()
End Sub
Private Sub multiplyButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles multiplyButton.Click
Dim total As Integer = 0
Dim operand As Integer = 0
Dim operandCounter As Integer = 1
Dim results As Double = 1
'multiplies operands in operandsBox
Do
results = operandsListBox.Items.Item(operandCounter)
total =* results
operandCounter += 1
Loop While operandCounter < operandsListBox.Items.Count
results = total
resultLabel.Text = String.Format("{0:G}", results)
multiplyButton.Enabled = True
inputTextBox.Focus()
End Sub
End Class ' ArithmeticCalculatorForm
|
|
|
|
|
Is this not a simple mathmatical problem?
You initialise TOTAL to be zero.
Any number * zero will be zero.
Perhaps you should initialise total to be 1 in the multiply routine:
dim total as Integer=1
This should then give a better answer
|
|
|
|
|
Using a Microsoft Access Database, I have an employee table where the social security number is declared as a text field of 9 characters. I have connected the dataset to my VB applicaiton using the dataset wizard.
I have created a form where I am using the MaskedTextBox to display the social security number with the dashes. The problem is that when I try to save the record an error is thrown saying, "Cannot set column 'SS_NO'. The value violates the MaxLength limit of this column."
Do I need to change the size of the social security number in the database to include the dashes ? Will the dashes be stored ?
Have I not bound the control to the dataset correctly ? I dragged the MaskedTextBox onto the form and set the databindings/text field to my employee table.
I'm still new at this. Thanks.
|
|
|
|
|
The problem with using the MaskedTextBox is that it's going to return a String WITH the dashes in it. If your database column is a number or a string with only 9 characters, it's not going to fit. You have to reformat or convert the value to an appropriate length before it goes to your DataTable.
|
|
|
|
|
I made my column wider in the MS-Access database and it seems to be working now.
|
|
|
|
|
I understand your idea that I would need to reformat (or convert) the data to an appropriate length before it goes to my DataTable, but I don't understand where I would perform such a task. Is it an event in the MaskedTextBox ? I'm having a similar problem while using a Combox where the data returned is violating the Emp.Dept field.
Thanks in advance.
|
|
|
|
|
I've written a data entry program for a PDA that is used in my company. The program uses the .NET CF 2.0. The program runs fine, the problem occurs if someone lets the battery die on the PDA. This causes the .NET CF 2.0 to be deleted out of the RAM and then the program can't run unless the .NET CF is reinstalled. What I'm trying to figure out is how to have the program, or another program, reinstall the CF. I've read that the program would have to be written in native code because the CF is not installed. Any idea on how to do this with VS2008 or any ideas on how to fix this problem would be greatly appreciated! Even better would be if someone could help me figure out how to install the .NET CF 2.0 into the ROM, though I couldn't find anything on this. Thanks in advanced.
|
|
|
|
|
Do a clean build of your PDA and perform a full backup onto SD card. If they let their PDA battery die, get them to charge it up and restore from backup. This is the strategy we are using.
-------------------------------------------
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Just bugger off and leave me alone!!
|
|
|
|
|
Thanks. I definitely give that a try.
|
|
|
|
|
I need load my FORM1 and open my FORM2
While my FORM1 is Working...FORM2 is always On TOP
When My FORM2 finish.....FORM2 is closed.
(Form1 fill a ListBox (100 lines is an example))
Somebody help me?
thanks.
my english is bad.
«« Mexico »»
|
|
|
|
|
Help you with what? You haven't explain what part of this you'r having a problem with. And, I don't see anywhere where threading would come into play.
|
|
|
|
|
With Thread-1 I want fill the ListBox and with Thread-2 open
other WinForm and check when Thread-1 finish the work......
I want that 2 Threads is executing in the same time....
Or give me example for use Threads, multithreading, in same time
|
|
|
|