Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [SOLVED] Export not possible if using EditOptions!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] Export not possible if using EditOptions!

 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] Export not possible if using EditOptions!
    Posted: 13 March 2011 at 3:22pm
Hello CJ-Team,

if the ReportControl uses "Constraints", it seems to be not possible to read the Captions! Ouch

Please see the attached sample-code for a better understanding.

  >>> uploads/1570/ReportControl_EditOptions.zip

Please, is there a workaround or fix available - or do I something wrong?

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: 14 March 2011 at 3:02pm

Hi,

I can confirm this is a bug. Strange that only visible items are processed.

Fix: submit issue

Workaround: See extra code below
 
Private Sub cmdTest_Click()
    Dim Row As ReportRow, c As Long
    lstCaptions.Clear
   
    With ReportControl1
        For Each Row In .Rows
            Row.EnsureVisible
            DoEvents
            lstCaptions.AddItem Row.Record(0).Caption & " / " & Row.Record(1).Caption
        Next
    End With
End Sub
 
Good luck, again!
 
 
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: 15 March 2011 at 4:23am
Hooo, your Workaround works, but maks my export very slow. Clown
But it's better than nothing!

I've opend a support-ticket now and hope CJ will fix this bug in 15.0.3.

Thank you! Smile

[Sig removed by Admin: Signature can't exceed 40GB]
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: 15 March 2011 at 5:04am
Oh sorry Aaron. But your Workaround does NOT work! Confused

Please see the right side (scroll to right in the ReportControl) in my example. Before you scroll there are still only numbers in the ListBox! Cry

[Sig removed by Admin: Signature can't exceed 40GB]
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 March 2011 at 7:12am

Hi,

You are right, I wanted to see both columns and assigned smaller values for the columns.

You have constraints with data=5 & data=8 , is that for a special reason? If not following code could be reduced to a single line (without looping constraints) I created two loops for showing what you could do...

Private Sub cmdTest_Click()
    Dim Row As ReportRow, c As Long
    lstCaptions.Clear
       
    Dim constraintIndexFirst As Long
    Dim constraintIndexSecond As Long
    Dim i As Long
   
    With ReportControl1
        For Each Row In .Rows
           
            For i = 0 To .Columns(0).EditOptions.Constraints.Count - 1
                If .Columns(0).EditOptions.Constraints(i).Data = Row.Record(0).Value Then
                    constraintIndexFirst = i
                    Exit For
                End If
            Next i
           
            For i = 0 To .Columns(1).EditOptions.Constraints.Count - 1
                If .Columns(1).EditOptions.Constraints(i).Data = Row.Record(1).Value Then
                    constraintIndexSecond = i
                    Exit For
                End If
            Next i
           
            lstCaptions.AddItem .Columns(0).EditOptions.Constraints(constraintIndexFirst).Caption & " / " & .Columns(1).EditOptions.Constraints(constraintIndexSecond).Caption
           
        Next
    End With
       
End Sub
 
 
If you are able to change the data of constraints into 0 & 1 for both columns
 
Private Sub cmdTest_Click()
    Dim Row As ReportRow, c As Long
    lstCaptions.Clear
        
    With ReportControl1
        For Each Row In .Rows
           
            lstCaptions.AddItem .Columns(0).EditOptions.Constraints(Row.Record(0).Value).Caption & " / " & .Columns(1).EditOptions.Constraints(Row.Record(1).Value).Caption
           
        Next
    End With
       
End Sub
 
 
 
But on the otherhand you could add ReportItems with the selected constraint as caption:
 
For i = 0 To 20
    Set rec = ReportControl1.Records.Add()
    Select Case i
       Case Is < 4
            With rec.AddItem(0) 
                .Caption = Me.ReportControl1.Columns(0).EditOptions.Constraints(.Value).Caption
            End With
 
....
....
 
In this case you could use your original code cmdTest_Click() because you already added captions to the ReportItem
 
 
Well to be honest I prefer adding the captions to the ReportItems in advance option, so you don't have to worry about the rest.
 
 
Good luck Wink
 
 
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
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 16 March 2011 at 8:46pm
Hi,

this is indeed a bug in 15.0.2. A fix will be available shortly. As a workaround you can add the constraints to each item instead of the column.

Andre

Codejock support
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 17 March 2011 at 11:45am
Fixed for 15.0.3

Codejock support
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.188 seconds.