I am trying to set selected records in apex Interactive Grid following documentation
API documentation but it does not work.
I have an array of records and when I am trying to set selected records using
apex.region("grid").widget().interactiveGrid("setSelectedRecords", records);
or
grid.setSelectedRecords(records);
when I check it via console the output is like below but the rows are not selected (selection is empty as I would pass the empty array.
console output image
I am using APEX 19.2, anyone faced a similar issue? Any suggestions?
Try this:
apex.region("gridId").widget().interactiveGrid("getViews","grid").setSelectedRecords(records, true);
Perhaps must be the record between '[]' example:
var record = apex.region("gridId").widget().interactiveGrid("getViews", "grid").model.getRecord("4551");
apex.region("gridId").widget().interactiveGrid("getViews", "grid").setSelectedRecords([record],true);
Related
I have an interactive report and the goal is to let the user export the data but without 1 column.
What I tried for the column in question:
1) Server-side condition - Request is NOT contained in value; Value - CSV, HTML
2) NVL(:REQUEST,'EMPTY') not in ('CSV','HTMLD')
The column I am trying to not export is a link with an icon. I tried changing it to 'Plain text' but to no avail.
Oracle Apex version 21.2.0
I managed to accomplish it using this:
instr(nvl(:REQUEST,'~'),'HTML') = 0 and instr(nvl(:REQUEST,'~'),'CSV') = 0
The approach described earlier worked for me with APEX 21.x.
However in APEX 22.1 the CSV download seems to be different; is this correct? For me the values are no longer evaluated again during download and thus I can not control this (we have a server side condition for that that accesses a page Item which we fill with a logic evaluating :REQUEST).
I have finally been able to get all the columns I wanted to show up in the data environment and have added an additional command to try and pull those values from a local DB into the grid.
The issue I am running into is the values are not appearing inside my grid.
I have it running the correct command to pull in the data I believe: I took that same query and ran it on the local DB and it does output the values I expect. I then clone the Environment command to a record set.
If gbEnableD2D Then
If DataEnvironment7.rscmdMeterReadsDistinctD2D.State <> adStateOpen Then
DataEnvironment7.cmdMeterReadsDistinctD2D
End If
Else
If gbEnableD2D Then
Set rsDevices = DataEnvironment7.rscmdMeterReadsDistinctD2D.Clone
Else
' Display all the columns I want to display
From there I can determine the columns do show up as intended but in the display as well as using the watching system I can not access the MeterReadsDistinctD2D nor does the record set contain the values but does have the fields I expect.
Any thoughts on to why this would occur or how I could go about tracking down how to determine how I can see if these values are in my data environment or if they are in there why they are not being passed to the record set?
You need to make sure the TrueDBGrid is in Bound Mode, then bind it to a Data Control and set the Recordset/Recordsource of the Data Control to your SQL Query. Make sure the ConnectionString of the Data Control successfully connects to your database.
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.
When I issue a query like select * from city; using oracle sql developer in mac I get the output that is not aligned and it is very hard to read. How do I get the grid view and set it as default?
Sounds like you're getting the script output. You can have that formatted nicely by using SET SQLFORMAT ansiconsole, we'll make the columns line up as nice as possible based on the size of the display.
But if you want the data back in a grid, use Ctrl+Enter or F9 or the first execute button in the toolbar to execute.
This will get you the output in a grid, like this:
I talk about both executing as a script or statement here.
If your issue is with formatting, you may want to look at this link
If your issue is with records not getting inserted, please note these.
Records inserted in one session will not be visible in another session unless they are committed.
If you are checking the count in the same session where you inserted the records, then check for errors in insert. Add a show errors command at the end of your script, "path_to_file.sql" to check if any errors occurred while inserting the records.
Hope this helps.
I am using oracle apex 4.2 and was wondering if there is a special way to link to a certain default report that I created. So for example below I have made Region Name Pie report along with the default. I changed the aliases to 1 and 2 respectively. I tried using the link example but the synatx is malformed, so I tried another option below.
Here, I tried to set the Report ID Item to a variable that I set as I move to this page. And I looked at the session and this value is being set to 1 as needed(I assumed it was the Report alias I needed to set the value to).
Are these methods viable in Oracle or am I doing anything that is noticeably wrong? Thanks.
Edit: Error for Syntax: