Toad World® Forums

Can you customize the HTML/PDF/RTF Reports?

Is there a way to customize the canned Model>Generate Report>Run…>HTML/PDF/RTF output? For example, I would like to remove the DOMAIN column from the table (Entities) Attribute grid within each of these report types.


Hello gcostian,

Yes it is possible. I show you example how remove column Domain from HTML report of sample "videorental" model. Videorental model is Oracle 10g. There can be some minor differences in other databases.

  1. For customization you need switch on expert mode. It is possible from Main Menu-Settings-Options-General tab. Now you will have accessible new menu item "Expert Mode" in main menu.

  2. Best practice is create for your modification new package. In your package will be your modification separated from core and you are able to switch off this very easy. You can create new package from menu "Expert Mode-Customization-New Custom Package... ". On dialog fill name and define extension relationship. Because we want to modify Physical HTML Report, we choose extension on package "HTML Reports for PER Model".
    You can fill some description of package and confirm.

  3. Open Package explorer. You can open it from toolbar Expert Mode or from main menu "Expert Mode-Customization-Package Explorer". It will automatically docked on right side.

  4. In Package Explorer find your new package and right click on this and open Metamodel. Tip. - In package explorer you can hide all system package by toolbar button. It is useful when you want to find your package.

  5. In Metamodel place new class and call it "BasicHTMLPERReport" and set Object Type to 1035.

Go to tab Methods and create new method an open its properties dialog.

  1. This method will override origin method from system tables. So it will has same name and same number and types parameters. In our case Name is "ReportTableColumns" return type "Boolean" and two parameters Docuemnt and Entity, both of data type Dispatch. See screnshots.

  2. When you set name, parameters and return type go to general tab to section Implementation. By Button with rounded arrow you can automatically modify script method name by method name. By button Edit script you can open script when will be code of this function. If script doesn't exist you get dialog with this information. Confirm to create this script.

  3. In script method you can write your code. Recommended process is copy code from system package and modify what you want. If you will be done you need all save and restart TDM. When you do any changes to metamodel you need restart TDM. If you do only script change it is not necessary, you need only save script.

Some useful information about TDM reports

  • TDM has two basic types of reports HTML and RTF. PDF are same as RTF only converted. You can see in package explorer packages with prefix "HTML Reports" or "RTF Reports".

  • For Physical model reports are basic packages "HTML Reports for PER Model" and "HTML Reports for LER Model"

  • You can open every system package metamodel and see what classes and method are in.

  • In packages are stored scripts. You can open system scripts from Package Explorer, Script Explorer or from Metamodel by Method Dialog.

  • A lot of information you can find in Reference Guide - Class Names, Object Types, Methods...

In attachments it is sample package. You can import it to TDM and try.

If you will have any questions doesn't hesitate to ask.

HTML Reports (1.81 KB)