Обучалка по oracle reports builder...

47
Обучалка по Oracle Reports Builder 6.0.8.24.0 Мишин Николай 12.09.2006 Довелось мне в одном банке делать анкету физ. лица, причем в Or Reports в ЦФТ говорили, что это все ерунда, там делать нечего пару дней работы, начальник говорил, что там только поля подвигать и все заработает. Реальность оказалась гораздо жестче, чем я ожидал: ни одного учебника в сети на русском и даже faq и тот не перевели. Вспоминая свои мучения, я написал эти заметки, надеюсь, они кому-нибудь пригодятся, благодарности слать на [email protected] ;)))) В первую очередь убивает аскетичный интерфейс а-ля windows-95. Итак запускаем файл отчета Видим такую неприглядную картину Это object navigator или в простонародье обозреватель объектов,

Upload: phamkhanh

Post on 31-Jan-2018

229 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Обучалка по Oracle Reports Builder 6.0.8.24.0

Мишин Николай 12.09.2006

Довелось мне в одном банке делать анкету физ. лица, причем в Or Reports в ЦФТ говорили, что это все ерунда, там делать нечего пару дней работы, начальник говорил, что там только поля подвигать и все заработает.

Реальность оказалась гораздо жестче, чем я ожидал: ни одного учебника в сети на русском и даже faq и тот не перевели. Вспоминая свои мучения, я написал эти заметки, надеюсь, они кому-нибудь пригодятся, благодарности слать на [email protected] ;))))

В первую очередь убивает аскетичный интерфейс а-ля windows-95.

Итак запускаем файл отчета

Видим такую неприглядную картину

Это object navigator или в простонародье обозреватель объектов,

Page 2: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Чтобы перейти на окно свойств проекта (панель свойств) нужно нажать f4

,чтобы перейти на редактирование отчета нажмите f2

Page 3: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Не будем рассматривать всяких волшебников и т.д.Для начала нужно на модели данных (case средство, напоминающее erwin) создать sql запрос

Page 4: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Кликаем на поле мышкой и вводим sql

Теперь мы подходим к понятиям запрос и группа

Page 5: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Запрос может иметь свое имя Q1 и принадлежать группе G_1 в группу входят поля, принадлежащие запросу ,а также поле с формулой и суммарное поле

Page 6: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal
Page 7: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

У полей с формулами есть pl/sql функция, кот вычисляет значение для данного поляГруппы полей нужны для того, чтобы потом на форме (макете)Вставлять повторяющийся фрейм (рамку)

Поля ,находящиеся в этом фрейме должны принадлежать этой же группе,иначе при запуск отчета не избежать ошибки

Page 8: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Берем поле,нажимаем выбрать родительскую рамку

И мы переходим к повторяющемуся фрейму R_5 означает повторяющийся фрейм,а G_id5 означает,что все поля ,расположенные в этом фрейме должны принадлежать этой группе.

Если мы поставим не тот родительский фрейм, то reports выдаст

Page 9: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Что означает,что поле F_passp1 ссылающиеся на колонку passport1 не принадлежит родительской группе ,т.е. в этой группе нет таких полей.

При запуске отчета всплывает форма ввода

,Чтобы добавить туда поля ,нужно

Перейти на закладку форма параметров

Page 10: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Parameter Form

Нужно вначале создать пользовательский параметр на навигаторе объектов в пользовательских параметрах User Parameters

Нажимаем на кнопку create Дальше по f4 в свойствах переименовываем этот параметр

Page 11: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Со значения по умолчанию P_1

После этого можно на форму добавлять поле

И тут же можно изобразить это поле на форме.

Отдельно следует сказать про фреймы ,порой бывает очень сложно увеличить их размер, так как они располагаются под полями и повторяющимися фреймами

Page 12: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Иногда у меня на это уходило по 2 часа на поле (нужно было удалить то, что лежит во фрейме или над ним и потом это добавить)Когда двигаешь фрейм

, то может возникать несколько ситуаций, управляемых меню

1

Confine mode

Page 13: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Перевод: режим ограничения

Контекст: common

Описание: Режим работы редактора макета, в котором объекты-потомки "удерживаются" внутри границ своих родителей. Например в этом режиме нельзя перенести поле за

границу повторяющейся рамки его записи.

Источник: Reports

2

Flex mode

Перевод: режим Flex

Контекст: common

Описание: Режим работы редактора макета, в котором размеры объектов-родителей автоматически изменяются при перемещении или изменении размера объектов-потомков, и выравнивается расположение всех остальных связанных объектов.

Источник: Reports

Теперь мне хотелось бы перевести на русский следующий документ Oracle Report TipsНесмотря на то, что английский я знаю неплохо , когда нужно сразу понять о чем речь, возникают порой непреодолимые проблемы, вязанные в частности и с терминологией(так называемя тройной перевод жаргон->английский->русский)С помощью http://www.rdtex.ru/docs/glossary/L.html Спасибо ребятам из рдтех!!!

Page 14: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Советы по Oracle Report.(Обновлено 14/09/2006)

Содержание

OBJECT NAVIGATOR ... TIPS...................................................................................................18Always make a copy............................................................................................................... 18SAVE often.............................................................................................................................18Limited drag and drop.............................................................................................................18ICONS.................................................................................................................................... 18Double click to see Property Palette....................................................................................... 18Preferences..............................................................................................................................18Horizontal Main Menu Changes.............................................................................................18Views for Navigator................................................................................................................18'Find' capability within Navigator...........................................................................................18PREFIXES for report object names........................................................................................19Change a report to Landscape.................................................................................................19New SQL query...................................................................................................................... 19Edit SQL query....................................................................................................................... 19Prevent run away queries........................................................................................................19Runs too slow..........................................................................................................................19Data Groups............................................................................................................................ 19Multiple item selection........................................................................................................... 19New group...............................................................................................................................19Order your data....................................................................................................................... 20Filter data................................................................................................................................ 21Add a final total or count to report..........................................................................................21Two types of Frames...............................................................................................................21

Enclosing............................................................................................................................... 21Repeating............................................................................................................................... 21

Report Objects........................................................................................................................ 21Build a report manually.......................................................................................................... 21Two tools used most............................................................................................................... 21Tool palette went away........................................................................................................... 21Pin a tool or how to keep using it........................................................................................... 22Precise manipulation of objects.............................................................................................. 22Date fields............................................................................................................................... 22Copy objects........................................................................................................................... 22Select mulitple items...............................................................................................................22Manipulate all items................................................................................................................22Arrange on the top Menu........................................................................................................ 22Box appears around a field after created.................................................................................22Margin.....................................................................................................................................22Icons........................................................................................................................................22

Confine Mode........................................................................................................................ 22Flex Mode.............................................................................................................................. 22Select Parent Frame............................................................................................................... 23

Layout Model does not look that same as in Previewer......................................................... 23

Page 15: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

When I run report get blank page or part of it is blank...........................................................23Can’t Find Font or Size I need for Report.............................................................................. 23Frequency Below it's Group Error.......................................................................................... 24Avoid Landscape,Duplex Less Than Full Page......................................................................24Force Page Break at Start of Group........................................................................................ 24

PROPERTIES ... TIPS...................................................................................................................27Three Basic Trigger types.......................................................................................................27

REPORT................................................................................................................................ 27BEFORE PARAMETER FORM.......................................................................................27AFTER PARAMETER FORM......................................................................................... 27BEFORE REPORT............................................................................................................27BETWEEN PAGES...........................................................................................................27AFTER REPORT.............................................................................................................. 27

DATA MODEL..................................................................................................................... 27LAYOUT............................................................................................................................... 27

FORMATTING Output.......................................................................................................... 27Formatting Labels or Suppressing Print Lines....................................................................... 28I have 2 reports nearly identical, except 1 has extra totals on the last page that the other does no – to combine into 1 Oracle Report.....................................................................................29Logical Page Numbering........................................................................................................ 29Speed up a slow Oracle Report ..............................................................................................29Developer/2000: Developing Reports with Oracle Reports ................................................... 47

Page 16: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Введение (для МИИТа и МГТУ им Баумана ;)) )

This Oracle product is a potentially powerful tool used to create Reports of many styles that can all be seen as options when you start the Oracle Report Wizard. Most of them (tabular, groups, matrix etc.) can probably be done easier in Oracle Discoverer, but some others can not be done unless the Data is moved down to the Desktop and done with office tools such as Excel and Word. There are advantages and disadvantages to doing this, but in general, you lose some control at the Desktop (such as security, standardization, and scheduling) and add some flexibility at the Desktop where a user can normally make changes without IT being involved.

The styles that are NOT appropriate for Discoverer are formats that are not tabular and spreadsheet in nature. There are at least 3 styles shown in the Report Wizard that are done better in Oracle Reports. They are .. Form-like reports, Form Letters, and Mailing Labels. What these styles have in common is the need to create an output format where 'placement' of the fields is necessary. In other words .. if your output design and appearance needs to be more specific than Discoverer will handle .. then Reports may be the tool of choice.

The LAYOUT MODEL in Reports allows you to place your report objects where you want them on the page and to organize them into 'Frames' that correspond to data 'Groups' you have defined. There are also many other graphical icons in the tool palette that can be used with the Layout. The graphical DATA MODEL allows you to access the Database with SQL that can be generated with a Query Builder, imported from another environment, or entered manually and changed to meet specific needs.

There is also an OBJECT NAVIGATOR that gives you access to all of the objects in the report and to all of the PROPERTIES of each object. With these tools .. you can customize a report to look and act the way you want it to .. once you understand how the objects interact and how the properties change the report. There is usually more than one way to access and change properties and that gives you the flexibility to learn many techniques that build reports.

Another key part of Reports is the use of PARAMETERS. You can use a 'bind variable' in the SQL for each parameter that could be entered. This will reduce redundancy between reports so that many potential reports can be combined into one. This is Oracle's suggestion for making more Reports available without the end-user needing to contact IT. Parameters can greatly increase the power of a report with very little additional confusion for the user .. as long as they only need to change those that vary from a default.

TRIGGERS are another part of Reports that can be implemented by using PL/SQL. This is not necessary for basic reporting, but it can provide many options to improve and customize the report conditionally.

Page 17: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

The purpose of these Web pages is not to teach you all you need to know about Oracle Reports .. it is to provide some 'Tips' that can shorten the learning curve that is unavoidable in a product of this power and potential complexity. The hope is that you will be able to use Oracle's Help system as the final reference, but that some of the concepts will make sense faster with these tips.

Page 18: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

НАВИГАТОР ОБЪЕКТОВ ... Советы

The Object Navigator can show all of the objects associated with one or more reports in a hierarchical tree. It can be expanded and collapsed partially or completely from its vertical tool palette where you can also open, run, save, create, and delete/close reports.

The following Tips can help you use the Object Navigator.

Always make a COPY of the xxxx.rdf file in the O/S directory before you bring it into the Navigator to work on it.

SAVE the current version of the report often as you work on it.Always do the save AFTER you have done a successful run of the report. There is very limited drag-and-drop capability within the Navigator. Its primary purpose is to show RELATIONSHIPS and provide ACCESS to report objects and their properties.

There are ICONS for the Data and Layout Models and for the Parameter Form. Just dbl-click these icons to access these other major components.

Just dbl-click any object to see its PROPERTIES.

Be aware of your PREFERENCES shown under Tools-Preferences.

Check out the options on the horizontal Main Menu across the top. It changes as you move into other components from the Navigator.

NThere are 2 formats(views) for the Navigator under 'View' on the Menu .. try them both.

There is a 'Find' capability within the Navigator. It is located at the top. There is also a 'Find' capability within 'Help' on the Main Menu.

Page 19: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

The following PREFIXES are used for report object names.

Q - Queries G - Groups of data M - Regular Frames R - Repeating Frames F - Fields (variables) B - Boilerplate (constants)

To change a report to 'Landscape' .. change the Orientation Property of the Main section.

DATA MODEL ... Tips

The Data Model displays your report data as objects that show relationships between queries, groups, columns, parameters, and links.

The following Tips can help you use the Data Model.

To enter, import, or build a new SQL query .. click on the 'SQL' icon on the tool palette then right-click on the canvas to see an existing SQL query. dbl-click on the blue query object.

To edit the SQL ..you will need to use the keyboard .. this means the 'Ctrl' key with C, X, and V.

To prevent run-away queries during testing .. use a ROWNUM limitation in the Select statement. Insert a .. 'Where rownum <= 100' .. before your first test run. There is also a 'Maximum Rows to Fetch' property for the query object.

If you find that the Report is running too slow, you can ask the DBAs for assistance in rewriting speeding up the SQL. They have a tool called SQLabXpert from Quest that can analyze the SQL and suggest alternatives.

Each data group is a yellow rectangle with a blue group name heading at the top.To see all the items .. use the scroll-bar .. or click on the heading and pull the middle bottom handle down.

Use the 'shift' key for multiple item selection.

Data that is not in a Group is at the 'Report' level.

To create a new Group .. drag the item(s) from an existing group.

Page 20: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Go ABOVE to be a new PARENT group or BELOW to be a new CHILD group.

You can order your data within a group based on the column order. Do this instead of using an 'Order by' in the Select statement.

Page 21: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

To filter the data (after the SQL selection) for a Group:

Right-click on the blue group heading. Click on 'PL/SQL Editor' line. Write the 'IF' statements that return TRUE or FALSE. For example .. If :Status = 'A' then return TRUE; else return FALSE; End if; Make Bind variables from the database items. A green symbol shows above the data group heading.

To add a Count (a final Total) to a Report:

Select the 'Summary Column' tool from the tool palette. Drag it over to the canvas and go to its properties. Assign a Name and change its function to 'Count'. On the Layout Model.. 'Source' it, give it a label, and place it outside the Repeating Frame.

LAYOUT MODEL ... Tips

The Layout Model shows the attributes of your report as objects so you can view their types and relationships and edit the placement and properties of these objects on a layout canvas. This Model is also the most difficult component to learn for most people.

The following Tips can help you use the Layout Model.

There are 2 types of Frames :

Enclosing Frames .. just surround other layout objects .. they do NOT repeat with each row of data. Repeating Frames .. they repeat within a page .. for every row of data that is retrieved. EVERY object within the frame repeats on EVERY database read.

The report objects are primarily data Fields and Boilerplate constants of Text or Labels. They are usually enclosed by Parent FRAMES to ensure that the Child objects maintain their relative positions to the Parent and each other.

If your build a report manually .. ALWAYS start with a Frame.

The 2 'tools' on the palette you will probably use most are .. 'T' for fixed TEXT .. and .. 'abc' for a variable FIELD.

If the tool palette goes away .. go to 'View' on the top Menu and turn it back on.

Page 22: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

To 'Pin' a tool (to keep using it) dbl-click it .. otherwise the default 'select' tool will re-activate.

To do more precise manipulation of an object .. use the 'Zoom in' icon at the top (the '+' sign).

For a Date field .. there is a format mask property to use. If you want one that is NOT there .. do a .. to_char in the SQL Select. for example .. to_char(xx_date,'MON-DD-YYYY')

To Copy an object .. Select it and use 'Duplicate' under 'Edit' on the top Menu. You could also use 'Copy' and 'Paste' after right clicking. Keep the Selection when pasting.

Use the 'Shift' key to select multiple items or try the Group Operations under

To manipulate All Items .. Select All or Deselect All under 'Edit' on the top Menu.

'Arrange' on the top Menu.

Another tool that can be used is found under 'Arrange' .. you can move objects forward and backward since the layout is actually in 3 dimensions. This technique can sometimes fix an erroneous layout that occurs after Reports automatically did things for and to you.

Be aware that Reports may assume different defaults based on what you did last. It is trying to be helpful .. but sometimes it makes things worse instead.

After you create an object it may have a box around it .. to remove it .. use the 'line color' icon at the bottom of the tool palette .. click it .. then on 'no line'

Each layout page has a 'Margin' that can be moved and stretched. It can be turned on with an icon at the top right. If you use it .. be sure you TURN IT OFF when you are done working with it. If you do not .. then Reports will let you think you are changing the Main section when you are NOT. This can mess up your layout and cause confusion.

You can user the 'Rulers' tool for smooth continuous moving of layout objects. Use Format-Layout_Options then Rulers before selecting 'points'.

There are 3 other icons at the top on the right that are useful and used often.

Confine Mode .. turn on to move ONE object outside of its Parent. Then TURN IT OFF right away.

Flex Mode ........ turn on to move ONE object within its parent object

Page 23: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

.. turn off to move objects around together.

Select Parent Frame ... turn on to select a frame after a child is selected. The entire frame can then be moved

Layout Model does not look the same as in Previewer

You have the Layout Model looking the way you want it but when you run the Previewer, you notice that fields have moved around. This happens because the fields and frames may have their vertical and horizontal elasticity set to variable, etc. but not fixed. To correct, double click on every field and change their elasticity to fixed.

If you need some fields to stay as variable, contract or expand then put a frame around them and mark the frame as fixed and leave the fields alone.

When I run report get blank page or part of it is blank

• If it returns a blank page, check to see if there is any data first. • If you have many frames, and frame 1 shows on report but frame 2 does not –

check the frame2 properties and check that in the Advanced Layout that the Print Object On is Frist Page. If you have several pages of data and this is set to Last Page then it only prints on the Last Page.

Can’t Find Font or Size I need for Report

Found that when I was converting some IQ Elixir reports to Oracle Reports that the fonts used did not appear when I went to create them. You need to first do Page Setup and select the Printer DOC (don’t forget to do the margin defaults too). Then open the report and you should be able to find the fonts you need.

Also, found that a size for a font is used that is not allowed in the drop down in the Layout Model. The way to override that is to choose the closest size, then go to Live Previewer and to manually change it to the size you want.

This will work for bolding fields – however, when you look at it in Previewer it will not look bolded but will bold when printed.

Page 24: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Error “Frequency Below It’s Group” Error

This is a common problem in Oracle Reports - below are some suggested ways to fix it (I find the cut and paste method works the best.

http://www.dbasupport.com/oracle/faq/Detailed/351.shtml -web page that contained this answer

Question: Though I moved a field into that repeating frame, but I'm still getting a "frequency below it's group" error? Answer: Moving fields around does not change what enclosing object is considered it's parent group. Oracle carefully remembers what repeating frame a field was originally placed in and assigns that as it's parent. If you then reference a column further down the line of the query structure it will return that error. If you are not exactly sure which repeating frame a field belongs to, try dragging it out of all of them. Whichever frame will not allow it to escape is it's parent. To change a field's parent, first click on the lock button on the speedbutton bar. It should now look like an unlocked padlock. Now all of the fields on the layout can be repositioned regardless of their original parent items. When you are satisfied with the repositioning click the lock button again to lock the layout. Oracle will parse the layout and assumes that any item fully enclosed in a repeating frame is a child object of that frame. This can be confirmed again by trying to drag an object out of it's parent. (Cntrl - Z or edit..undo will put it back where it came from)

Sometimes, for unknown and mysterious reasons, this method does not work. The alternative in this case is to highlight the field (or fields), cut it (cntrl-x), and then paste it into the desired frame. The paste does not initially set it into the right frame, but if you drag and drop it there before clicking on any other objects, and then click on something else, Oracle will usually figure what your intent was and assign the object(s) as a child of that frame. This is my preferred method of changing a field's parent as it works much more consistently then the unlock/lock method. One note though, if you are reassigning a group of fields, make sure the frame you are going to move them into is large enough to accept the whole group at once before you do the cut/paste. If you do the paste and then try to grow the frame to fit, you will have to cut and paste again. Once you de-select an object that has just been pasted, Oracle will assign it as a child of whatever it is in at the time.

If this technique also fails, you are probably going to have to delete and then recreate the objects within the desired frame. If the object has triggers attached, save yourself some typing by creating the new object in the right frame, copying over the trigger code, and then deleting the old object .

Avoid designing landscape, duplex reports less than a full page

Avoid designing landscape, duplex reports less than a full page, for instance a side-by-side 5 1/2" X 8 1/2" report.

Make them portrait one above the other, otherwise the print on back will either be upside down (flip on long edge) or with an odd number of pages, the front will print on one half of the sheet and back on the other half (flip on short edge) on the last page because the printer will always start printing in the upper left corner of the page, never in the middle.

Force Page Break at Start of Group

Page 25: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

I have a Master/Detail tabular report and don't want the detail to be split between two pages. If it is going to overflow to another page, I want to force a page break at the start of the group - how do I do that?

Answer: Under General Layout, set Page Protect = Yes on the repeating frame. This report prints many people and their detail on a page, if at the end of the page, the last person's detail cannot fit there, it page breaks and starts them in the next page.

PARAMETERS ... Tips

Parameters enable you to make reports dynamic.. based on the parameter values supplied at run time. 'User' parameters give you the means to change the SELECT statement for a query through 'bind variables' that reference the parameters. There are also 'System' parameters that allow you to modify standard run-time settings for each report definition. There is a basic parameter Form that has an icon on the Object Navigator.

The Parameter Form can be accessed and edited by dbl-clicking on the Navigator icon.

The size of the Form window can be changed as a property of the overall report

Page 26: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

object.

When you need a parameter .. you must first put a bind variable into a Select statement. All bind variables must start with a colon (:).

Use the Parameter Form Builder under 'Tools' on the top Menu to build the form for the first time.

By using the List of Values for a parameter .. you can write a Select statement to create a drop-down value selection from the database.

Eventually when reports are deployed on the Portal .. most parameter development and testing should probably be done on the Portal .. after the Bind variables are put into the SQL in Oracle Reports

Page 27: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

PROPERTIES ... Tips

The Properties of an object can be seen by double clicking the object in the Navigator or from the Layout Model. Sometimes it is easier to right click first and select from the drop down. This will show you the Property 'Palette' (changed to 'Inspector' in 9i). which has 2 columns showing the names and values of the Properties.

The values can be changed by double-clicking on the right column value. To make sure the Change occurs .. press 'Enter' or click a left column heading.

The Name of the object is the first Property .. assign names that are meaningful. If you want to change the assigned names of the Queries (Q_1, Q_2, etc.) .. do it in the beginning. Try to keep the name of the Report and its O/S file name the same.

The page break before and after properties only control anchored objects. Use them for multipart reports.

TRIGGERS ... Tips

Triggers are blocks of procedural code written in PL/SQL that allow you to perform additional or conditional processing at run time. In addition to the triggers .. you can also use other standard or custom 'Program Units' in PL/SQL. Triggers and Program Units can be created and edited from nodes at the bottom of the Navigator by using PL/SQL Editors.

There are 3 basic Trigger types.

REPORT Triggers - 5 Types Before parameter Form After parameter Form Before Report (after SQL is parsed) Between Pages After Report

DATA MODEL Triggers .. usually a Group Filter (see Data Model)

LAYOUT Triggers .. Format triggers (see 'Formatting output' below)

Triggers are functions that return a boolean TRUE or FALSE.

Triggers can access and Update the database.

FORMATTING output:

Page 28: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Conditional Formatting .. appearance or suppression .. under 'Format' on the top Menu. .. or right-click a layout object .

Format Triggers .. are done as a property of layout objects (Frames or Fields). .. can NOT alter the value of an output field .. see below

Format Masks .. are for Dates and Numbers only .. see below

Formatting character fields .. phone numbers, SSN numbers, etc. .. do it in the SQL Select statement .. use functions like .. substr, nvl, concat, decode, case, etc.

Formatting Labels or Suppressing Print Lines

For address lines that can be blank, this is a way to not print a blank line 1) make sure you surround them with a frame that is marked as fixed in vertical and horizontal elasticity in its property palette.2) for each field, set the vertical elasticity property to ‘variable’ and the horizontal elasticity to ‘fixed’3) for each field write a FORMAT TRIGGER that sets FALSE if the line is null – see example

function F_SPRADDR_STREET_LINE2FormatTr return boolean isbegin IF :SPRADDR_STREET_LINE2 is null then return (FALSE); else return (TRUE); end if;end;

NOTE: When you go to the property palette and look at the Format Trigger line, it always appears empty even when there is a trigger.

Page 29: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

I have 2 reports nearly identical, except 1 has extra totals on the last page that the other does not – to combine into 1 Oracle Report

To combine into 1 Oracle Report:

Create a formula field that has a value of Y if user is running the report with totals, and N otherwise.Put an enclosing frame around the data to be hidden.Go into the Property Palette of the frame and click Conditional Formatting.Click New.Fill in the logical expression. In this case <formula field> = N.Click "Hide the Object". Click ok.Click apply. Click ok.

Reports Builder automatically generates a format trigger when you do this. If you return to the property palette and click format trigger, you will see what was generated. By entering your own trigger directly, you can produce the same results.

Logical Page NumberingHad a problem where I needed to put a page number on a report, but with a condition where the counter will not increment if a repeating frame is split between multiple pages. Essentially, it is a page counter that counts the logical pages, not the physical pages.

This is how to create a field that will work in the above situation:In the Data Model view, do the following:Create a placeholder field in the group that you want to count.Set the "Value if Null" property of this placeholder field to 1Create a summary column field in this same group.Set the "Function" property of this column to "Sum"Set the "Source" property of this column to the name of your placeholder field.

In the Layout Model view, do the following:Create a new field on your report where you want this counter to appear, making sure that it is within the correct group frame.Set the "Source" property of this field to the name of your summary column.

You now have a field that will count logical pages.

Speed up a slow Oracle Report

To speed up a slow Oracle Report with more than 1 query, it takes more than adding a hint to your SQL. Use a Before Report Trigger like the following to change the optimizer to rule while the report runs.

function BeforeReport return boolean isbegin srw.do_sql('alter session set OPTIMIZER_GOAL=RULE'); return (TRUE);

Page 30: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

end;

Apparently when Oracle combines the multiple queries into 1 it uses the cost optimizer. SRW package may change with the 9i Reports version, so note which reports you add this to in case it needs to change later.

Printing Labels from Oracle Reports

In order to print labels using an Oracle Report, several things need to be in place first.

First: The label needs to be created as an Oracle Report with the standard printer margin defaults as Left: 0.25, Top: 0.25, Right: 0.25 and Bottom: 0.5. So when the developer creates the label Oracle report, they should test that the labels will line up correctly using the above margin defaults. Also, it is suggested that the font be Courier New with the size set at 9 or 10, depending on how many lines are needed in the label.

Second: A one time set up is required for each PC that will be used to print labels to the Xerox DOC printer in DCS. (NOTE: If you are printing labels to a local printer, then you need to select that printer and the tray to use instead.)

How to set your printer to print labels directly to the Xerox DOC printer

1. Click on Start (Lower left of consol screen).

2. Go to Settings then click on Printers and Faxes.

3. Right click on DOC on FABFOUR, go to Printing Preferences and click on it.

4. Click on Xerox Settings, then click on Stocks, then click on Add.

5. Click on Specify stock by identifier (upper left).

6. Click on down arrow in Identifier box and select Custom.

Overwrite the stock number with 3up-labels (case sensitive), click OK.

7. Click on Specify stock by attributes.

8. Click on down arrow in Size box (just below Identifier box). Select 8.5 x 11.0 in. (U.S. Letter)

9. Go to Type, click on down arrow, select Custom and type 3up-labels, click on OK.

10. Go to Printer default, below Type, and unclick the check mark (both Drilled and Printer

default boxes will be blank).

11. Go to Weight (Bottom left), uncheck printer default and use up arrow to set weight to 100.

12. Click on OK, then Close, then OK

Page 31: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

You now have a Stock called 3up-labels that can be selected whenever needed.

Third: Printing labels - these steps must be done each time you print labels.

1) Run the Oracle label report in Banner using the form GZAORPT.

Here is a sample to try:A) Type in the form name GZAORPT in Banner.B) Type in ‘G’ in field System: and then do a Next Block (one way is CTL + Page Down keys). The following will appear.

C) Click on the button called ‘Run Oracle Report’ next to either the GYGL3HO_UP_LABELS_HO_MA_PA or GYGL3MA_3_UP_LABELS_MA_HO_PA.

Page 32: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

D) A parameter box should appear, you can type in a popsel you have or use the example below. After you enter the parameter, click on File/Run Report or the traffic light icon. It will return a previewer page – proceed to the next step. NOTE: If the parameter box does not appear, then contact SAS to see if they can correct the Oracle directory problem.

Page 33: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal
Page 34: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

2) When the Previewer returns with the data, click on File then click on Page Setup. When this page returns, verify that the margins are set correctly. If not, then correct them. I had changed the margins to .25 for Left and Right and .25 for Top and .5 for Bottom – if you notice in this example, it changed the Right and Bottom slightly. That is okay, just make sure it is close to the defaults wanted.

3) Then click on the Printer.. icon in the lower left side of this panel. Select the \\fabfour\DOC printer from the drop down choices in Name:

Page 35: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

4) Then click on the Properties... icon to the right and click on the Xerox Settings folder tab. You will need to select the Stock 3up-labels (User). Then click OK, OK.

5) You can print the labels now by clicking on File then Print then OK or click on the printer icon and then OK.

6) The red X will close the previewer and should return you to the Banner session.

CONVERTING IQ REPORT THAT USES ELIXIR

If you are creating an Oracle Report that is replacing an Elixir form:

Have DCS print a copy of the form and mark on it all of the fonts and sizes that are used on it. Also, they can copy any images that were used on the Elixir form to X:\ELIXIR\logos, a common area so you can put it in your Oracle report.

If you go to create the report and cannot find the font you want, then close the report. Go to print setup and select the printer it will be printed on and then re-open the report. You should see the fonts you need. The fonts are tied to the printer that you will use (not all printers have the same fonts on them).

When designing any Oracle Report, remember to always set your margins to the new standards before you design a report. (top, left, right = .25, bottom = .5)

Page 36: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

This may be a good time to redesign the form to use more standard fonts.

Converting from IQ to a SQL script

*** Not recommended – just here for informational purposes ***

Creating the SQL script to generate the data file to print:1) Bring up the IQ report – get a hardcopy, document IQ dictionary and IQ category and report name

example:IQ –dfinCATEGORY – ACCOUNTS RECEIVABLETAQREC20B - 1098 for 2000

2) Use the diag option to get the select statement. Warning IQ doesn’t always return all of the fields and may have some syntax errors in it. But it is a good way to start.

3) Create the SQL script to do exactly what the IQ did – layout included.

This example created several tables to help gather the data that was done in the IQ. The script is at the end.

Page 37: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Setting up the PRINT of the output:1) Bring up the IQ report – get a hardcopy, document IQ dictionary and IQ category and report name

example:IQ –dfinCATEGORY – ACCOUNTS RECEIVABLETAQREC20B - 1098 for 2000

2) Locate the IQ printer that is being used – look for DEVICE

example:

DEVICE = PRINTER 'financeX - 1098-00'

3) Go to directory /usr/local/iq/iq3502

4) vi iqprtcfg.dat - this is the printer configuration file

5) locate the printer from step 2 (search for financeX -1098-00)

in this example you will find

##P1 financeX - 1098-00P2 cat /usr/local/iq/jdts/1098-00.xrx - | lp -d xeroxP3 140P6 1##

P2 is the command line that will need to be put in the SQL script – replace the dash before the pipe command with the name of the output file.

host cat /usr/local/iq/jdts/1098-02.xrx /usr/temp/$LOGNAME/tzs1098_02.lst | lp –dxerox

Page 38: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

IQ Report - TAQREC20B - STUDENT CALENDAR YEAR STATEMENT

# TAQREC20B - STUDENT CALENDAR YEAR STATEMENT#PROMPT 'Enter Student #:' TO STU_ID ALPHA 9.INITIALIZE ST_CREDITS TO 0 NUMERIC 4.2.INITIALIZE ST_CHARGES TO 0 NUMERIC 4.2.CONVERT TBRACCD_TRANS_DATE TO ALPHA GIVING TRANS_DATE.IF TBRACCD_DETAIL_CODE = 'L*' THENMOVE 'LABS' TO DETAIL_CODEMOVE 'Lab Fees' TO DESCELSEMOVE TBRACCD_DETAIL_CODE TO DETAIL_CODEMOVE TBRACCD_DESC TO DESC.CONCAT TBRACCD_TERM_CODE AND DETAIL_CODE GIVING TERM_DETAIL.CONCAT TBRACCD_DETAIL_CODE AND TBRACCD_DESC GIVING DETAIL_DESC.CONCAT TRANS_DATE AND DETAIL_DESC GIVING DATE_DETAIL.INITIALIZE HOLD_ID TO ' ' ALPHA 9.INITIALIZE COUNT_ID TO 0 NUMERIC 4.0.IF HOLD_ID <> SPRIDEN_ID THEN MOVE 1 TO COUNT_ID MOVE SPRIDEN_ID TO HOLD_ID ELSE MOVE 0 TO COUNT_ID.INITIALIZE GROUP_SUBTOTAL TO ' ' ALPHA 15.INITIALIZE HOLD_GROUP TO ' ' ALPHA 15.INITIALIZE COUNT_GROUP TO 0 NUMERIC 3.O.IF SPRIDEN_ID = 'M*' THEN

MOVE SPBPERS_SSN TO IDEN_IDELSE

MOVE SPRIDEN_ID TO IDEN_ID.IF TBBDETC_TYPE_IND = 'P' THEN MOVE TBRACCD_AMOUNT TO ST_CREDITS MOVE 0 TO ST_CHARGESELSE MOVE TBRACCD_AMOUNT TO ST_CHARGES MOVE 0 TO ST_CREDITS.IF TBRACCD_DETAIL_CODE = 'CASH' 'CHEK' 'CCRD' THEN MOVE TRANS_DATE TO SHOW_WHEN MOVE DATE_DETAIL TO GROUP_SUBTOTALELSE MOVE TERM_DETAIL TO GROUP_SUBTOTAL MOVE STVTERM_DESC TO SHOW_WHEN.IF GROUP_SUBTOTAL <> HOLD_GROUP THEN MOVE 1 TO COUNT_GROUP MOVE GROUP_SUBTOTAL TO HOLD_GROUP ELSE MOVE 0 TO COUNT_GROUP.SEARCH FOR(SPBPERS_CITZ_CODE = 'Y' 'P'or SPBPERS_CITZ_CODE = NULL)AND TBRACCD_TERM_CODE = '200003' '200006' '200008' '200101'AND TBRACCD_TRANS_DATE <= 12/31/2000AND TTBTAXN_TAX_YEAR = 2000AND SPRIDEN_CHANGE_IND = NULL.IF SZVGTRM_PIDM <> NULL THENMOVE 'Enrolled' TO ENROLL_INDMOVE SZVMHDA_LINE1 TO LINE1MOVE SZVMHDA_LINE2 TO LINE2MOVE SZVMHDA_LINE3 TO LINE3MOVE SZVMHDA_CITY TO CITYMOVE SZVMHDA_STATE TO STATEMOVE SZVMHDA_ZIP TO ZIPMOVE SZVMHDA_NATION TO NATIONELSEMOVE 'Not-enrolled' TO ENROLL_INDMOVE SZVHDPA_LINE1 TO LINE1

