Customizing reports for Oracle APEX.

Customizing reports so this is something that we definitely are reports or an object that we definitely or a component that we definitely deal with a lot in our applications right they typically have a lot of data we want to expose that data well the first type of report that would take a quick look at here our classic reports and I mean really they’re just here to display tables views or queries and this was the only type of report available up until apex version 3 dot 1 um and that’s why we kind of get that name classic reports instead of just called reports.

So the idea here is that a classic a classic report and has less functionality than an interactive report but we can add functionality to a classic report and it requires a lot more work so in other words classic reports kind of out-of-the-box don’t do a lot but they don’t provide a ton of features either whereas interactive report out of the box does does quite a bit and doesn’t require much work but sometimes all of those features can be a little bit of overkill I think everyone here is everyone here feel comfortable with how to create a classic report or would you like a demo of how to make one who would like to see who would like to see me create a class report okay yeah everyone here I think is likely very good with this well when you create a report there are two different types of there’s this these terms that you’ll see in the attributes and and it shows up in a couple different places you’ll see and named columns or column names and you’ll see root or you’ll see kind of like generic.

So named first generic what does this even mean what’s happening here well what’s happening is let’s take a look at Mike my temper port and let’s look at a couple of different things so i created my m / port here is in my form but we’re going to go to page five here go ahead and run my page here’s my report and oh I made a classic report or I made an interactive report let me go ahead and make a class report here let’s make a new page it’ll be easier so when you make a so I guess we’re going to see the demo for the classic report anyway when you make a report and actually I’m gonna I’m going to make a report and form just so that i can get the drill down already made to make a form on the table and with the report, so as long as I say with a report then I’ll get that report I’m looking for and all I need to do is say that the implementation of this report.

I want it to be classic okay and we’re going to accept all the defaults here and again I’m going to use the amp table just because it has a lot of good properties to leverage here now it still takes us generally takes a second here to create these pages but it’s still much faster than having to manually make everything and so since I asked to make a form on the table with report what’s going to end up happening is oh I need I needed to bring this up the yellow Edit pencil and there is a way to set up user interface defaults and as far as an apex or they’re called apex builder defaults.

I just don’t know if you can actually have one set for the Edit link but we’re going to take a look at that and I’ll make sure to do that right after I create this form so we’re just accepting all the defaults here just so we get this thing to that and just going to take a couple more clicks and we’re just about there again it’s going to ask us what type of actions we want to do in which columns we want to show all that good stuff alright awesome that’s going to make our new page and the important part here is that the report implementation is classic it should send us off to our report and I run my page and I should do to do there we go have a classic report on my m stable now the expectation there’s an expectation here and that is if i add a new column to my query it should be visible in my report ok.

So if i edit this page and i go to my report and I’m just going to change this lex statement here and I’m going to do a little get a little pop-up and you don’t have an extra column so if you happen to be following along I’ll do something friendly for you we’re just going to select the literal fubar then we’re going to say as fubar okay so we’re adding a new column into my report and the expectation is that apex will display this value so I say okay save it’s gonna you know it’s going to commit that and then run and lo and behold I have a column fubar well how did apex know how to render that extra column right so how did it know just you know where it went and how things were positioned well actually when you make a report.

Let me see if I can find the easiest way to locate this the standard report template that you have is called generic columns or a column-level template and what this means is if you have a generic or column level template basically what that means is the apex just does not care how many columns you have if you add more columns well apex will handle it and so in other words with if you were to look at this template all that’s really doing its defining kind of the outside containers for the report but then it asks before it tries to render a column heading how do i render a column heading well let me make this bigger.

So you can see alright so before i render a column heading what do i do well here’s what a column heading looks like and so your defining kind of a / you’re saying generically this is what this is the format a call what column headings should have and then after it renders all the column headings it’s going to say well before each row I want to make a row element and then every time I go to render a column here’s my column template that I’m going to use so in other words and you’re basically defining a template at the column level and kind of so to speak at the cell level and so apex can just kind of keep generating more columns and rows because it has kind of this very loose definition of what is for how this report should look ok any questions on that a question is should we be following along um you can if you like you do not have to and there’s one thing that we’re going to explore in a little bit not right now but notice that there’s a column template1.

There’s also a column template to and column template 3 and column template for so there are four different types of column templates that you can use and what this means is that this is kind of one of those like really buried features an apex that doesn’t really it’s hard just to stumble across this and you can have a diff condition for different columns so in other words and you can say if the salary of this row is greater than or less than three thousand i want this row to look a little bit different and you can do that or I want this particular cell to look different but if you if you’re referencing an item on the row then it means that all cells in the row are going to look different even though they’re technically evaluated at different times it would I would be changing the standard template.

In fact, if I try to click in here and change anything like I’m typing on my keyboard right now and you’re noticing that nothing’s happening and you cannot change the standard templates and what apex requires you to do is to copy a template and modify it which is exactly what we’re going to do in a little bit sure definitely and the idea here is that if it’s basically the saying if you get a requirement that wants a kind of rose or something to look a little bit different you can solve it at this level and you can so if you solve it at this level then that means you can use this template for potentially other reports that kind of follow that same standard so in other words if it becomes a kind of like a global requirement that you know when a certain condition is true with a row you want it to stand out or in some way so you could potentially build that or bake that into the reports template.

But I agree it is a little much so we have this generic column template well we also have kind of when we define our query.

Leave a Comment