[SOLVED] Export not possible if using EditOptions! |
Post Reply |
Author | |
Jebo
Senior Member Joined: 27 October 2005 Location: Germany Status: Offline Points: 318 |
Post Options
Thanks(0)
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! 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? |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
Jebo
Senior Member Joined: 27 October 2005 Location: Germany Status: Offline Points: 318 |
Post Options
Thanks(0)
|
Hooo, your Workaround works, but maks my export very slow.
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! |
|
[Sig removed by Admin: Signature can't exceed 40GB]
|
|
Jebo
Senior Member Joined: 27 October 2005 Location: Germany Status: Offline Points: 318 |
Post Options
Thanks(0)
|
Oh sorry Aaron. But your Workaround does NOT work!
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! |
|
[Sig removed by Admin: Signature can't exceed 40GB]
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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
|
|
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.... |
|
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
|
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
|
|
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
|
Fixed for 15.0.3
|
|
Codejock support
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |