How to send report directly to the printer? - oracle-apex

I am using Apex 18.2. and ORDS as a printing server.
I have a master-detail page for selling items with a form on a table as the master region and an IG as the detail, joined to each other through assigning the PK to the FK IG's column.
There is another page with a report that can be queried through number of page items to get the documents with items sold in the previously mentioned master-detail page.
Whenever a user creates a document and submit the page, I will need to send the data of that document directly to the printer.
I mentioned the report page because I thought redirecting to it and assigning the PK to the corresponding page item could be a suggestion. But I know that I can create a shared component> report query too. But I do not know how could I send the data directly to the printer in either way.
I do not know if the report type - IR, CR or IG would make a difference. That's why I just referred to "report". But I'd need to know how it could be done with all types of reports.
Here is how a real-world scenario would look like,
You enter a supermarket, buy some items, go to the cashier, pay for what you've bought and get a receipt. The receipt is printed when the cashier saves the invoice.
I know this is not how web apps work, but this is the task I am facing.
I can think of branching to the report page after the invoice is saved and setting the PK value to the corresponding page item in the "search criteria" region to get the corresponding data then execute "window.print()". But there will be two problems then. 1- criteria region would be printed too, unless I hide it with a dynamic action or else. 2- The "print dialog box" of the browser will be displayed.

APEX 20.1 added native support for PDF printing of Interactive Grid regions. See this video: https://www.youtube.com/watch?v=e1yIFcEdW_o
If you can't upgrade, or if that support isn't sufficient for your needs, I suggest taking a look at APEX Office Print: https://www.apexofficeprint.com/index.html

APEX Office Print(AOP) can provide you the right solution.
Please try out the solution posted in the below link.
http://dgielis.blogspot.com/2020/01/print-pdf-from-oracle-apex-to-local.html
Few more examples:
How to print to an IP printer:
https://www.apexofficeprint.com/ords/aop_web/r/aop_sample_app_web/5034?session=13740999314649
How to print directly to a zebra printer
https://www.apexofficeprint.com/ords/aop_web/r/aop_sample_app_web/zebra-printer?session=6208952429228
(OR)
https://dgielis.blogspot.com/2020/01/printing-to-local-zebra-printer-from.html
If you are redirected to the Home page,
-> Click on examples in the left side menu.
-> Click on Print(highlighted in yellow).

Related

Extjs 6 State management issue with touch devies

I am working in extjs6. I have grid with several columns as well as settings button on grid which hides/shows selected columns on click of apply button. I have implemented state related functionality for each column which will helps to decide which columns to be shown initially when user logs in.
Suppose i have grid with columns as-
{Id,
Name,
Description,
Author,
CreatedOn,
ModifiedOn}
I have selected Id, name and description columns. So as per my functionality, when i log out and again logs into my application, Code checks state of columns and displays only these three columns. Everything is working fine if i use application on Desktop/PC
But when i am performing above functionality with mobile or tab like touch devices, something weird happens. Using mobile if user A selects only some of columns of grid and get logout and log in again..He is able to see only selected columns as per requirement.
but now if i get login with same user A but on desktop/PC, grid is retrieving some wrong state resulting into display of all available columns. [Grid should display only those columns which user had selected before last logout].
So can someone please help me to know why this is happening.
ExtJS is saving state on the client side - meaning, if you login on a mobile phone, the state will be saved only on the phone in the browser.
If you log in on the Desktop, the state will be saved only in the browser with which you visited the site.
The state can be saved to Cookies, or better, LocalStorage
If you want to save states across devices, you need a server-side solution, you can check for one here

How to get a list of all page-level APEX_ITEMS in the current page?

I have an Apex application that is quite large. The need has come up to store detailed usage logs of this application. The information on APEX_WORKSPACE_ACTIVITY_LOG is not enough, because I need to know what queries each user runs on each page.
My first thought was to get the actual Oracle query logs (V$SQL and such), but they provide no information on the user (as far as the database is concerned, all queries are made by APEX_PUBLIC_USER). I have some information about the user on V$ACTIVE_SESSION_HISTORY, but that's incomplete because it stores samples of active sessions and their SQL queries at 1-second intervals, so I miss too many queries.
So now I'm off to implementing application level logging. The "right" way to fo this would be to go through all the pages in my application and create a logging process to store the relevant information for each one (username and some page items). But I wonder if there might be something simpler that does the trick.
If I understand correcly, "application processes" are run by every page in the application. So if I can get an application process to iterate over the list of page items, I can store them all in the database and be done with it. Something like
for item in page_items {
log(username, item_name, item, date)
}
Can this be done? Or maybe the information I need is on the database already and I don't see it?
You can query the metadata tables to get all items for a specific page and then use that to get their value.
select item_name, v(item_name) item_value
from apex_application_page_items
where application_id = :APP_ID
and page_id = :APP_PAGE_ID;
That will capture all items on the page. Don't forget that if you use items on Page 0 (Global Page) you may want to query that page too.
Additionally, you may want to capture application level items too.
select item_name, v(item_name) item_value
from apex_application_items
where application_id = :APP_ID;

