Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Report Row Height Refresh Problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Report Row Height Refresh Problem

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


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Topic: Report Row Height Refresh Problem
    Posted: 30 July 2008 at 7:09am

Hi

 

I have a problem with the report changing row heights.

I have set

wndReportControl.PaintManager.FixedRowHeight = False wndReportControl.SetCustomDraw xtpCustomMeasureRow

 

With in the event wndReportControl_MeasureRow

 I can set the height of the group.

This is OK until I display a msgbox within the event of

wndReportControl_ValueChanging

 

If you run the example and then type a value of 0 into the size column

Then click away, a msgbox will display telling you that you cannot have a 0 value.

 

At this point the report has now resized the row of the group.

Once you clear the msgbox it will resize back.

 

Is there a way to stop this effect?

 

Thanks

 

MArk
uploads/20080730_070855_Rowheight.zip
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
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: 31 July 2008 at 2:10am
Hi Mark,
 
Looks like the RC is calling .ReDraw internally to update the cell and draws the initial height of rows. The only one who can do something about this is CJ. 
 
 
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
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Posted: 31 July 2008 at 3:57am
Hi Aaron.
 
Thanks for taking a look.
I have just posted in a  support call.
 
 
Thanks
 
MArk
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
Back to Top
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Posted: 07 August 2008 at 4:23am

Dear Support:

have you had a chance to look at this?, also see my support call.
Thanks
 
MArk
 
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
Back to Top
Baldur View Drop Down
Senior Member
Senior Member


Joined: 22 November 2006
Location: Germany
Status: Offline
Points: 244
Post Options Post Options   Thanks (0) Thanks(0)   Quote Baldur Quote  Post ReplyReply Direct Link To This Post Posted: 11 August 2008 at 12:08pm
This is a problem within vb6.
If you show a msgbox, vb6 will prevent executing any event !
Every time, the reportcontrol is to be redrawn, the measurerow-event is fired, but your application can not handle the event, because it is blocked by msgbox.
 
The same effect happens for example in debug-mode.
If i break my application in a measurerow- or drawitem-event and switch to the actual form with the taskmanager, the reportcontrol is drawn with defaults (height and also contents!).
 
