PL/SQL Content to PDF print in Oracle Apex 5.1.3 - oracle

I designed invoice by PL/SQL content with HTML and CSS but I can't set up properly page. And I can't print in PDF format.

If you just started with Apex, perhaps you'd rather use its Wizards which will help you in creating process. Although you can create a page using HTML commands - why would you?
Invoice is, I presume, stored into a table. If that's so, I'd suggest you to create a "Report with form on table" page - it'll create
interactive report, which will let you browse through all invoices you created
form, which will let you create new invoices, update or delete existing ones
Try it; it shouldn't be difficult at all.
As of printing reports in PDF format: here's what I (we) do:
I create a report using Oracle Reports Builder
put a RDF onto our IAS (Internet Application Server) machine
place its entry into the CGICMD.DAT file
call the report from Apex using a dynamic action on a button, using 2 steps:
PL/SQL, which composes URL (and adds parameters' values)
JavaScript, which calls the report (using window.open)
I understand that not everyone has the IAS up and running; it isn't trivial task at all. Quite some time ago, for my own amusement, I installed Apache Tomcat and JasperReports, just to see if I can make it work. I did. However, as my company uses IAS & Oracle Reports, I abandoned that approach.
Someone else might have other suggestions; wait a little bit for them to answer.

Related

How to make a Download BLOB column in Classic Report that has a Web service as Source (using SQL)

I am trying to consume my own file REST service in Oracle Apex (v.19.2) using apex_web_service.make_rest_request in a WITH_PLSQL call as the Classic Report source.
My POST and GET REST calls works fine, but I fail to define the parameters for the 'Download BLOB' column in my Classic Report, such that users can download files.
I am currently clueless to what to do...
(I have no problems with all other processes with consuming numerous other ORDS REST services, it is just the files download that is the problem). Thanks in Advance!
The declarative BLOB download in classic (or interactive) reports do not work for reports on top of Web Source Modules. The reason is that the BLOB would first need to be downloaded to the APEX engine, and from there to your browser - which is pretty inefficient.
In most cases, there are separate REST endpoints to download the actual file contents. If these endpoints can be accessed from the browser, I would simply build a Link Column, in which the link to the "file download" button is constructed. When the end user clicks that link, the browser downloads the file, bypassing APEX.
If that does not work and you need to download the file to APEX, and from there to the browser, you would need to use custom PL/SQL code. This article illustrates this nicely (see the "Download" section):
https://blogs.oracle.com/oraclemagazine/better-file-storage-in-oracle-cloud
I hope this helps

Oracle APEX simple crud database app

I am very new to oracle pl/sql and APEX and not familiar yet to it.
I want to make a simple CRUD project using the Oracle's Application Express : https://apex.oracle.com/en/ , but unfortunately I could not find any example or documentation. I got some courses but the versions of apex differ and a lot of things have been changed so I am not able to implement what I need.
I have created a simple new table just for practice in the following way:
Sql Workshop -> Object Browser -> Create Table
And I have a very simple table: New_Table with fields: id (INTEGER), name(VARCHAR2)
Now I want to make a simple crud website for this table, but cannot understand how the forms work.
I created a database project: App Builder -> Database Applications -> Create and got a simple web project with a blank page.
Questions:
How can I create the form and bind it to the table?
If I understand correctly, for editing a record, I should pass the id to the next page, how can I do it? or how to implement the edit page?
How can I get the data from form fields, validate it and execute an sql query using that data?
Thank you very much!
Easiest way to start is to click Create Page, choose Form, then Form on a Table with Report. Follow the wizard to select your table and columns, and viola.
It will create two pages - a report page and a single-record edit page, with navigation links between them. You can then examine the regions, items, buttons and page processes on these pages to learn how they work.

How to download multiple BLOBs(Images/Files) at once in Oracle Apex 5.0

I was wondering if there is a way to download all the blob content from a table at once on the application side (via a button click ideally).
I could get it to download BLOB files/images on a record by record basis both on the interactive report and on the form using different approaches. But getting more than one at a time seems to be a rather tricky for me.
I am using
Oracle Apex 5.0.4. and
Oracle Database:12c.
Any help would be greatly appreciated.
A few links I went through:
http://docs.oracle.com/cd/E14373_01/appdev.32/e13363/up_dn_files.htm#CHDECDAJ
http://joelkallman.blogspot.be/2014/03/yet-another-post-how-to-link-to.html
No you can't download multiple files when clicking on a "download Button".
What you can do is build a zip file (in the server) with your selection of BLOBS and that is the one to download.
UTL_COMPRESS is the Oracle Package to do that.
An example on how to do it is here: UTL_COMPRESS, gzip and zip
Another one is the AS_ZIP: AS_ZIP
and ZIP_UTIL_PKG: ZIP_UTIL_PKG
I have recently published a solution for that using 4 steps:
Create a button to submit the page;
Create a page process that creates the blob of a zip file, using apex_zip API and stores it in a collection (using apex_collection);
Create a branch to the same page, calling an application_process=something;
Create an Ajax Callback called 'something' that prompts the user to open or download the zip file using WPG_DOCLOAD.download_file.
Take a look and let me know: https://apexcornies.wordpress.com/2020/04/04/create-a-download-zip-button-in-oracle-apex/
Cheers,
Pedro

Oracle APEX 4.2 How to store string and access from any page?

I'm a complete noob and have only been learning this since last night.
I have an APEX application with a few forms and reports that I have managed to get working correctly if I provide the exact SQL statement in the source box. What I want to do is be able to set a variable that I can access from any page.
I want to be able to return its value to use in my SQL source clause in my forms when the pages load and I also want to be able to assign its value maybe via a process, branch or button (i'm still learning what they are propperly) on any page.
I've been at this for hours now and the tiny amount of help I can find on this is completely beyond me and its driving me mad, so if anyone can help me figure out how to do this it would be hugely appreciated.
You can create one application item (Shared Components -> Application Items) and then set it from your PL/SQL code using APEX_UTIL package (apex_util.set_session_state('TESTE', 'Hello').

can the asp page be auto refreshed trigger by database change using sqlCacheDependency

I've spent 2 whole weeks in googling some working sample on this. I was almost kind of knocking my head against concrete wall....deeply suffering until now.
Ok, I have a simple web page to display two columns, say, Msg & MsgID, from a table named MsgLog in MS SQL Server. I have stored procedure that will insert new Msg entries into the table. (in future, possibly could update existing entries)
My desire is, whenever there is a new msg entry inserted, or an existing msg entry got updated, the web page must automatically reflect this change without user clicking any page button, or without any coded timer function, otherwise the web page just leave as it is. The page refresh can only be triggered by database table change.
I read lots of internet posts regarding using SqlCacheDependency to achieve this, but none provides complete steps and codes. I tried to tweak their sample codes in my project, but none of work successfully, as I predicted. Or is it impossible to implement this?
My development environment is: Visual Studio 2010 professional, using ASP.NET FRAMEWORK 4.0, MVC 3 application using C# with embedded sql statements with SqlCommand object, database is MS SQL Server 2008 enterprise editon, IIS express.
Can someone genius to show me complete workable detailed steps from sql server setting, to coding. Functionality is just as simple as display rows with 2 columns from one table in a web page, and reflect changes realtime if and only if the table got updated or inserted. Not using polling or timer techniques; Not using LINQ to SQL, but using SqlCommand.
thanks millions of thousannds.
This in itself doesn't have to do directly with SqlCacheDependency.
You are wanting to do something that until only recently was really done with timers/polling unless you were one of the big players (ie google chat) Once your server notification event is raised then use SignalR to notify the clients of the change, so it requires an 'open' connection. Otherwise polling/refreshing is your only option. I haven't used SignalR, but I do know its really your only option now to do what you want. There have been some other projects in this field, but this is your best bet by far.
https://github.com/SignalR/SignalR

Resources