refresh of one report region in apex

I have page with 10 clasic reports and 10 form region (one for each report). On each form region is button with Dynamic action witch
insert data in table. My problem is how to refresh just one report after I insert data so that new data is shown in report. I tried to add another
true action in Dynamic action (refresh region) but it has no effect. Anyone had any idea? Apex version is 4.2
Thanks in advance.
One thing you can do is.
Assign Static ID to your every reports, Like 'myReport1', 'myReport2' or what ever you want (ignore if you already did).
on each button click when you are updating database,
add one more True Action with Execute JavaScipt Code in your existing Dynamic Action.
and put $('#myReport1').trigger('apexrefresh');
repeat this for all of your Reports with relevant Report ID.
This is a frustrating issue and one which I have hit a few times...
Things to check:
Report region is region type: SQL query (PL/SQL Function body returning SQL Query - cannot be refreshed using a standard refresh dynamic action).
Ensure that: id="#REGION_STATIC_ID#" is in the Report template you are trying to refresh
Navigate to: Report Attributes > Layout and Pagination: ensure that "Partial page Refresh" is set to Yes.
Ensure that: any page item values which your SQL report is based on are submitted, these can be entered under Region Source in the "Page Items to Submit" box.
In the "Attributes" in "Pagination", "Partial Page Refresh" should be "Yes". otherwise classic report does not refresh.
Check if you have selected the Template "Standard" in Section "Appearance" of your Classic Report. This solved my problem with refreshing in Apex 5.

combine multiple sharepoint lists into one

I'm working with SharePoint 2007 and a group has asked me to help with managing their sites. They set up multiple sites (one for each team = 50 or so teams >_<) and each team has their own copy of the same list created from the same template.
Recently they decided that collecting the data from 50 different sites is too much and want to combine all the lists into one at the top level but they don't want all that data left behind on the old lists (1 per site) they want it all moved into the new list that will also use the same template to be created.
I tried exporting one of the sub-site's lists to Excel (2010) and copying it over into the new master list's empty exported to excel list and then using the "Export Table to SharePoint List..." option. Each time I try, I get an error "An unexpected error has occurred. Changes to your data cannot be saved."
I thought this might have to do with the Path field that shows up in the Excel spreadsheet versions of the list data so I modified it to what the new master list should have but no luck.
Any ideas?
Thanks for your help :)
I don't know what rights you need to do this, but go to each site and do the following instructions:
Click on Site Actions
Click Site Settings
Click Manage All Site Settings
Under the Site Administration Group, click Content and Structure
A window comes up that looks like Window's File Manager. You are in the current site, but you can see that you can browser to other sites in your site collection from the left panel.
Locate the list you want to copy items from and click the name. You will see all the items, or at least in pages of 100.
Change the paging quantity from 100 to 1000 in the top right, where it says "Show 100".
Select all the items you want to copy. There's an icon that looks like a stack of papers, to select all items on this page.
Click Actions in the toolbar, then click "Copy...". A dialog will come up of the current site collection.
Choose the destination then, click Ok.
Repeat this until you're done copying all items from the list.
Be patient while the copy process completes, then switch to the other 49 sites.
You cannot copy from one site collection to another. You can copy between subsites or sister sites.
If you can't see the Content and Structure link in the Site Settings page, use the 12 hive URL:
http://sitecollection/_layouts/sitemanager.aspx
You'll have the items copied in no time without the help of IT/development.

Oracle APEX opening a already saved user report

I have some saved reports for a page say Employees page. For example I have saved reports(created by applying some filters, press Save and give name) like Report_employees_for_dept_10,Report_employees_for_dept_20, Report_employees_for_dept_30
I want to have 3 buttons in another page for each of above report. When I press button related to "Report_employees_for_dept_10". It should open the saved report named Report_employees_for_dept_10. I can go to the Employees page. It is showing the last viewed saved report not the one we want.
Can you please explain me how to get the control of IR reports and open the right report.
Thanks,
S.Ravichandran
See this question: Link to a saved interactive report
Summary: no, it is not possible to link private reports. Unlike public reports, there are no aliases and thus no way to select a private one through a url. You would need to make your reports public.