Page 39: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

MOVE SZVHDPA_LINE2 TO LINE2MOVE SZVHDPA_LINE3 TO LINE3MOVE SZVHDPA_CITY TO CITYMOVE SZVHDPA_STATE TO STATEMOVE SZVHDPA_ZIP TO ZIPMOVE SZVHDPA_NATION TO NATION.SORT ASCENDING SPRIDEN_ID TBRACCD_TERM_CODE GROUP_SUBTOTAL.CONCATENATE SPRIDEN_FIRST_NAME AND SPRIDEN_MI TO FIRST_LAST TRIMSPACE.CONCATENATE FIRST_LAST AND SPRIDEN_LAST_NAME TO STUDENT_NAME TRIMSPACE.#TAQREC20BFORMAT = PRINTER.REPORT WIDTH 80 LENGTH 110 FOOTER 3 HEADING 1'Michigan Technological University' NEXT LINE 1 2 '2' 3'4 Administration Building' NEXT LINE 1 '1400 Townsend Drive' NEXT LINE 1'Houghton, MI' 15 '49931-1295' NEXT LINE 1 'Contact Phone No.:(906) 487-2243'NEXT LINE NEXT LINE NEXT LINE 1 '386005955' 24 IDEN_ID NEXT LINE NEXT LINENEXT LINE NEXT LINE 1 SPRIDEN_FIRST_NAME TRIM 17 SPRIDEN_MI TRIM 33SPRIDEN_LAST_NAME NEXT LINE 1 LINE1 NEXT LINE 1 LINE2 NEXT LINE 1 LINE3 NEXTLINE 21 ',' 1 CITY TRIM 23 STATE 27 ZIP 38 NATION NEXT LINE NEXT LINE NEXTLINE NEXT LINE 68 TTBTAXN_GRAD_STUD_IND 52 TTBTAXN_HALF_TIME_ENRL_IND NEXTLINE NEXT LINE NEXT LINE NEXT LINE 12 SPRIDEN_FIRST_NAME TRIM 28 SPRIDEN_MITRIM 44 SPRIDEN_LAST_NAME 1 SPRIDEN_ID NEXT LINE 12 LINE1 TRIM NEXT LINE 12LINE2 TRIM NEXT LINE 12 CITY TRIM 34 STATE 38 ZIP 49 NATION NEXT LINE NEXTLINE 1 'DETAIL' NEXT LINE 1 'CODE DATE/TERM' 19 'DESCRIPTION' 54 'CHARGES' 66'CREDITS' NEXT LINE 1 49 '_' 52 9 '_' 64 9 '_' NEXT LINE SUBTOTAL BREAK ONGROUP_SUBTOTAL 52 SUBTOTAL ST_CHARGES ZERO FORMAT 'BB,BBB.BB-' 64 SUBTOTALST_CREDITS ZERO FORMAT 'BB,BBB.BB-' 19 DESC 1 DETAIL_CODE 6 SHOW_WHEN SIZE 12BREAK ON SPRIDEN_ID PAGE TOTAL 1 'COUNT PEOPLE' 14 TOTAL COUNT_ID.DEVICE = PRINTER 'financeX - 1098-00'.

Page 40: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

SQL Script to Replace it:

delete tzs1098/delete tzr1098/accept atyp_code prompt 'Enter the Address Type (e.g. MA,HO): 'accept idlist prompt 'Enter Student IDs - in single quotes, separated by commas: 'insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select spriden_pidm, 'AA', chr(012)||'Michigan Technological University'from spridenwhere spriden_change_ind is nulland spriden_id in (&&idlist)/update tzs1098set tzs1098_ssn = (select spriden_id from spriden where spriden_change_ind is null and spriden_id not like 'M00%' and spriden_pidm = tzs1098_pidm)/update tzs1098set tzs1098_ssn = (select spbpers_ssn from spbpers where spbpers_pidm = tzs1098_pidm)where tzs1098_ssn is null/update tzs1098set (tzs1098_line1, tzs1098_line2, tzs1098_line3, tzs1098_city, tzs1098_state, tzs1098_zip, tzs1098_natn_code) =(select spraddr_street_line1, spraddr_street_line2, spraddr_street_line3, spraddr_city, spraddr_stat_code, spraddr_zip, spraddr_natn_codefrom spraddrwhere spraddr_pidm = tzs1098_pidmand (spraddr_to_date is null or spraddr_to_date > sysdate)and spraddr_atyp_code = '&atyp_code')/update tzs1098set tzs1098_nation = (select stvnatn_nation from stvnatn where stvnatn_code = tzs1098_natn_code)/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'AB', '224 Administration Building'from tzs1098where tzs1098_display_ord = 'AA'/

Page 41: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'AC', '1400 Townsend Drive'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'AD', 'Houghton, MI 49931-1295'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'AE', 'Contact Phone No.:(906) 487-2243'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'BA', ' 'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'BB', ' 'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'CA', '386005955'||' '||tzs1098_ssnfrom tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'DA', ' 'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'DB', ' 'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'DC', ' 'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)

Page 42: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