Solution:
Show a modal form that looks like a msgbox than the events can be handled (e.g. CJ's TaskDialog).
 
Back to Top
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Posted: 12 August 2008 at 5:41am
Thanks Baldur.
 
Is there another way of setting the row heights? other than using an event?
 
Or is there a way to stop the report from redrawing that I could set as I first go into the event ie report.autoredraw = false
 
Thanks 
Mark
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
Back to Top
Baldur View Drop Down
Senior Member
Senior Member


Joined: 22 November 2006
Location: Germany
Status: Offline
Points: 244
Post Options Post Options   Thanks (0) Thanks(0)   Quote Baldur Quote  Post ReplyReply Direct Link To This Post Posted: 12 August 2008 at 9:42am
This is a general windows-problem.
Every time a window must be repaint because it's overlaid windows himselve sends a WM_PAINT-Message.
So the ReportControl MUST be repainted to show correct contents.
 
You can prevent a window to be redrawn with the following routine:
 
'--------------------------------------------------------------------------------
Public Type cRect
  Left As Long
  Top As Long
  Right As Long
  Bottom As Long
End Type
 
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
Public Declare Function GetClientRect Lib "user32" (ByVal hWnd As Long, lpRect As cRect) As Long
Public Declare Function RedrawWindow Lib "user32" (ByVal hWnd As Long, lprcUpdate As cRect, ByVal hrgnUpdate As Long, ByVal fuRedraw As Long) As Long
Public Const WM_SETREDRAW = &HB
Public Const RDW_INVALIDATE = &H1
Public Const RDW_ALLCHILDREN = &H80
Public Const RDW_UPDATENOW = &H100
Public Const RDW_ERASE = &H4
Public Sub LockWindow(ByVal hWnd As Long, wLock As Boolean)
    Dim ClientRect As cRect
    Dim xState As Long
   
    If wLock = True Then
        xState = SendMessage(hWnd, WM_SETREDRAW, 0, 0&)
    Else
        xState = SendMessage(hWnd, WM_SETREDRAW, 1, 0&)
        GetClientRect hWnd, ClientRect
        RedrawWindow hWnd, ClientRect, 0&, RDW_ERASE Or RDW_INVALIDATE Or RDW_ALLCHILDREN Or RDW_UPDATENOW
    End If
End Sub
'---------------------------------------------------------------------------------------------
 
Sometimes it would help (also for performance reasons by filling a treeview or else).
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: 12 August 2008 at 9:56am
Hi,
 
Or use a taskdialog instead of msgbox. Just as simple as msgbox only with a lot of options
 
 
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
Baldur View Drop Down
Senior Member
Senior Member


Joined: 22 November 2006
Location: Germany
Status: Offline
Points: 244
Post Options Post Options   Thanks (0) Thanks(0)   Quote Baldur Quote  Post ReplyReply Direct Link To This Post Posted: 12 August 2008 at 10:35am
I wrote my own MsgBox-Function with TaskDialog in an own class:
 
------------------------------------------------------------------------------------------
Public Function MsgBox(Prompt As String, Optional Buttons As VbMsgBoxStyle = vbOKOnly, Optional Title, Optional HelpFile, Optional Context) As VbMsgBoxResult
    With frmMain.tskDialog
        .Reset
        .UseComCtl32 = False
        .MessageBoxStyle = True
       
        If Not IsMissing(Title) Then
            .WindowTitle = Title
        Else
            .WindowTitle = App.ProductName
        End If
        .MainInstructionText = Prompt
       
        If (Buttons And vbOKCancel) = vbOKCancel Then
            .CommonButtons = xtpTaskButtonOk Or xtpTaskButtonCancel
        ElseIf (Buttons And vbAbortRetryIgnore) = vbAbortRetryIgnore Then
            .CommonButtons = xtpTaskButtonCancel Or xtpTaskButtonRetry Or xtpTaskButtonClose
        ElseIf (Buttons And vbRetryCancel) = vbRetryCancel Then
            .CommonButtons = xtpTaskButtonCancel Or xtpTaskButtonRetry
        ElseIf (Buttons And vbYesNo) = vbYesNo Then
            .CommonButtons = xtpTaskButtonYes Or xtpTaskButtonNo
        Else
            .CommonButtons = xtpTaskButtonOk
        End If
       
        .MainIcon = xtpTaskIconNone
       
        If (Buttons And vbExclamation) = vbExclamation Then
            .MainIcon = xtpTaskIconError
        ElseIf (Buttons And vbCritical) = vbCritical Then
            .MainIcon = xtpTaskIconError
        ElseIf (Buttons And vbQuestion) = vbQuestion Then
            .MainIcon = xtpTaskIconInformation
        ElseIf (Buttons And vbInformation) = vbInformation Then
            .MainIcon = xtpTaskIconInformation
        End If
       
        Select Case .ShowDialog
        Case xtpTaskButtonOk
            MsgBox = vbOK
        Case xtpTaskButtonYes
            MsgBox = vbYes
        Case xtpTaskButtonCancel
            MsgBox = vbCancel
        Case xtpTaskButtonNo
            MsgBox = vbNo
        Case xtpTaskButtonRetry
            MsgBox = vbRetry
        Case xtpTaskButtonClose
            MsgBox = vbIgnore
        Case Else
            MsgBox = vbAbort
        End Select
    End With
End Function
---------------------------------------------------------------------------------------
 
Assuming frmMain is my mainform containg a taskdialog-control.
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: 12 August 2008 at 10:51am
Originally posted by Baldur Baldur wrote:

I wrote my own MsgBox-Function with TaskDialog in an own class:
 
[.....]
 
Assuming frmMain is my mainform containg a taskdialog-control.
 
Hi Baldur,
 
With this you can replace standard msgbox with TaskDialog. Good idea... You could add this to sample forum if you want
 
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
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Posted: 12 August 2008 at 12:11pm

Thanks you for the MSGBOX code.

I added that, and that has fixed my problem.

It also looks better than the default msgbox.

So I am sorted

 
Thanks Very much.

 

Just a thought though!

 

You can set the column width via code ie.

 

Dim Column As ReportColumn

Set Column = wndReportControl.Columns(2)

Column.Width = 3456

 

and you don’t have to resize the width within an event.

 

What seems to be missing is

 

Dim rRecord As ReportRecord

Set rRecord = wndReportControl.Records(4)

rRecord.width = 23

 

Or even  a  way set a default for group headers

 

wndReportControl.PaintManager.GroupRowHeight

you have such control over GroupRowTextBold etc.

 

Anyway I’m sorted, with your help,

So Thanks again

 

 

MArk 
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
Back to Top
AndreiM View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 18 August 2007
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiM Quote  Post ReplyReply Direct Link To This Post Posted: 12 August 2008 at 2:09pm
Hi,
I have just test this. On my computer this works fine.
Are you setup service pack 6 for VC 6?
Back to Top
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Posted: 13 August 2008 at 2:17am
AndreiM
Did my demo program work fine for you?
 
yes vb6 sp6
 
Thanks
 
MArk
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
Back to Top
AndreiM View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 18 August 2007
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiM Quote  Post ReplyReply Direct Link To This Post Posted: 14 August 2008 at 8:09am
Yes, it works fine for mee.
Back to Top
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Posted: 14 August 2008 at 9:53am
Hi  Andrei
 
If you type a 0 into the size column, and then click to the next row, does the row height for the group default large?
Not until you click OK to the message box, does the row resize back to small.
 
Thanks
 
MArk
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
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 August 2008 at 10:13am
Originally posted by AndreiM AndreiM wrote:

Yes, it works fine for mee.
 
Hi,
 
What is working? The sample project Mark uploaded in first post? Or are you referring to another sample?
 
btw,
I tested the first sample also: with MS msgbox it doesn't work, only with TaskDialog the rowheight will still be updated. 
 
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
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Posted: 16 September 2008 at 4:22am
Codejock Support:
 
Is there an update on this issue yet
 
Thanks
 
MArk
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
Back to Top
Baldur View Drop Down
Senior Member
Senior Member


Joined: 22 November 2006
Location: Germany
Status: Offline
Points: 244
Post Options Post Options   Thanks (0) Thanks(0)   Quote Baldur Quote  Post ReplyReply Direct Link To This Post Posted: 17 September 2008 at 3:10am
The VB6-MsgBox stops all processing !
So CJ can't give you a solution for that.
Back to Top
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Posted: 18 September 2008 at 2:57am

Hi

 

I think is more than an issue with the msgbox.

If you run the example, and after changing a value to 0, and then click into the text box below, the report is OK.

It’s just when you click into the report control after making the change that the report does not refresh correctly

 

 

MArk

 

uploads/20080918_025413_Test.zip

Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 18 September 2008 at 10:30am
Using your sample on my computer, the ReportControl never refreshes properly while it has focus. The moment I click on a cell, the Edit window appears in an incorrect position. It doesn't appear to be taking the new size as set in the MeasureItem event into account.

When I click off of the grid, then it renders properly.


Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

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

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 18 September 2008 at 10:35am
I also notice another problem. Click on a blank area of the grid, below the last data filled row (below the last RE: Hi Mary item). Then click there again. The MeasureItem event isn't being fired and the grid reverts to the standard height for all rows. Click the "Click Me next" text box, and the MeasureItem event gets fired and the grid draws with the new row heights. This causes an ugly jumping effect.
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

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.