Print Page | Close Window

[SOLVED] Export not possible if using EditOptions!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=18049
Printed Date: 15 November 2024 at 7:40pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] Export not possible if using EditOptions!
Posted By: Jebo
Subject: [SOLVED] Export not possible if using EditOptions!
Date 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 - uploads/1570/ReportControl_EditOptions.zip

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




Replies:
Posted By: Aaron
Date 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....


Posted By: Jebo
Date 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]


Posted By: Jebo
Date 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]


Posted By: Aaron
Date 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....


Posted By: ABuenger
Date 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


Posted By: ABuenger
Date Posted: 17 March 2011 at 11:45am
Fixed for 15.0.3



-------------
Codejock support



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net