Print Page | Close Window

adding control - please help

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=18679
Printed Date: 05 October 2024 at 2:20am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: adding control - please help
Posted By: rishal01
Subject: adding control - please help
Date Posted: 17 July 2011 at 12:21am
Hi everybody,
i'm trying using report control... to add my custom date control within cells. i dont want using date picker.  uploads/6904/UserControl1.rar - uploads/6904/UserControl1.rar   . but it seem codejock report control would allow it. can any body give some clue ? ... later i'm trying some code that mimics my usercontrol like this :

Private Sub ListEntries_InplaceEditChanging(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem, NewValue As String, Cancel As Boolean)
'
If Len(NewValue) = 2 Then SendKeys "{-}"
If Len(NewValue) = 5 Then
    If InStr(6, NewValue, "-", vbTextCompare) = 0 Then SendKeys "{-}"
End If
End Sub

but this code looks ugly when user entered backspace... is there better idea ??

Thanks.



Replies:
Posted By: Aaron
Date Posted: 19 July 2011 at 3:01pm
Hi,
 
Here's a small demo for positioning DateTimePicker and your own UserControl.
 
First you have to decide what you want to use because you need some 'workaround' to save value to reportItem. Let me know which one you like best and I will see what I can do.
 
http://forum.codejock.com/uploads/3701/Test.zip - uploads/3701/Test.zip
 
 
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: rishal01
Date Posted: 20 July 2011 at 4:45am
 hi  Aaron,

i dont know what to say ... you help me a lot .... thank you so much ... many ... many thank you Big smile Big smile  Big smileClap Clap

I did not realize was a solution to this problem is very simple. but for those who do not know like me that will make the headache. once again thank you very much

Private Sub wndReportControl_FocusChanging(ByVal NewRow As XtremeReportControl.IReportRow, ByVal NewColumn As XtremeReportControl.IReportColumn, ByVal NewItem As XtremeReportControl.IReportRecordItem, Cancel As Boolean)

   Dim l As Long
    Dim t As Long
    Dim b As Long
    Dim r As Long
    
  Me.wndReportControl.Rows(NewRow.Index).GetItemRect NewItem, l, t, r, b
  
  With Me.DateTimePicker1
        .Move l, t, r - l, b - t
        .ZOrder 0
        .Visible = NewColumn.Index = 2 'only use third column for showing datepicker
        .Value = NewItem.Value
    End With
 End Sub

 just add this code then the problem is resolved.

Private Sub DateTimePicker1_Change()
     wndReportControl.FocusedRow.Record(2).Value = DateTimePicker1.Value
     wndReportControl.Populate
End Sub






Posted By: JamGodz
Date Posted: 12 October 2011 at 7:26pm
it take me two days to find this solution thanks to you guys!

But i have a problem... when i scroll down/up the DatePicker did not go with item.

thanks...



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