Delphi DBText displays #### instead of number - oracle

I am using 3 TDBText components on my form and using the following SQL to populate them:
TO_CHAR(myField, '0000.00') "AMOUNT"
where myField are 3 different numeric fields.
One of them is displaying correctly (eg '9983.66'), but the other 2 are displaying as '#######'. I've checked the properties for each DBText and they are identical (apart from the field).

Sorry, just figured it out. There weren't enough zeros in the mask to accomadate the number. I've changed the format to '000000.00' and it's working fine

Related

how to change columns position in vb6?

I am working with a spread designer in visual basic 6 and am looking to change the display index of my table. I am adding extra columns and I need to rearrange them to match another form.
I am using visual basic 6 with spread designer 6.0
I have tried the below when loading the form:
lstTheLines.Col(1).DisplayIndex = 1
lstTheLines.Columns(25).DisplayIndex = 2
does anyone know how to do this without having to delete and re-add all columns?
The best way I found so far was to add the columns in the place I want using the spread designer and create an Enum in the code for each column index. This way I can give the columns a name and use that instead when populating the data. The benefit to this is that I can now rename the columns or add new ones and I just need to change the names around in the Enum given that the column type is correct.

Crystal Report not filtering SQL records based on selection formula

unfortunately I'm not an expert of Crystal Report, so I'll post here my question hoping for any help about my issue.
I want to display inside my report the result of a filter on a SQL RecordSet; this RecordSet is looked up from an a single table, of which I want to show some fields of my SQL table, while the filter I want to apply is based on a field parameter (defined static) that I'm trying to set programmatically.
Here below I attached my code where I'm applying the record selection formula, I tried also hard-coding the value instead of passing it through a dropdown selection:
ReportDocument RPT_Doc = new ReportDocument();
RPT_Doc.Load(RPT_Path_Name, OpenReportMethod.OpenReportByDefault);
ApplyConnInfos(ref RPT_Doc);
RPT_Doc.SetParameterValue("data_riferimento", "20161001");
RPT_Doc.RecordSelectionFormula = "{viaggi.data_part_pre} = '20161001'";
crystalReportViewer1.ReportSource = RPT_Doc;
In the first image attached you can find the field parameter definition, while second image is the record selection formula I defined inside my report:
The report always shows all the records of my table (more than ten thousand rows), instead of displaying a filtered RecordSet. The odd thing is Preview function from Visual Studio works like a charm; it prompts the field value, once I confirm the value the viewer displays the report with the rows filtered as I expect..
What am I missing from report/C# program configuration to make the record selection work?
Thank you in advance for any suggestion you can give me :)
Leonardo
Ok, finally we got the solution to our issue.
We found the CrystalReportViewer object used to display generated reports has 2 different properties, SelectionFormula and ViewTimeSelectionFormula; both has default value set to empty string.
Below I attached the picture of .Designer.cs file with the 2 properties valued:
We commented those 2 properties and the selection formulas and field parameters applied through code / report designer worked again.

Cognos report number formatting into 1 decimal form

I have two different reports in Cognos.
Whereas in both the reports I have the field called "%Target".
In the report 1 the field is directly coming from db and in the report 2 the field is formulated.
My question is for e.g. if a value is 98.47% (directly coming from db) in report 1 where after applying formatting it give me the rounded value as 98.5% but however in report 2 (where the field is calculated e.g. A/B) this value is populated as 98.4%
Can anyone please explain why this happening.
However I tried using ceiling function. But nothing is working on the report.

OBIEE - Showing the Display Value from a Double Column / Presentation Variable

I have a double column laid out as so:
Display Value Code Column
Apr-17 201704
May-17 201705
Jun-17 201706
A 'between values' prompt is setup to show the Display Value and Filter by Column Code, and it's been given a presentation value.
So say I selected Apr-17 to Jun-17, the presentation value displays Apr-17,Jun-17 in the narrative, however I'd prefer it read like Apr-17 to Jun-17
I'm unable to use the SUBSTRING function in the narrative, so I decided to add the presentation value into a column and work from there.
However, once I add the presentation value the Column Formula, it displays the Code Column values instead of the Display Values, so:
201704,201706 instead of Apr-17,Jun-17
Is there a fix for this, or an alternative way of getting the desired formatting?
First of all your filtering seems extremely standard so I question your use of presentation variables in the first place.
If you just use out-of-the-box filter functionality with columns then you can just use the filters view.

How to set global number format in Oracle Apex 3.2.1

I'm having trouble with the number formatting in Apex 3.2.1. NLS_TERRITORY is set to GERMANY, NLS_LANGUAGE to GERMAN. However, the default number formatting is wrong and I would like to fix/change it. I'm wondering why there is an application date format setting but no application number format setting. That would have been really helpful right now. So my question is: how can I set a new number format which will be applied everywhere in my application? Is it possible? If not, what would be the least painful way to to apply the new format mask. I'm mainly concerned with interactive reports. Additionally, if it were possible to change the default format mask for the territory in some configuration file, that would also be an option. Thanks for your input in advance.
Edit:
My problem with the default format is that numbers like 0.34 are being displayed as ",34", but the correct output would be "0,34".
Okay, purely the display then. I don't think there is an easy way to do this for all your fields, but specifying a format mask on those fields, by using for example FM999G999G990D000.
That would be annoying for a lot of fields across the application though, i agree. It is even more annoying when only by specifying a format mask, items are recognised as being number fields. Maybe making a plugin, which is identical to a number field, but with a default format mask may do the trick.
Or query the apex views to find items, then update them (though you will need access to the 'internal' tables of apex, the wwv_* things).
select application_name, page_id, page_name, item_name, display_as, display_as_code, format_mask from apex_application_page_items where page_id = 6
Which you could then transform into an update...
I've nothing else to offer, so far i've always specified the format mask during development...

Resources