UltraGrid Child Bands - infragistics

I would like to move the child bands of a master band to the very left when exporting to excel using ExcelExporter.
Right now, all the child bands are displaced one column to the right.
Also, each child band has a blank row above and below it. I would like to remove them as well.
is this possible?
Thanks

Private Sub UltraGridExcelExporter1_BeginExport(sender As System.Object, e As Infragistics.Win.UltraWinGrid.ExcelExport.BeginExportEventArgs) Handles UltraGridExcelExporter1.BeginExport
DirectCast(sender, UltraWinGrid.ExcelExport.UltraGridExcelExporter).BandSpacing = UltraWinGrid.ExcelExport.BandSpacing.None
For Each band As UltraWinGrid.UltraGridBand In e.Layout.Bands
band.Indentation = 0
Next
End Sub

Related

How to input "P1" into C if H returns text? google sheets

how would I auto-input text "P1" or "P2" or "P3" (priority 1,2,3) into column C if column B returns a certain condition from a list.
example: if Cell H1 = AD01A01, the script will find what priority list its in and change cell C1 to return the prioity.
The script or formula needs to be able to identify if cell A1 is a lower prioriry and chnage it to higher priority if the condtion is met (even if cell A1 was manualy edited)
Also i need to be able to keep the data validation drop down in place so cell A1 can changed manualy without removing any formula (if used)
Auto Priority
try:
=IF((B1<>"")*(B1="certain text"), "P1", )
with extended certain text:
=IF((B1<>"")*(B1="certain text 1")*(B1="certain text 2"), "P1", )
or if you got more values:
=IF((B1<>"")*(REGEXMATCH(B1, "text1|text2|text3"), "P1", )
and then if you want arrayformula, jyst wrap it into it and extend ranges...

Powerbuilder modify row columns

I have more rows. And i want for the rows with status AA1 a column protected and for the rows with status different than AA1 the same column unprotected.
So I wrote this:
ll_count = dw_list.RowCount()
if ll_count > 0 then
for i = 1 to ll_count
if dw_list.object.status[i] = 'AA1' then
dw_list.modify("f_change[i].Protect='1")
//dw_list.Object.f_change[i].modify("f_change[i].Protect='1")
dw_list.Object.f_change[i].Background.Color = gf_get_btnface()
end if
if dw_list.object.status[i] <> 'AA1' then
dw_list.modify("f_change[i].Protect='0'")
end if
next
end if
But dw_list.modify("f_change[i].Protect='1'") is not correct. Neither dw_list.Object.f_change[i].modify("f_change[i].Protect='1").
If I just write dw_list.modify("f_change.Protect='1'") it modifies all the rows.
I woud do this without programming a single line, but by editing the datawindow design.
Open the datawindow in design mode
Select the desired column
In the 'General' tab, click on the small icon nearby 'Protect'.
Insert there the condiction to protect or not that column: if( status = 'AA1', '0', '1')
Done for all your data.
The same process can be applied to many characteristics of data window columns (color, background color, visible, pointer, position,...)
Alternatively, you could put the condition programmatically, but I would only do it if you need to change the protection scheme 'on the fly'. Anyway, the principle is to set the protect condition on the column itself.
Generally speaking, try to do in PowerBuilder as much as you can WITHOUT script programming. U

Ultragrid Export Sort Order / Indicator

To make a long story short, we have a legacy application which displays an infragistics grid where users can export the grid display. The issue I'm having is that there's a particular order in which they want the export to occur, and if I set the order within the grid view prior to export, it retains this order, however if I try to force it "on export", it doesn't seem to work despite trying to set it. Here's my code (VB), as you can see just prior to import I try to set the "sortindicator", but I suspect I'm missing something.
Dim FileName As String
Dim I As Integer
I = 1
FileName = "C:\ReconciliationReport.xls"
While System.IO.File.Exists(FileName)
FileName = "C:\ReconciliationReport_" & I & ".xls"
I = I + 1
End While
grdReconciliationReport.DisplayLayout.Bands(0).Columns("ReconciliationOrder").SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Ascending
UltraGridExcelExporter.Export(grdReconciliationReport, FileName)
During the export of the grid UltraGridExcelExporter creates its own copy of the Layout. This is done exactly to allow you to sort, hide, delete and any other action in the layout without changing the actual grid. To sort the grid by any column you need to handle ExportStarted event. The event argument contains reference to the clonned layout. You can use code like this:
Private Sub UltraGridExcelExporter_ExportStarted(sender As Object, e As ExcelExport.ExportStartedEventArgs) Handles UltraGridExcelExporter1.ExportStarted
Dim sortedCol As UltraGridColumn = e.Layout.Bands(0).Columns(1)
e.Layout.Bands(0).SortedColumns.Add(sortedCol, False, False)
End Sub

how can I add another textlabel and buttons to a cell in a tableView in rubymotion?

I use the following methods to create a cell and populate data in it(adapted from the tweets app example)
Now I want to add a new label displaying the selected event date and a button that will perform another action.
Here comes the 2 methods:
def self.cellForEvent(event, inTableView:tableView)
cell = tableView.dequeueReusableCellWithIdentifier(EventCell::CellId) || EventCell.alloc.initWithStyle(UITableViewCellStyleDefault, reuseIdentifier:CellId)
cell.fillWithEvent(event, inTableView:tableView)
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton
cell
end
Populate data into the cell
def fillWithEvent(event, inTableView:tableView)
self.textLabel.text = event.name
puts event.image
unless event.image
self.imageView.image = nil
Dispatch::Queue.concurrent.async do
event_image_data = NSData.alloc.initWithContentsOfURL(NSURL.URLWithString(event.image_url))
if event_image_data
event.image = UIImage.alloc.initWithData(event_image_data)
Dispatch::Queue.main.sync do
self.imageView.image = event.image
tableView.delegate.reloadRowForEvent(event)
end
end
end
else
self.imageView.image = event.image
end
end
railsdog's recommendation is not without merit. You could make a #reference to the cell you want to edit, and make changes to it later. But this is kind of dangerous - lots of pitfalls: What happens it the cell is moved off screen? Reused elsewhere? Tricky.
Instead, I would recommend adding some of the fillWithEvent:inTableView code into the cellForEvent method, that way you can call tableView.reloadRowsAtIndexPaths:withRowAnimation: and that method will be called. This moves the complications I mentioned above onto the back of the Cocoa framework, and that's a good thing :-)
The downside is that you'll need to keep the indexPath handy (or calculatable), and always keep in mind that the event associated with the cell is transient, because the cells are reused. Your code above doesn't seem to keep a reference to event, which is a good thing!
# in fetchImageForEvent:tableView:
# ...
event.image = UIImage.alloc.initWithData(event_image_data)
Dispatch::Queue.main.sync do
# instead of this:
# self.imageView.image = event.image
# tell the tableView to reload. unfortunately, we don't have the index
# path. not sure how you're calculating it, but if you've got a list of
# events, this should be easy.
# I'm just assuming section 0, row 1 here.
path = NSIndexPath.indexPathWithIndex(0).indexPathByAddingIndex(1)
tableView.reloadRowsAtIndexPaths([path], withRowAnimation:UITableViewRowAnimationAutomatic)
end

OpenOffice.org/LibreOffice Calc macro: is a cell's content currently overflowing?

I have a bunch of cells whose font size I'd like to tweak if their content is overflowing, until it all fits. I'd like to write a macro to do this, unless there's a conditional formatting or other formulaic way of doing it. Is there a property that tells whether a cell is overflowing? If so, what is it?
'open office 3
'get current document
oDoc = ThisComponent
' get first work sheet
oSheet = oDoc.getSheets().getByIndex(0)
'first cell in the work sheet
Cell = oSheet.getCellByPosition(0, 0)
MsgBox Cell.CharHeight
Happy Coading :))