Click here to Skip to main content
15,886,963 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" Pin
vbDigger'z16-Apr-08 21:56
vbDigger'z16-Apr-08 21:56 
GeneralRe: CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" Pin
Mycroft Holmes15-Apr-08 22:07
professionalMycroft Holmes15-Apr-08 22:07 
GeneralRe: CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" Pin
vbDigger'z15-Apr-08 22:19
vbDigger'z15-Apr-08 22:19 
GeneralRe: CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" Pin
ChandraRam15-Apr-08 23:56
ChandraRam15-Apr-08 23:56 
GeneralRe: CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" Pin
vbDigger'z16-Apr-08 14:21
vbDigger'z16-Apr-08 14:21 
GeneralRe: CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" Pin
ChandraRam16-Apr-08 19:52
ChandraRam16-Apr-08 19:52 
GeneralRe: CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" [modified] Pin
vbDigger'z16-Apr-08 21:53
vbDigger'z16-Apr-08 21:53 
GeneralI think so i know whats wrong with my vb project... its not on the code but the versioning of active x component [modified] Pin
vbDigger'z17-Apr-08 18:04
vbDigger'z17-Apr-08 18:04 
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=" &amp; 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

Questionextract OLE Object from MS-Access Table using vb6 Pin
ERLN15-Apr-08 18:05
ERLN15-Apr-08 18:05 
GeneralRe: extract OLE Object from MS-Access Table using vb6 Pin
Dave Kreskowiak16-Apr-08 3:23
mveDave Kreskowiak16-Apr-08 3:23 
GeneralException has been thrown by the target of an invocation Pin
tom8315-Apr-08 17:56
tom8315-Apr-08 17:56 
GeneralRe: Exception has been thrown by the target of an invocation Pin
Arjun Marwaha15-Apr-08 20:50
Arjun Marwaha15-Apr-08 20:50 
GeneralRe: Exception has been thrown by the target of an invocation Pin
Mycroft Holmes15-Apr-08 22:11
professionalMycroft Holmes15-Apr-08 22:11 
GeneralRe: Exception has been thrown by the target of an invocation Pin
tom8316-Apr-08 3:01
tom8316-Apr-08 3:01 
QuestionSatellite Assemblies... Pin
kaizenIT15-Apr-08 10:15
kaizenIT15-Apr-08 10:15 
GeneralRe: Satellite Assemblies... Pin
Dave Kreskowiak16-Apr-08 3:16
mveDave Kreskowiak16-Apr-08 3:16 
Generaltabs in form Pin
asha_s15-Apr-08 9:23
asha_s15-Apr-08 9:23 
GeneralRe: tabs in form Pin
C1AllenS15-Apr-08 10:39
C1AllenS15-Apr-08 10:39 
GeneralRe: tabs in form Pin
asha_s16-Apr-08 1:27
asha_s16-Apr-08 1:27 
GeneralMultiplying Numbers in Listbox Pin
msapril15-Apr-08 9:05
msapril15-Apr-08 9:05 
GeneralRe: Multiplying Numbers in Listbox Pin
Chinners15-Apr-08 23:59
Chinners15-Apr-08 23:59 
QuestionVB 2005 MaskedTextBox bound to MS-Access table Pin
David Mujica15-Apr-08 8:48
David Mujica15-Apr-08 8:48 
GeneralRe: VB 2005 MaskedTextBox bound to MS-Access table Pin
Dave Kreskowiak15-Apr-08 16:09
mveDave Kreskowiak15-Apr-08 16:09 
GeneralRe: working now, thanks Pin
David Mujica17-Apr-08 10:52
David Mujica17-Apr-08 10:52 
QuestionFollowup - How to intercept data between MaskedTextBox and datagrid Pin
David Mujica17-Apr-08 10:57
David Mujica17-Apr-08 10:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.