select tzs1098_pidm, 'EA', substr(spriden_first_name,1,20)||' '|| substr(spriden_mi,1,15)||' '|| substr(spriden_last_name,1,30)from tzs1098,spridenwhere tzs1098_display_ord = 'AA'and tzs1098_pidm = spriden_pidmand spriden_change_ind is null/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'EB', tzs1098_line1from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'EC', tzs1098_line2from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'ED', tzs1098_line3from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'EE', tzs1098_city||', '||tzs1098_state||' '|| tzs1098_zip||' '||tzs1098_nationfrom tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'FA', ' 'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'FB', ' 'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'FC', ' 'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'GA', ' '||

Page 43: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

ttbtaxn_half_time_enrl_ind||' '|| ttbtaxn_grad_stud_indfrom tzs1098,ttbtaxnwhere tzs1098_display_ord = 'AA'and tzs1098_pidm = ttbtaxn_pidmand ttbtaxn_tax_year = '2000'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'HA', ' 'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'HB', ' 'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'HC', ' 'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'IA', spriden_id||' '||substr(spriden_first_name,1,20)||' '|| substr(spriden_mi,1,15)||' '|| substr(spriden_last_name,1,30)from tzs1098,spridenwhere tzs1098_display_ord = 'AA'and tzs1098_pidm = spriden_pidmand spriden_change_ind is null/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'IB', ' '||tzs1098_line1from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'IC', ' '||tzs1098_line2from tzs1098where tzs1098_display_ord = 'AA'and tzs1098_line2 is not null/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'ID', ' '||tzs1098_line3from tzs1098where tzs1098_display_ord = 'AA'and tzs1098_line3 is not null/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm,

Page 44: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

'IE', ' '||tzs1098_city||', '||tzs1098_state||' '|| tzs1098_zip||' '||tzs1098_nationfrom tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'JJ', ' 'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'PA', 'DETAIL'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'PB', 'CODE DATE/TERM DESCRIPTION CHARGES CREDITS'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzs1098_pidm, 'PC', '------------------------------------------------ ---------- ----------'from tzs1098where tzs1098_display_ord = 'AA'/insert into tzr1098select tzs1098_pidm, tbraccd_detail_code, tbraccd_desc, tbraccd_term_code, max(stvterm_desc), null, sum(tbraccd_amount), ' ', to_char(sum(tbraccd_amount),'999,999.99')from tzs1098,tbraccd,stvtermwhere tzs1098_display_ord = 'AA'and tzs1098_pidm = tbraccd_pidmand tbraccd_term_code like '2000%'and tbraccd_term_code = stvterm_codeand exists (select 1 from tbbdetc where tbbdetc_detail_code = tbraccd_detail_code and tbbdetc_type_ind = 'P')group by tzs1098_pidm,tbraccd_term_code,tbraccd_detail_code,tbraccd_desc/insert into tzr1098select tzs1098_pidm, tbraccd_detail_code, tbraccd_desc, tbraccd_term_code, max(stvterm_desc), sum(tbraccd_amount),

Page 45: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

null, to_char(sum(tbraccd_amount),'999,999.99'), ' 'from tzs1098,tbraccd,stvtermwhere tzs1098_display_ord = 'AA'and tzs1098_pidm = tbraccd_pidmand tbraccd_term_code like '2000%'and tbraccd_term_code = stvterm_codeand exists (select 1 from tbbdetc where tbbdetc_detail_code = tbraccd_detail_code and tbbdetc_type_ind = 'C')group by tzs1098_pidm,tbraccd_term_code,tbraccd_detail_code,tbraccd_desc/insert into tzs1098(tzs1098_pidm,tzs1098_display_ord,tzs1098_display_line)select tzr1098_pidm, 'SS', rpad(tzr1098_detail_code,4)||' '|| rpad(tzr1098_term_desc,12)||' '|| rpad(tzr1098_detail_desc,30)||' '|| lpad(tzr1098_charge_disp,14)||' '|| lpad(tzr1098_payment_disp,14)from tzr1098order by tzr1098_pidm,tzr1098_term_code,tzr1098_detail_code/set echo offset head offset pause offset timing offset feedback offset verify offset pages 0spool /usr/temp/$LOGNAME/tzs1098_00select tzs1098_display_linefrom tzs1098order by tzs1098_pidm,tzs1098_display_ord,rowid/spool offhost cat /usr/local/iq/jdts/1098-00.xrx /usr/temp/$LOGNAME/tzs1098_00.lst | lp -dxeroxdelete tzs1098/delete tzr1098/exit

More Information (from the Internet)

The following links will provide additional Tips and General information about Oracle Reporting.

Building a Report using the Wizard

Oracle Reports at Summit 2002

Page 46: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

Reports and Templates ... more about Templates

http://www.orafaq.org/papers/reports.rtf - “Everything you Ever Wanted Tp Know about 2.5”

Oracle Technology Network (OTN)

Oracle Reports ... more about Reports

Page 47: Обучалка по Oracle Reports Builder 6mishin.narod.ru/Tutorial_Oracle_Reports_Builder_6_ver1.pdf · Перевод: режим ... Check out the options on the horizontal

http://www.dulcian.com/papers/ODTUG%202004_Balcu2_Oracle%20Reports%20Beginner's%20Guide.htm

http://mymanual.narod.ru/subd/sams_teach_yourself_oracle8_database_development_in21_days/ch15/0430-0433.html

http :// mymanual . narod . ru / subd / sams _ teach _ yourself _ oracle 8_ database _ development _ in 21_ days / ewtoc . html http :// mymanual . narod . ru / subd / sams _ teach _ yourself _ oracle 8_ database _ development _ in 21_ days / ch 09/0231-0235. html

http :// mymanual . narod . ru / subd / sams _ teach _ yourself _ oracle 8_ database _ development _ in 21_ days / ch 11/0283-0287. html # ch 11_%202

http :// mymanual . narod . ru / subd / sams _ teach _ yourself _ oracle 8_ database _ development _ in 21_ days / ch 15/0407-0410. html # ch 15_%202

Developer/2000: Developing Reports with Oracle Reports