Expression not working in the OBIEE filter - obiee

Date <= CASE WHEN UPPER(DAYNAME(#{CMA}{date '2017-09-05'})) = 'SAT'
THEN TIMESTAMPADD(SQL_TSI_DAY,2, (#{CMA}{date '2017-09-05'}))
ELSE (#{CMA}{date '2017-09-05})
END
I'm using the expression in the filter as an SQL Expression. When I go to edit the report through catalog am getting data in the results tab. But when I run the report through dashboard it throws error because of this filter. Is there anything wrong with the expression?

That means that the dashboard must be filling the variable wrong. When you run the analysis (not "report") from the catalog is runs precisely as configured. In a dashboard context you have to watch out what the prompts fill the variable with.

Related

How to solve Unable to find item ID for item in application in Oracle Apex?

I have a public website made using Apex 21.1.3
When a user shares a page of my website, let's say on facebook, Facebook adds "?fbclickId=something" to the URL.
My app then crashes saying : Unable to find item ID for item fbclickId in application.
Apex thinks the user is trying to set an element that does not exist on the application.
I have url processing layer using htaccess that formats the urls before sending them to Apex in a reverse proxy. I could say let's ignore all what comes after a question mark "?" but in this case I wont be able to set any application item value neither. So that's not possible.
Does anyone have an idea how to make Apex ignore setting a parameter if it doesn't exist ?
Using google for example :
This URL https://www.google.com/?anyparameter=anyvalue will always resolve to https://www.google.com
Thanks
Cheers
I'm not aware of any way to ignore invalid parameters, but you can make the error a bit nicer for the end user.
Create a custom apex error handling function. The only difference with standard error handling is that the error with code WWV_FLOW.FIND_ITEM_ID_ERR has a custom message and no additional info. Change the string "Invalid url arguments" to something more relevant for your business case.
create or replace function apex_error_custom
(
p_error IN apex_error.t_error
)
RETURN apex_error.t_error_result
IS
l_result apex_error.t_error_result := apex_error.t_error_result();
BEGIN
l_result := apex_error.init_error_result ( p_error => APEX_ERROR_CUSTOM.p_error );
IF p_error.apex_error_code = 'WWV_FLOW.FIND_ITEM_ID_ERR' THEN
l_result.message := 'Invalid url arguments';
l_result.additional_info := NULL;
END IF;
RETURN l_result;
END apex_error_custom;
Change the application definition to use the new error function:
Application Definitions > Error Handling > Custom Error Function. Note this affects all errors in the application.
An additional way to make the error nicer is to change the default error page to use a defined template (Shared Components > Themes > your theme > Component Defaults > Error page). Note this affects all errors in the application.
Here is the solution I came up with.
I couldn't find any way to ignore unavailable fields but found a trick to avoid sending them to Apex, hence escaping the error.
In the middle tier (nginx, apache, IIS) add the following logic :
Whenever there are two question marks, ignore the second one part:
For example : someApexAppUrl?Parameter=value?fbclickid=something
Should become : someApexAppUrl?Parameter=value
Whenever there is a parameter added to the url for example
someApexAppUrl?Parameter=value
Check the parameter name against
Application Items with a protection level of Unrestricted, Checksum Required - Application Level, Checksum Required - User Level, Checksum Required - Session Level
The hard coded list of the default Apex urls parameters which are : session, request, clear, debug, printerFriendly, trace, timezone, lang, territory, cs, dialogCs, x01 according to this article
Application page items with a name pattern P99_Someting
Whenever a parameter is not among these three categories, ignore it and don't send it to Apex. This way even if facebook adds something like ?fbclickid=xxx the Apex App will still work nicely.
You can add the item to your application to avoid getting this error message.
Create an Application Item (under Shared Components) called FBCLICKID. Set its Session State Protected to Unrestricted.

Item missing from WebList

I am writing auto test scripts in QTP (UFT).
I have multiple columns in an external datasheet which could contain data or be blank. I was trying write some code, that if it was blank to click a submit button, if not blank then add in the fields. Please see code below:
If IsNull(DataTable("Available_Qualifications_1", dtLocalSheet)) = False then
Browser("Create Qualification Types").Page("Create Qualification Types").WebList("qavailable").Select DataTable("Available_Qualifications_1", dtLocalSheet)
Browser("Create Qualification Types").Page("Create Qualification Types").Link("Add Qualifications").Click
ElseIf IsNull(DataTable("Available_Qualifications_1", dtLocalSheet)) then
Browser("Create Qualification Types").Page("Create Qualification Types").WebButton("Submit").Click
End if
However, I receive the error below:
Cannot identify the specified item of the qavailable object. Confirm that the specified item is included in the object's item collection.
Line (16): "Browser("Create Qualification Types").Page("Create Qualification Types").WebList("qavailable").Select DataTable("Available_Qualifications_1", dtLocalSheet)".
What UFT is saying is that you're trying to set a value into the WebList which isn't one of the WebList's options.
Try outputing the value to see if UFT is correct, if it is then correct your test (by entering the correct values in the data table). If it's not correct you can try using the index by using the Select "#3" syntax (and report the problem to HP's support).

Coded UI test failing in Visual Studio 2013 when entering a blank value from a csv into a WPF data grid

I am running a coded ui test in Visual Studio 2013 into a WPF data grid using values from a csv file. When I have a blank value in the csv file eg ,, it is working fine for input fields but when it comes to entering the empty string into a field on the data grid the coded ui test fails with the following error:
An exception of type 'System.ArgumentNullException' occurred in Microsoft.VisualStudio.TestTools.UITesting.dll but was not handled in user code
Additional information: Value cannot be null.
When I run the test manually I can submit the form without this value so I know it is not mandatory on the UI, the code just seems to be falling over if a value is not sent. If I enter a value on the csv the test will run but I deliberately want the field to be empty.
Has anyone come across this problem before and if so is there a way I could either adapt the csv or the code to get this to work? I have also tried ,"", and this did not work either.
Thanks
I think the way you're doing it (using the isNullOrWhiteSpace method to determine if you should skip entering the value) is the right way. If you don't want to write that each time you're entering values into the field, you could write an extension method instead:
public static void EnterValue(UITestControl control, string inputString)
{
if (!String.IsNullOrWhiteSpace(inputString)
Keyboard.SendKeys(control, inputString);
}
And then just call that when you want to enter text:
string csvValue = /*value from the .csv file*/
StaticUtilityClass.EnterValue(myControl, csvValue);
Not a ground breaking change, but it would cut down on the number of times you have to write that if-statement.

Why a default javascript value for a BIRT report parameter is not evaluated in the deployed webapp?

I want to add a default value as javascript for a report parameter so I did the following (in the eclipse birt designer):
The problem I have is: when I deploy the app (that contains the report) the javascript is not evaluated:
However, when I preview the report in the birt report designer it evaluates the javascript default value:
Here is the code that I use (filtered to have only the relevant stuff):
IReportRunnable design = getReportRunnable(pathToTemplate);
IRunAndRenderTask task = _birtReportEngine.createRunAndRenderTask(design);
task.setRenderOption(options);
task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, ReportEngine.class.getClassLoader());
task.setParameterValues(parameters);
task.validateParameters();
task.run();
The question is: did I miss something? Should I add an option somewhere that forces the evaluation of the default javascript expression?
The code you show is the code for creating and rendering a report but it's not the code for displaying the parameter form.
Are you using the Birt-Webviewer or a self developed Web App?
In the latter case and if you retrieve the default parameter values per org.eclipse.birt.report.engine.api.IScalarParameterDefn.getDefaultValue(), the javascript expression will not be evaluated.
To get default paramater values with expressions evaluated you have to use the engine task IGetParameterDefinitionTask and there the method org.eclipse.birt.report.engine.api.IGetParameterDefinitionTask.getDefaultValue(IParameterDefnBase arg0).

Oracle reports-Passing null parameters to RWRUN

I have a set of run-time parameters in the parameter form in oracle reports that have the "Restrict List to predetermined values". I am able to run the report in the report builder without supplying any value to these parameters. But during the batch run using RWRUN, I am getting the following warning and the report is not generated.
The value of restricted LOV parameter P_PARM1 is not among the selectable values
The above error occurs when I omit the parameter P_PARM1 altogether in the paramter list of RWRUN as well as when I supply it without giving any value to it(implying null) like below:
rwrun.sh <other required parameters here> P_PARM1=
Any help would be much appreciated.
Does rwrun.sh ... P_PARM1='' yield anything different?

Resources