Hi,
I have created DEPT and EMP form as master-detail. Now based on Deptno# i want to print data in HTML Based. In this regard have following query if you please advise.
- Where to Write HTML Code
- How to call it at Button so above code Print the Report
- Is there any tool where i can execute the report data before printing, like for report result first we develop query in sql, is there any tool for testing.
Thanks.
You can use PL/SQL dynamic content to write HTML code on the Oracle Apex page. To do this, follow these steps:
Create a region on your page and set its type to PL/SQL dynamic content.
Then in the PL/SQL code section, you can write the code using the htp.p() method. Below is an example:
Output:
This is wonderful way to run report as per our need. However, i also ran this in pl/sql Tool but no result is appearing.
is there any specific command to be execute before to see results.
Secondly, how can i see this query results in the form of reports so user can print from application.
Thanks.
You try the above example in Oracle Apex, and it will print on the page. There is no need to specify any other command.
But if you want it to work as a report, you should create a classic or interactive report.
Dear Vinish,
Actually the purpose of that process is to design in form based layout and can print as well.
Below are the similar kind of link in which they have developed report HTML base and print.
I want to print data in similar way, Sorry i posted some other forum link.
http://www.erpstuff.com/forums/viewtopic.php?f=48&t=10906
Thanks.
I checked the link. It is doing almost the same thing.
Without trying the example (suggested above), how can you tell me that it is not working?
I have tested the PL/SQL dynamic content code, and it is working properly. You try the same code in Oracle Apex and tell me if it is not working.
And to print the data, you can use the below JavaScript command:
Hi,
What should i write in Procedure ” window.print() “.
Can you please guide on this.
Thanks.
Create a button on the page on which you are writing the PL/SQL dynamic content. Then create a dynamic action on the button to execute JavaScript code and add the following JS code:
That’s it.
Hi Vinish,
Can you please elaborate where i have to write pl/sql code which you mentioned.
Setps
1.Create Dynamic action
2.Set Execute Java Script Code
This statement placed at Code filed window.print()
Now am not getting where have to place plsql code. Please elaborate further.
Thanks.
3.
Create a region, set its type to PL/SQL dynamic content, and then write the PL/SQL code into the PL/SQL code section. Below is the screenshot:
Hi Vinish,
Thanks this is working perfectly.
One more thing which is pertaining to the link which shared, the same po header an line code placed in same way as you shared but that’s not appearing.
Can you please guide on this as well.
Thanks.
I didn’t get it. Which po header code?
I followed the same steps for Pl/sq data in order to be populated through Pl/sql Region.
Now i am trying to run below code according but not showing the result.
http://www.erpstuff.com/forums/viewtopic.php?f=48&t=10906
That source program is not using the htp.p method to write the PL/SQL code. The code should be in the format I given the example.
You will have to convert that source code to print using the htp.p procedure.
Hi,
If use your code in pl/sql which shows data in tabular form. However, the link which shared with you have an example of printing date in Form based layout. This template use for reporting purpose as well.
Thanks.
That program I wrote to give an example only. You can choose any layout to write on the page using this method.
Thanks for all.
Last thing regarding this, shall we call image in the Pl/sql which you shared.
Please share any link where have a detail information related to report printing.
Thanks.