SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Oct 2008
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Error in the script

    Hi All,

    I want to read the data from ListView(view type as Report), for that i wrote a script. It compile successfully, i am getting runtime error at "Set oListView = CreateObject("MFCGridCtrl.ListView")".
    Please Help me how to solve that error. i am not able to find what is that error.

    Script:
    Function fGetListViewData (strRec as Variant, arrListData() as String) as String
    On Error Goto ErrHandler
    'Local variable declaration
    Dim Result as Integer
    Dim hWnd as Long
    Dim oListView as Object
    Dim oRowsColl as Object
    Dim oRow as Object
    Dim iRowCount as Integer
    Dim iColCount as Integer
    Dim iRowStartIndex as Integer
    Dim i as Integer
    Dim j as Integer
    'Get the Window Handle
    Result = SQAGetProperty(strRec,"hWnd", hWnd)
    <font color="red">
    Set oListView = CreateObject("MFCGridCtrl.ListView")
    </font>
    'Get the Column Count
    iColCount = oListView.GetColumnCount(hWnd)
    'Get the Row Count
    iRowCount =oListView.GetRowCount(hWnd)
    iRowStartIndex = 0
    'Inilitization of 2-D Array
    ReDim arrListData(iRowCount, iColCount)
    Set oRowsColl = oListView.GetRows(hWnd)
    For i = 1 to oRowsColl.Count + 1
    On Error Resume Next
    Set oRow = oRowsColl(i)
    For j = 1 to oRow.Count
    arrListData((i + iRowStartIndex), j) = oRow.Item(j)
    Next j
    Next i
    Set oRow = Nothing
    Set oRowsColl = Nothing
    Set oListView = Nothing
    fGetListViewData = "Pass"
    Exit Function
    'Handles if any unknown exception occurs
    ErrHandler:
    SQALogMessage sqaFail,"RunTime Error","Unexpected Error occured at line - " &amp; erl &amp; " and error code - " &amp; err
    fGetListViewData= "Fail"
    End Function

  2. #2
    Member
    Join Date
    Nov 2004
    Location
    Trivandrum
    Posts
    196
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Error in the script

    Are you sure you are using the correct ProgId? I haven't used this control, but usually the ProgId is represented in the following way.

    Project.ClassName

    It appears you are missing the second part here.

  3. #3
    Junior Member
    Join Date
    Oct 2008
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Error in the script

    Hi,

    I Debug the script it saying "Object creation failed" error.

    Please help me. I need sample script code for reading the data from ListView or Table. It will be helpful for me to proceed next.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 06:24 AM.

Copyright BetaSoft Inc.