Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [SOLVED] How does FindRecordItem work?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] How does FindRecordItem work?

 Post Reply Post Reply
Author
Message
Jebo View Drop Down
Senior Member
Senior Member


Joined: 27 October 2005
Location: Germany
Status: Offline
Points: 318
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jebo Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] How does FindRecordItem work?
    Posted: 11 December 2008 at 12:54pm
There is no sample and no description in your help.

I testet many ways but without any hit.

SO PLEASE give me a little sample.
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 15 December 2008 at 2:49pm
Hi,
 
Yes, would be nice to have an example. I tried a lot but without succes. Looks like the method is still under construction...
 
 
 
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
Stilki View Drop Down
Groupie
Groupie


Joined: 27 May 2005
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Stilki Quote  Post ReplyReply Direct Link To This Post Posted: 20 December 2008 at 7:20pm
I can't get it working as well.
Not enough information in Help or any sample.
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 05 January 2009 at 4:22am
Hi,
 
Support member Mark gave me sample. It doesn't work for me but he said it should work. I tried with V12.1.0 and V12.1.1
 
Let someone else have a try with the code snippet and please let me know if it works for you.
 
 Dim repRecItem As ReportRecordItem
  Dim iCols, iRows
  Dim sArg As String
  sArg = "James HOWLETT"
  
  iCols = wndReportControl.Columns.Count
  iRows = wndReportControl.Rows.Count
 
  Set repRecItem = wndReportControl.Records.FindRecordItem(1, iRows, 1, iCols, 1, 1, sArg, xtpReportTextSearchExactPhrase)
  repRecItem.ForeColor = RGB(255, 0, 0)
 
Thanks in advance

 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
Jebo View Drop Down
Senior Member
Senior Member


Joined: 27 October 2005
Location: Germany
Status: Offline
Points: 318
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jebo Quote  Post ReplyReply Direct Link To This Post Posted: 05 January 2009 at 5:19am
Hi Aaron,

this code can't work because the ReportControl has a bug and will be fixed in  the next release...!

Here you can read the comment from CJ-Support-Team:

Notes:
-------------------------------------------
****Note by Doubson, Mark,  12 Dec 2008:

You right - it was a buggy code. I fixed it and code will go to next release

Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 05 January 2009 at 5:48am
Hi Jebo,
 
Thanks for reply.
 
I'm glad it is a BUG because I thought it was me, I tried a lot (including simular code like Mark suggested) but it failed everytime.
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
Stilki View Drop Down
Groupie
Groupie


Joined: 27 May 2005
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Stilki Quote  Post ReplyReply Direct Link To This Post Posted: 05 January 2009 at 6:00am
Hi All,
 
Just confirming the BUG that has been acknowledged.
I tried the above code and various other permutations to no avail.
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 09 January 2009 at 12:22am
There is interm release version from 2008, Dec, 17 Report ActiveX with working FindRecordItem function. Ask Kirk or Mike to send it to you
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 09 January 2009 at 1:00am
Originally posted by mdoubson mdoubson wrote:

There is interm release version from 2008, Dec, 17 Report ActiveX with working FindRecordItem function. Ask Kirk or Mike to send it to you
 
Hi Mark,
 
Is there any chance of fixed issues (major issue post) in interm release  Would be nice if you would reply on that post just just to know what the status is...
 
Thanks
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 09 January 2009 at 1:07am
Well I will but you can browse the MFC discussion - which is very usefull as ActiveX is always depends from ToolkitPro code
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 10 February 2009 at 2:18pm
Hi Mark,
 
I tested the method in V13.0.0 and still get an error: "Object variable or With block not set"
 
I used same code snippet as you wrote in previous reply.
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 10 February 2009 at 2:33pm
 
to test using VB ReportSample code - in frmMain modify function:
 
Private Sub mnuFieldChooser_Click()
    ' FieldChooser is used to add or remove fields (i.e. columns) using drag-and-drop.
    ' FieldChooser is an analogue of a pool with column headers of non-used columns
   
    'Displays a form with a FieldChooser control

    'frmFieldChooser.Show 0, Me

    'Associates a FieldChooser control with a ReportControl on another form
    'This is necessary so the ReportControl knows where to find the FieldChooser so it can
    'add and remove column headers.
    'wndReportControl.FieldChooser = frmFieldChooser.wndFieldChooser
   
' this is a test case of using FindRecordItem function
    Dim repRecItem As ReportRecordItem
    Dim iCols, iRows
    Dim sArg As String
    sArg = "James HOWLETT"
   'sArg = "James Howlett"
   
    iCols = wndReportControl.Columns.Count
    iRows = wndReportControl.Rows.Count
  
    Set repRecItem = wndReportControl.Records.FindRecordItem(1, iRows, 1, iCols, 1, 1, sArg, xtpReportTextSearchExactPhrase)
    repRecItem.ForeColor = RGB(255, 0, 0)
   
End Sub

as a result of call you will see red as in snapshot I run right now
 
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 10 February 2009 at 4:47pm
btw - are you sure that you use release 13 activex?
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 11 February 2009 at 12:57am
Hi Mark,
 
OK, I got it to work and maybe this was same problem in V12.1.1
 
