Canned reports are not self service adhoc reports, these are pixel perfect canned reports and they take more time to develop wherein the alignment, size, repetition etc are specified. Even though they take more time to develop, in this blog, we are going to cover what are the best practices which can be followed for building canned reports which can allow you to create canned reports quickly.
- Preview:
Most important tip is when designing the report keep on clicking on “Preview” so that you can know whether the reports which are being developed are looking the way they are intended to be. You can also understand if the components are having any error which can be troubleshooted and fixed quickly. After the preview if the report looks fine so far please Save it before moving on to make further changes.Shortcut for previewing is Ctrl + P - Alignment:
The easiest method of doing alignment is using the right click option and using “Align” options which appear. When you have added the first component, then the other components which are to be added are going to be with respect to this component.For example if you are creating a tabular report, then first left cell you can add and specify its size and width. Then you can drag second component and specify its width. Then you can use “Align -> Stick to left” to align it with respect to this first component. So on and so forth you can align and create full table.In a similar way you can also use “Align -> Stick to Top” when you are aligning with respect to from the top.
NOTE: Please avoid aligning using dragging as that might not look so good, might introduce some gaps between different components and might also be time consuming.
The other option called Common Height, Common Width, Common Height Width can be also be used in which the height, width, height width of the first selected component will get applied to all the components. - Multiple Formatting:
If you are having multiple components and you want to give them a similar kind of formatting then instead of doing it one by one you can select all of those multiple components together (using Ctrl + Click) and will be able to format those multiple components together (like its border, color, background color, size) etc.
You can even use your mouse to make a rectangle to select multiple components and specify its formatting. - Replicate pre-formatted components
If you have created some components and have specified its formatting, then you can even simply copy paste that component. Then go to typography and simply change the content to the correct text, field name or variable name. This hack can help you save time in terms of formatting again and again.Example: Below we have created a proper table header (with correct size, formatting and alignment) using 4 rows, now we want to create table fields using 4 rows same as per Header. Now we can simply copy this entire header using a mouse and paste it here easily like this. Then “Align -> Stick to top”. Then further each component can be changed to point to the correct field and the right repeat by option can be used.NOTE: Text is always present like “text goes here”. SQLQuery field outputs are present as $F{field_1} and calculated fields/ input parameters are present as $V{calculated_field}. So you can simply change the typography.
- Gap between components:
If you are having two components like page header and then below that table then you can first create header and then table and that table you can use “Align -> Stick to Top”
In case if between the header and table you want to include some gap, then in that case you can first have header, below that header you can include a text component. This text component keep it’s content empty, make it Fit to Width and Align -> Stick to Top. And then you can create table and make it Align -> Stick to Top. - Flow of the report:
If you are creating a report then its designing flow should ideally be from top to bottom. This will allow you to use the alignment options in a more efficient way, thus the speed of development will be faster.
For example : if your report is having a page header, table, summary then do the development in a similar sequence.