how to set initial value to variables in iReport? - variables

In iReport 3.6.7, I am trying to use a Double variable. I want it to have an initial value of 0 or 0.00.
At present, no initial value has been set, so it displays null in the report. How can I make it have an initial value if no value has been explicitly specified?

Here's how to do it in iReport:
Click on the variable on the Report Inspector window
On the Properties window, set the Initial Value Expression to new Double(0.0)

Related

SSRS Report: Set a Display Message When a Certain Dataset Returns NULL

I have a SQL report with two different parameters. The first parameter is hidden, and gets the default value from somewhere else. The second parameter gets default value from the first parameter, and it might return NULL values.
My question is, is it possible to automatically display a message on the report when the second parameter returns NULL values?
If you mean a message dialog (pop-up message) then you cannot do this using the SSRS web portal by default.
If you just want to display some text on the report then you can easily do this.
Add a text box, set the value to whatever text you like, or to an expression if it needs to be more dynamic.
Then set the hidden property of the text box to something like
=IIF(Parameters!myParam.Value = nothing, False, True)
If the parmeter you want to check is multi-value then just reference index 0 to pick up the first entry like this.
=IIF(Parameters!myParam.Value(0) = nothing, False, True)

QlikView: Input Box Not Accepting Values

I created a variable vAverageSalary and an input box which serves as a place to change the value of the variable (variable is defined as money). The problem is that nothing happens when I enter numbers in the input box for the variable. Additionaly when I check the value in the 'Variable Overview' for that varable, I see nothing. Even if I try to define here any value for the variable, nothing changes. And the third option I tried was to define any value by going to the 'Properties' of the input box and entering any value in the 'Settings for the Selected Value' (Tab - 'Constraints'). Even when I enter a value here, nothing happes - the system simply ignores everything I enter.
How can I make an input box to take the value I enter in it?
UPDATE: It seems that the problem is when I define the variable inside the input box as 'Money' - I can only set velue when I type for example '121,00 €'. However if I make a text box and try to write out the value of the variable, I get the message "Error: Garbage after expression ','". The input box takes the values in that format, but the output is garbage. And if I type for example any number without '€' sign, than input box ignores my input and gives me the previous value... Why?

Setting field of Access table using VBA from form

I'm trying to set a value of a field from a subroutine which I'm calling from an event handler. I'm simply doing width = 5
However, the field value isn't changed. However I can do height = 5 and the field value is set as expected. The field value for width remains unchanged at 12186.
I've tried changing the field name to image_width to no avail.
The form has neither controls height nor width.
What am I doing wrong / why is this one field not changing. I've tried deleting the field and recreating, and I don't see anything on this field that limits the setting of data.
Every form has an inbuilt property .Width so you can't use that for a field name.
A form doesn't have .Height, since this is a property of the form sections.
image_width shold work, though. Are you sure you edited all relevant settings?
i.e. Table field name, form field Name, form field Controlsource, VBA code?

Problems with Report Variables

I'm new to SSRS 2012 and have a question about variables. I have a report that retrieves order and order line information from our database (order #, order line #, item, quantity, etc). I need to add a textbox to the footer of the report that can only be displayed for certain items (i.e. if item # equals "123" then show textbox, otherwise hide it.
I added a report variable called 'ItemExists', and unchecked the read-only flag, and set the default value to 0.
I then added an expression to the textbox on the report footer to show it if variable=1, and to hide it if variable=0.
I'm trying to add a textbox with an expression to the body of the report (same group as where the item # is displayed), but I'm unable to get the report variable to update properly. Here's what I tried:
=IIF((Variables!ItemExists.Value = 0) and (Fields!item.Value = "123"), (Variables!ItemExists.SetValue(1)), Nothing)
This works if the value of the item is 123, but if the item is not equal to that value, it still sets the ItemExists variable to 1.
The reason I'm checking to see if the variable is equal to 0 is that there may be multiple lines in the report, and if any one of the items is a match, I want the variable to be set to 1.
I'm not sure if I'm way off track here, but if you could provide any assistance on the best way to achieve this, that would be great.
Thanks in Advance.

change value of field dynamically (OpenERP)

lets say I have a char field under osv.osv_memory
I generate a dynamic form (in "dialog" window) via the fields_view_get method containing this field.
During the generation of the dynamic form, how do I set the value of this field so that when the form is displayed it will contain this value (the value itself depends on the type of processing).
default_get works but only on initialization.
I can change attributes of the field such as readonly, string etc...
But the value itself need to be able to change.
If your osv.osv_memory object is opening from osv.osv, then first create a record of osv_memory object and try to open this record in the wizard. you will not need the default_get function now to load the data to the wizard