Having problem with ExpandButton |
Post Reply |
Author | |
Mike Lewis
Groupie Joined: 29 April 2009 Status: Offline Points: 41 |
Post Options
Thanks(0)
Posted: 19 May 2010 at 3:14pm |
I hope this is a simple question.
I am using version 13.1. I am trying to add an ExpandButton to a column. I want it to appear in every row for the column. I have tried doing the following (where oCol is an object reference to the column): oCol.EditOptions.AddExpandButton(0) But the button does not appear. I just see an empty column. I've tried clicking and double-clicking in a cell, but that makes no difference. I also tried doing this in each cell within the column: oItem.CreateEditOptions() The effect was to make the cell editable, but still no sign of the button. I've successfully created a combo button for the same grid. It's just the expand button that has defeated me. I'd be grateful for your help. I expect I'm missing something quite simple. Mike |
|
Mike Lewis
Software Developer Edinburgh, Scotland |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi Mike,
This is most basic code to have an ExpandButton for every single ReportItem in the column:
wndReportControl.AllowEdit = True Dim oCol As XtremeReportControl.ReportColumn
Set oCol = wndReportControl.Columns.Add(0, "Column 1", 50, True) oCol.EditOptions.AddExpandButton True If you don't want ExpandButton for entire column just add ExpandButton for a single ReportItem:
Dim xtremeRecordItem As XtremeReportControl.ReportRecordItem
Dim xtremeRecord As XtremeReportControl.ReportRecord Set xtremeRecordItem = xtremeRecord.AddItem("Some text")
xtremeRecordItem.CreateEditOptions xtremeRecordItem.EditOptions.AddExpandButton True Hope this helps
|
|
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.... |
|
Mike Lewis
Groupie Joined: 29 April 2009 Status: Offline Points: 41 |
Post Options
Thanks(0)
|
Aaron,
Many thanks for your very helpful reply. Your code did the trick. However, now that I can see the ExpandButton, I realise it's not what I was expecting. It seems the button is meant to form part of an editable cell, where the user can either edit the text directly or click on the button to access more options. What I really wanted was a cell that only contains a button - no text - and when the user clicks the button, I can open a context menu. I know I can do that in the right-click event, but I wanted to provide a button as an alternative. I guess an Expand Button is the wrong choice for that. Never mind. I'll try to simulate it on some way, perhaps with a hyperlink. Thanks anyway for your reply. Mike |
|
Mike Lewis
Software Developer Edinburgh, Scotland |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
why not just add a ReportItemButton?
|
|
Mike Lewis
Groupie Joined: 29 April 2009 Status: Offline Points: 41 |
Post Options
Thanks(0)
|
SuperMario,
That's a good question. The answer is: Because I didn't know it existed. I've found the Help topic for the ReportItemButton, and also the list of its PEMs. But I can't see how to add it to a report. Can you give me some guidance on how to get started with it? Thanks. Mike |
|
Mike Lewis
Software Developer Edinburgh, Scotland |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Look at ItemControls samples - part of the VB6 Report Sample......here is the basics to adding 2 buttons
Dim i As Integer 'Assign icon IDs For i = 0 To 6 iconArray(i) = i + 1 Next 'Load icons wndReportControl.Icons.LoadBitmap App.Path & "\Icons\itemcontrols.bmp", iconArray, xtpImageNormal Dim Record As ReportRecord Dim Item As ReportRecordItem Dim Button As ReportItemButton 'Adds new record Set Record = wndReportControl.Records.Add() 'Add items i = 0 'Add item Set Item = Record.AddItem("Row - " & Record.Index + 1 & ", Column - " & i + 1) Item.Editable = True 'Add button "Alignment" Set Button = Item.ItemControls.AddButton(-1) 'Button.Alignment = xtpReportItemControlLeft Button.Alignment = xtpReportItemControlRight Button.SetIconIndex xtpReportItemButtonStateNormal, 1 Button.SetIconIndex xtpReportItemButtonStatePressed, 2 Button.SetSize 22, 0 'Add button "Color" Set Button = Item.ItemControls.AddButton(-1) Button.Alignment = xtpReportItemControlRight Button.SetIconIndex xtpReportItemButtonStateNormal, 5 Button.SetIconIndex xtpReportItemButtonStatePressed, 6 Button.SetSize 22, 0 'Add button "Bold" Set Button = Item.ItemControls.AddButton(-1) Button.Alignment = xtpReportItemControlRight Button.SetIconIndex xtpReportItemButtonStateAll, 4 Button.CaptionColor = 255 Button.SetSize 22, 0 wndReportControl.Populate |
|
Mike Lewis
Groupie Joined: 29 April 2009 Status: Offline Points: 41 |
Post Options
Thanks(0)
|
SuperMario,
Unfortunately, I can't look at the VB sample reports as I don't use VB. But that's OK, because your code sample tells me what I need to know. I'll give it a try and report back. Many thanks. Mike |
|
Mike Lewis
Software Developer Edinburgh, Scotland |
|
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 |