I have the following block of code.
reportViewer.ServerReport.ReportPath = LookUpFacade.GetReportFileNameFromDefinition(reportDisplayType.ReportDefinitionID);
reportViewer.ServerReport.SetParameters(reportParameterCollection);
When I add a parameter called "Car" with a value of "Honda", it shows in the reportParameterCollection, but after I set the ReportPath, and I do a reportViewer.ServerReport.GetParameters(), the parameter "Car" is there with a Values property (it can contain multiple values) that is empty (count of 0).
The reportParameterCollection has "Car" with a value of "Honda" but once I call SetParameters, the value is overridden in the ServerReport.GetParameters().
Any ideas?
Actually it had nothing to do with the code. I was passing in the incorrect parameters. I was passing a student id that didn't belong to the requested school.
Related
I have just created a window, containing a fill-in field (TestField) and a checkbox (chk_TestField):
DEFINE VARIABLE TestField AS INTEGER VIEW-AS FILL-IN.
DEFINE VARIABLE chk_TestField AS LOGICAL VIEW_AS TOGGLE-BOX.
It is very simple to change the value of the fill-in field, based on the checking of the checkbox, something like:
ON VALUE-CHANGED OF chk_TestField IN FRAME DEFAULT-FRAME
DO:
TestField = 5.
END.
However, I'm interested in changing an attribute of the Fill-in field itself, not the integer it represents (I would like to make the fill-in field read-only), how to I do this?
I've tried:
ON VALUE-CHANGED OF chk_TestField IN FRAME DEFAULT-FRAME
DO:
TestField.Read-Only = NOT(chk_TestField).
END.
This, obviously, does not work.
ASSIGN TestField:READ-ONLY IN FRAME {&FRAME-NAME} = TRUE.
or
ASSIGN Table.TestField:READ-ONLY IN FRAME {&FRAME-NAME} = TRUE.
For my data model, I have the following:
type defines an item
The project owns an item
Type is connected to anchors (Suppose the anchor is country)
Item is connected to a particular anchor instance (anchor instance
will have corresponding value for anchor, suppose US)
I am trying to read an item along with the type, anchorNames and anchorValues.
Following is the query I have written:
g.V().hasLabel('Type').as('t')
.outE('DEFINES').inV().hasLabel('Item').has('dataId',’test-id').has('version','1').as('i')
.inE('OWNS').outV().hasLabel('Project').select('i')
.project('i','t','anchorNames','anchorValues')
.by(__.valueMap(true))
.by(__.in().hasLabel('Type').valueMap(true))
.by(out().in().hasLabel('Anchor').values('name').fold())
.by(out().as('AnchorInstance').select('AnchorInstance')
.by(values('value','secondaryValue').fold()).fold())
I get i and t but the result for anchorNames and anchorValues is as follows:
{anchorNames=[status, status, country], anchorValues=[[OK], [US], [FAIL]]}
However I am expecting the following:
{anchorNames=[status, status, country], anchorValues=[[OK], [FAIL], [US]]}
I need the ordering between the anchorNames and anchorValues as shown above.
I think the best approach will be to get the name and the corresponding values together.
g.V().hasLabel('Type').as('t')
.out('DEFINES').hasLabel('Item').has('dataId',’test-id').has('version','1').as('i')
.in('OWNS').hasLabel('Project').select('i')
.project('i','t','anchors')
.by(__.valueMap(true))
.by(__.in().hasLabel('Type').valueMap(true))
.by(out().project('anchorNames','anchorValues')
.by(__.in().hasLabel('Anchor').values('name'))
.by(values('value','secondaryValue').fold()).fold())
I have a dexterity content type and I have been following along with the schema-driven types tutorial from the Dexterity Manual (http://docs.plone.org/external/plone.app.dexterity/docs/schema-driven-types.html#the-schema) and I am trying to change the default value of a field.
The value being returned is based on a portal catalog search. The field is an int type in which I want it equal to the highest number + 1 of the field in question. Because this is a field I want to hide, I figured maybe it would be possible to set the default value through returning a value from a function
value into the default parameter of a field.
Here is my Interface:
class ISupplier(model.Schema):
"""
Supplier of an asset or services
"""
supplier_id = schema.Int(
title=_(u"Supplier ID"),
description=_(u"ID that links to the database"),
required=True,
default=newID
)
...
Here is my function that I am trying to use to return a value. It is outside of classes.
#grok.provider(IContextSourceBinder)
def newID(context):
limit = 1
catalog = getToolByName(context, 'portal_catalog')
result = catalog.searchResults(portal_type='gpcl.supplier.supplier',
sort_on='supplier_id',
sort_order='descending',
sort_limit=limit
)[:1]
return result.supplier_id + 1
The reason I thought it'd be possible to do something like this is because in a choice type field I set the source equal to a value returned from a function:
form.widget(supplierType=CheckBoxFieldWidget)
supplierType = schema.List(title=u'Types',
value_type=schema.Choice(source=supplierTypes),
required=True
supplierTypes, the function, starts off like this:
#grok.provider(IContextSourceBinder)
def supplierTypes(context):
"""
"""
...
I did try using default_value:
#form.default_value(field=ISupplier['supplier_id'])
def supplierIDDefaultValue(data):
defaultID = newID
return defaultID
This did not work unfortunately. I believe I actually may be having a misunderstanding altogether. If I could have any help, I would greatly appreciate it.
I need to set the value of leading of text layer in Photoshop. I am first retrieving the selected text layer and then gets its value in a TextItem object. Then I get the value of the leading from a combo-box and set the value of leading using the following code.
var activeTextItem:TextItem = curLayer.textItem;
activeTextItem.leading = ComboBox.text.toString();
This code works fine when using on Windows. But when I try to execute the above code on Mac it always shows the leading as null object.
Can someone please guide me why I am not able to set the value of leading in Mac?
Thanks
I found the solution for this.
The leading has a value called Auto which by default has value a null. Therefore when I use the above code I am not able to set the value as leading parameter is null.
To overcome this I put a check that if leading is null value ie Auto then set the property useAutoLeading to false and once you set the value then again set the useAutoLeading property to true.
if("Auto" == ComboBox.text)
{
activeTextItem.useAutoLeading = false;
activeTextItem.leading = ComboBox.text.valueOf();
activeTextItem.useAutoLeading = true;
}
Thanks.
I have a question, why doesn't this work?
I have an ArrayCollection with data; a trace of random index of this using
ObjUtil.toString(arrc.getItemAt(index))
gives me
(Object)#0
label = "VALUE"
value = 20
I then create an object:
var newObj:Object = new Object()
newObj.label = "VALUE"
newObj.value = 20
A trace of this gives:
(Object)#0
label = "VALUE"
value = 20
Now I do:
arrc.getItemIndex(newObj)
and it always gives me -1.
Does anyone know where I'm going wrong?
Just a bit of clarification.. You're not actually adding that object to the collection? You're creating an object that is the same as an object in the collection and using it to get the index?
The newObj is not the same as the object in the arraycollection.. they just have the same values. The getItemIndex method will only 'find' an object if it's actually the same object (it's not going to drill down and compare member variables).
getItemIndex is searching for the same item (instance) and not for an equal item with equal property values.