If you try to find an item and searchtext would be exactly the same as a reportitem and you use 'xtpReportTextSearchExactPhrase' you will get the error I mentioned.
 
I will do some testing and I will let you know.
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 11 February 2009 at 1:12am
No - it does not work in Release 12.
Back to Top
Jebo View Drop Down
Senior Member
Senior Member


Joined: 27 October 2005
Location: Germany
Status: Offline
Points: 318
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jebo Quote  Post ReplyReply Direct Link To This Post Posted: 11 February 2009 at 4:03am
mmmh, there is something strange...

if I search for "JamEs hoWleTt" with xtpReportTextSearchExactPhrase there will be find the record.

BUT if I search for "James Howlett" (this is the realy exactly Name!) with xtpReportTextSearchExactPhrase there will DON'T find the record!

WHY?

Here is the sample (it seems like the same bug since before - v12.x):

    Dim repRecItem As ReportRecordItem, iRows As Long, sArg As String
    iRows = wndReportControl.Rows.Count
 
    sArg = "James Howlett"
    Set repRecItem = wndReportControl.Records.FindRecordItem(1, iRows, 3, 3, 1, 1, sArg, xtpReportTextSearchExactPhrase)
    If repRecItem Is Nothing Then
        Beep
      Else
        wndReportControl.SetFocus
        wndReportControl.FocusedRow = wndReportControl.Rows.FindRow(repRecItem.Record)
        wndReportControl.FocusedRow.EnsureVisible
    End If

Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 13 February 2009 at 5:16am
Hi @Jebo
 
Is it possible to test this in V12.1.1 ?
 
I also mentioned that this could be same problem in previous version. Another thing: Can you make this post a sticky one? Do not let this post slide down
 
Thanks a lot
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 13 February 2009 at 6:21am
Hi,
 
I did a test myself with V12.1.0 and it does work the same as in V13.0.0
 
You will get an error when using xtpReportTextSearchExactPhrase. So this is definitely a bug!
 
@Jebo: Please change your topic description and change the topic into a sticky one
 
Thanks a lot
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
Jebo View Drop Down
Senior Member
Senior Member


Joined: 27 October 2005
Location: Germany
Status: Offline
Points: 318
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jebo Quote  Post ReplyReply Direct Link To This Post Posted: 13 February 2009 at 6:28am
done!
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 13 February 2009 at 6:38am
Hi @Jebo,
 
Thanks for that
 
I just wanted to say that I forgot to unregister V13.0.0 ocx so that's why I said it works the same as in V12.1  
It looks like the method isn't working at all (V12.1) as Mark already replied.
 
But the fact remains that this is a bug in new version, so leave the description as is...
 
Thank you
 
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 13 February 2009 at 12:07pm
YOU RIGHT - code SKIP pure xtpReportTextSearchExactPhrase case!
While case xtpReportTextSearchExactPhrase AND xtpReportTextSearchMatchCase properly covered.
I will fix it - you can use also code 0 - it works properly.
P.S. Case fixed and next beta-release will have proper code for ToolkitPro and ActiveXs
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 21 February 2009 at 10:26am
Hi Mark
 
With new OCX this is solved but now it will give error on xtpReportTextSearchMatchCase
 
Thanks
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 21 February 2009 at 11:57am
You right - it was wrong internal function (Left instead of Mid!) call - "Search case-non-sensetive item Which STARTED with given pattern".
It also make sense - but with special flag (may be in future?). For now I fix it to cover general case - "Search case-non-sensetive item Which HAS given pattern as substring"
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 05 May 2009 at 5:41pm
We have now new flag for FindRecordItem function (xtpReportTextSearchExactStart) which means only string starting with pattern return (not pattern inside case) and new function FindRecordItemByRows which use same flag set but operate with Rows instead of Records - same way you can sort your report and call this function after e.g. providing top 10 rows as search positions
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 24 June 2009 at 2:17pm
Hi,
 
This issues has been solved in V13.1  Including extra member xtpReportTextSearchExactStart
 
Thanks
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
Jebo View Drop Down
Senior Member
Senior Member


Joined: 27 October 2005
Location: Germany
Status: Offline
Points: 318
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jebo Quote  Post ReplyReply Direct Link To This Post Posted: 24 June 2009 at 3:59pm
Oh, that sounds great! 
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 24 June 2009 at 4:07pm
there is also another function for search:
IReportRecordItem* FindRecordItemByRows(long StartIndex, long EndIndex, long StartColumn, long EndColumn, long Record, long Item, BSTR Text, XTPReportTextSearchParms Flags);
it is good for already sorted case
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 27 June 2009 at 3:41am
Originally posted by Jebo Jebo wrote:

Oh, that sounds great! 
 
Hi @Jebo,
 
Would be best you would remove "the sticky part" of your post and add SOLVED to description. Now it looks like it's still a BUG and we don't want that, right?
 
Thanks
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
Jebo View Drop Down
Senior Member
Senior Member


Joined: 27 October 2005
Location: Germany
Status: Offline
Points: 318
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jebo Quote  Post ReplyReply Direct Link To This Post Posted: 27 June 2009 at 4:26am
Done.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.250 seconds.