Report Row Height Refresh Problem |
Post Reply |
Author | |
markmark
Senior Member Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
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 |
|
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
markmark
Senior Member Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
|
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 |
|
markmark
Senior Member Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
|
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 |
|
Baldur
Senior Member Joined: 22 November 2006 Location: Germany Status: Offline Points: 244 |
Post Options
Thanks(0)
|
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).
|
|
markmark
Senior Member Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
|
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 |
|
Baldur
Senior Member Joined: 22 November 2006 Location: Germany Status: Offline Points: 244 |
Post Options
Thanks(0)
|
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).
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
Baldur
Senior Member Joined: 22 November 2006 Location: Germany Status: Offline Points: 244 |
Post Options
Thanks(0)
|
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.
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
markmark
Senior Member Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
|
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 |
|
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 |
|
AndreiM
Moderator Group Joined: 18 August 2007 Status: Offline Points: 132 |
Post Options
Thanks(0)
|
Hi,
I have just test this. On my computer this works fine.
Are you setup service pack 6 for VC 6?
|
|
markmark
Senior Member Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
|
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 |
|
AndreiM
Moderator Group Joined: 18 August 2007 Status: Offline Points: 132 |
Post Options
Thanks(0)
|
Yes, it works fine for mee.
|
|
markmark
Senior Member Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
|
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 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
markmark
Senior Member Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
|
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 |
|
Baldur
Senior Member Joined: 22 November 2006 Location: Germany Status: Offline Points: 244 |
Post Options
Thanks(0)
|
The VB6-MsgBox stops all processing !
So CJ can't give you a solution for that.
|
|
markmark
Senior Member Joined: 30 November 2007 Status: Offline Points: 142 |
Post Options
Thanks(0)
|
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
|
|
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1354 |
Post Options
Thanks(0)
|
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 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1354 |
Post Options
Thanks(0)
|
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 |
|
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 |