0% found this document useful (0 votes)
3 views

Part B

The document outlines advanced digital documentation skills for Class X, focusing on creating and applying styles in OpenOffice.org to enhance document consistency and formatting efficiency. It details various types of styles, methods to apply and modify them, and techniques for inserting and manipulating images within documents. The content emphasizes practical applications, including using the Styles and Formatting window, Fill Format mode, and image insertion methods from files, scanners, and the OpenOffice Gallery.

Uploaded by

mousumisaha488
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Part B

The document outlines advanced digital documentation skills for Class X, focusing on creating and applying styles in OpenOffice.org to enhance document consistency and formatting efficiency. It details various types of styles, methods to apply and modify them, and techniques for inserting and manipulating images within documents. The content emphasizes practical applications, including using the Styles and Formatting window, Fill Format mode, and image insertion methods from files, scanners, and the OpenOffice Gallery.

Uploaded by

mousumisaha488
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 84

INFORMATION TECHNOLOGY-402

CLASS-X
SESSION-2024-25
SUBJECTIVE SKILLS
UNIT 1: DIGITAL DOCUMENTATION (ADVANCED)
SESSION 1: CREATE AND APPLY STYLES IN THE DOCUMENT
A style is a set of formats that we can apply to selected pages, text, frames, and other
elements in our document to quickly change their appearance. When we apply a style, we
apply a whole group of formats at the same time.
Styles are logical attributes. Using styles means that we stop saying “font size 14pt, Times
New Roman, Bold, Centered”, and we start saying “Title” because we have defined the
“Title” style to have those characteristics. In other words, styles mean that we shift the
emphasis from what the text (or page, or other element) looks like, to what the text is.
Styles help improve consistency in a document. They also make major formatting changes
easy.
OpenOffice.org supports the following types of styles:
• Page styles include margins, headers and footers, borders and backgrounds. In
Calc, page styles also include the sequence for printing sheets.
• Paragraph styles control all aspects of a paragraph’s appearance, such as text
alignment, tab stops, line spacing, and borders, and can include character
formatting.
• Character styles affect selected text within a paragraph, such as the font and size
of text, or bold and italic formats.
• Frame styles are used to format graphic and text frames, including wrapping type,
borders, backgrounds, and columns.
• Numbering styles apply similar alignment, numbering or bullet characters, and
fonts to numbered or bulleted lists.
• Cell styles include fonts, alignment, borders, background, number formats (for
example, currency, date, number), and cell protection.
• Graphics styles in drawings and presentations include line, area, shadowing,
transparency, font, connectors, dimensioning, and other attributes.
• Presentation styles include attributes for font, indents, spacing, alignment, and
tabs.
Applying styles
OpenOffice.org provides several ways for we to select styles to apply.
Using the Styles and Formatting window
1) Click the Styles and Formatting icon located at the left-hand end of the object
bar, or click Format > Styles and Formatting, or press F11.
The Styles and Formatting window shows the types of styles available for the
OpenOffice (OpenOffice.org) component we are using.
Figure 1.1 shows the window for Writer, with Page Styles visible.

Figure1.1: The Styles and Formatting window for Writer, showing paragraph styles
We can move this window to a convenient position on the screen or dock it to an edge
(hold down the Ctrl key and drag it by the title bar to where we want it docked).
2) Click on one of the icons at the top left of the Styles and Formatting window to display
a list of styles in a particular category.
3) To apply an existing style (except for character styles), position the insertion point in
the paragraph, frame, or page, and then double-click on the name of the style in one
of these lists. To apply a character style, select the characters first.
Using Fill Format mode
Fill format mode is used to apply a style to many different areas quickly without having
to go back to the Styles and Formatting window and double-click every time. This
method is quite useful when we need to format many scattered paragraphs, cells, or
other items with the same style.
1) Open the Styles and Formatting window and select the style we want to apply.

2) Click the Fill Format mode icon .


3) To apply a paragraph, page, or frame style, hover the mouse over the paragraph,
page, or frame and click. To apply a character style, hold down the mouse button
while selecting the characters, clicking on a word applies the character style for that
word. Repeat step 3 until we made all the changes for that style.
4) To quit Fill Format mode, click the Fill Format mode icon again or press the Esc
key. An important point to note here is that when this mode is active, a right-click
anywhere in the document undoes the last Fill Format action. Be careful not to
accidentally right click and thus undo actions we want to keep.
Creating New (Custom) Styles
We can add some new styles in two ways:
Creating a new style from a selection
We can create a new style by copying an existing manual format. This new style
applies only to this document; it will not be saved in the template.
1. Open the Styles and Formatting
window and choose the type of
style that is to be created.
2. In the document, select the item
that is to be saved as a style.
3. In the Styles and Formatting
window, click on the New Style
from Selection icon Figure 1.2: Naming a new style created from a selection
(refer Figure 1.2).

4. In the Create Style dialog, type a name for the new style. The list shows the names
of existing custom styles of the selected type. Click OK to save the new style.
Dragging And Dropping To Create A Style
We can drag and drop a text selection into the Styles and Formatting window to create
a new style.
Select some text and drag it to the Styles and Formatting window. If Paragraph Styles
are active, the paragraph style will be added to the list. If Character Styles are active,
the character style will be added to the list.
Modifying Styles
OpenOffice.org provides several ways to modify styles (both the predefined styles and
custom styles that we have created):
• Updating a style from a selection
• Load or copy styles from another document or template
Any changes we make to a style are effective only in the current document. To change
styles in more than one document, we need to change the template or copy the styles
into the other documents.
Updating A Style From A Selection
To update a style from a selection:
1. Open the Styles and Formatting window.
2. In the document, select an item that
has the format we want to adopt as a
style.
3. In the Styles and Formatting
window, select the style we want to
update (single- click, not double-
click), then long-click on the arrow
next to the New Style from
Selection icon and click on Figure 1.3: Updating a style from a selection
Update Style(Refer Figure 1.3).

Loading Styles From A Template Or Document


We can copy styles by loading them from a template or another document:
1. Open the document we want to copy styles into.
2. In the Styles and Formatting window, long-click on the arrow next to the New Style
from Selection icon, and then click on Load Styles.

Figure 1.4. Copying styles from a template into the open document
3. On the Load Styles dialog (Figure 1.4), find and select the template we want to
copy styles from.
4. Select the categories of styles to be copied. Select Overwrite if we want the styles
being copied to replace any styles of the same names in the document we are
copying them into.
5. Click OK to copy the styles. We will not see any change on screen.
To copy the styles from another document, click the From File button to open a
window from which we can select the required document.
SESSION 2. INSERT AND USE IMAGES
Relevant Knowledge
Images can be added to a document in several ways:
• by inserting an image file,
• directly from a graphics program or a scanner, or
• from the Open Office Gallery.

Inserting An Image File


When the image is in a file stored on the computer, we can insert it into an Open
Office document using either of the following methods:
Drag and Drop
1. Open a file browser window and locate the image we want to insert.
2. Drag the image into the Writer document and drop it where we want it to appear.
A faint vertical line marks where the image will be dropped.
This method embeds (saves a copy of) the image file in the Writer document. To link
the file instead of embedding it, hold down the Ctrl+Shift keys while dragging the
image.
Insert Picture Dialog
1. Click in the Open Office document where we want the image to appear.
2. Choose Insert > Picture > From File from the menu bar.
3. On the Insert Picture dialog (see Figure 1.5), navigate to the file to be inserted,
select it, and click Open.
At the bottom of the dialog are two options, Preview and Link. Select Preview to
view a thumbnail of the selected image on the right, so we can verify that we have
the correct file. See below for the use of Link.
Figure 1.5. Insert picture dialog
Inserting An Image From The Clipboard
Using the clipboard, we can copy images into an Open Office document from another
Open Office document and from other programs. To do this:
1. Open both the source document and the target document.
2. In the source document, select the image to be copied.
3. Move the mouse pointer over the selected image and press Ctrl+C to copy the
image to the clipboard.
4. Switch to the target document.
5. Click to place the cursor where the graphic is to be inserted.
6. Press Ctrl+V to insert the image.
If the application from which the graphic was copied is closed before the graphic is
pasted into the target, the image stored on the clipboard could be lost.
Inserting An Image Using A Scanner
If a scanner is connected to our computer, Open Office can call the scanning
application and inserted the scanned item into the Open Office document as an image.
To start this procedure, click where we want the graphic to be inserted and select
Insert > Picture > Scan > Select Source.
Although this practice is quick and easy, it is unlikely to result in a high-quality image
of the correct size. We may get better results by scanned material into a graphics
program and cleaning it up there before inserting the resulting image into Open Office.

Inserting An Image From The Gallery


The Gallery provides a convenient way to group reusable objects such as graphics and
sounds that we can insert into our documents. The Gallery is available in all
components of Open Office. It does not come with many graphics, but we can add
our own pictures or find extensions containing more graphics. To insert a Gallery
image into a Writer document:
1. To open the Gallery, click on the Gallery icon (located in the right side of the
Standard toolbar) or choose Tools > Gallery from the menu bar.
2. Navigate through the Gallery to find the desired picture.
3. To insert the picture, click and drag it from the Gallery into the Writer document. We
can also right-click on the picture and choose Insert>Copy.

Figure 1.6. Inserting an image from the Gallery


By default, the Gallery is docked above the Writer workspace. To expand the Gallery,
position the pointer over the line that divides it from the top of the workspace. When
the pointer changes to parallel lines with arrows, click and drag downward. The
workspace resizes in response.
To expand the Gallery without affecting the workspace, undock it so it floats over the
workspace. To do so, hold down the Ctrl key and double-click on the upper part of
the Gallery next to the View icons. Double-click in the same area while holding
down the Ctrl key to dock it again (restore it to its position over the workspace).
When the Gallery is docked, to hide it and view the full Writer workspace, click
the in the middle of the thin bar separating the Gallery from the workspace.
To close the Gallery, choose Tools > Gallery to uncheck the Gallery entry, or click
on the Gallery icon again.
Modifying An Image
To modify the inserted mage to suit the document we will use the Picture toolbar,
resizing, cropping, and a workaround to rotate a picture.
Using The Picture Toolbar
When we insert an image or select one already present in the document, the Picture
toolbar appears. We can set it to always be present (View > Toolbars > Picture).
Picture control buttons from the Picture toolbar can also be added to the Standard
Toolbar.
Two other toolbars can be opened from this one: the Graphic Filter toolbar, which can
be torn off and placed elsewhere on the window, and the Color toolbar, which opens
as a separate floating toolbar.
From these three toolbars, we can apply small corrections to the graphic or obtain
special effects.

Graphics mode
We can change color images to grayscale by selecting the image and then selecting
Grayscale from the Graphics mode list.

Flip vertically or horizontally


To flip an image vertically or horizontally, select the image, and then click the relevant
icon.
Filters
Table 1 provides a short description of the available filters. (Note : We can undo all
the changes by pressing Ctrl+Z or Alt+Backspace or by selecting Edit > Undo.)
Color
Use this toolbar to modify the individual RGB color components of the image (red,
green, blue) as well as the brightness, contrast, and gamma of the image.
Table 1: Graphic filters and their effects
Name Effect
Inverts the color values of a color image or the
Invert brightness values of a grayscale image.
Softens the contrast of an image.
Smooth
Increases the contrast of an image.
Sharpen

Remove noise Removes single pixels from an image.


Mimics the effects of too much light in a picture. A
Solarization further dialog box opens to adjust the parameters.
Simulates the effects of time on a picture. Can be
Aging applied several times. A further dialog box opens to
adjust the aging level.
Makes a picture appear like a painting by reducing the
Posterize number of colors used.

Pop Art Modifies the picture dramatically.

Charcoal Displays the image as a charcoal sketch.


A dialog box is displayed to adjust the light source that
will create the shadow and, hence, the relief effect.
Relief
Mosaic Joins groups of pixels into a single area of one color.

Transparency
Modify the percentage value in the Transparency box on the Picture toolbar to make
the image more transparent. This is particularly useful when creating a watermark or
when wrapping the image in the background.
Using The Formatting Toolbar And Picture Dialog
When an image is selected, we can customize some aspects of its appearance using
the tools available on the Formatting toolbar as well as in the dialog that is shown by
right-clicking on the image and selecting Picture.
Cropping Images
When we are only interested in a section of the image for the purpose of our
document, we may wish to crop (cut off) parts of it. To start cropping the image, right
click on it and select Picture from the pop-up menu. In the Picture dialog box, select
the Crop page (see Figure 1.7).

Figure 1.7: The options available when cropping a picture


In the Crop page, we can control the following parameters:
Keep scale / Keep image size
When Keep scale is selected (default), cropping the image does not change the scale
of the picture.
When Keep image size is selected, cropping produces enlargement (for positive
cropping values), shrinking (for negative cropping values), or distortion of the image
so that the image size remains constant.
Left, Right, Top, and Bottom
The image is cropped by the amount entered in these boxes. For example, a value of
3cm in the Left box cuts 3 cm from the left side of the picture.
• When Keep scale is selected, the size of the image also changes, so in this example
the width will be reduced by 3 cm.
• When Keep image size is selected, the remaining part of the image is enlarged
(when we enter positive values for cropping) or shrunk (when we enter negative
values for cropping) so that the width and height of the image remains unchanged.
Width and Height
The Width and Height fields under either Scale or Image size change as we enter
values in the Left, Right, Top, and Bottom fields. Use the thumbnail next to these
fields to determine the correct amount by which to crop.
Resizing an Image
The inserted image might not fit perfectly into the document if it is too big or too small.
In these cases, we can use Writer to resize the image.
1. Click the picture, if necessary, to show the green resizing handles.
2. Position the pointer over one of the green resizing handles. The pointer changes
shape giving a graphical representation of the direction of the resizing.
3. Click and drag to resize the picture.
4. Release the mouse button when satisfied with the new size.

The corner handles resize both the width and the height of the graphic object
simultaneously, while the other four handles only resize one dimension at a time.
To retain the original proportions of the graphic, Shift+click one of the corner handles,
then drag. Be sure to release the mouse button before releasing the Shift key.
Be aware that re-sizing a bit-mapped (raster) image will adversely affect the
resolution, causing some degree of blurring. It is better to externally size our picture
correctly before insertion into our presentation, if possible.

Figure 1.8. Three examples of resized images, plus the original image

For more accurate resizing, use either the Crop page of the Picture dialog box (Figure
1.7) or, for images, the Type page of the Picture dialog box. On the Crop page we
can adjust the following settings:
• Scale Width and Height: specify in percentages the scaling of the picture. The size
of the image changes accordingly. For a scaled resizing, both values should be
identical.
• Image size: specify the size of the image in our preferred unit of measurement.
The image enlarges or shrinks accordingly.
• Original size button: when clicked, restores the image to its original size.
In the Type page of the Picture dialog box, select the Relative option to toggle
between percentage and actual dimension. For a scaled resizing, select the Keep ratio
option. As for the Crop page, clicking on the Original Size button restores the original
image size.
Rotating a Picture
Writer does not provide a tool for rotating a picture; however, there is a simple
workaround:
1. Open a new Draw or Impress document (File > New > Drawing or File > New >
Presentation).
2. Insert the image we want to rotate. we can use any of the mechanisms described in
“Error! Reference source not found.” on page Error! Bookmark not defined.,
although there are some slight variations in the position of the menu entries and
icons.
3. Select the image, then in the Drawing toolbar (shown by default at the bottom of

the window in Impress and Draw), select the Rotate icon from the Effects tear-
off toolbar .
4. Rotate the image as desired. Use the red handles at the corners of the picture and
move the mouse in the direction we wish to rotate. By default the picture rotates
around its center (indicated by a black crosshair), but we can change the pivot
point by moving the black crosshair to the desired rotation center.
To restrict the rotation angle to multiples of 15 degrees keep the Shift key pressed
while rotating the image.
5. Select the rotated picture by pressing Ctrl+A, then copy the image to the clipboard
with Ctrl+C.
6. Finish by going back to the location of the Writer document where the image is to
be inserted and pressing Ctrl+V.
Creating Drawing Objects
To begin using the drawing tools, display the Drawing toolbar (Figure 1.9), by clicking
View > Toolbars > Drawing.
Figure 1.9. The Drawing toolbar
To use a drawing tool:
1. Click in the document where we want the drawing to be anchored. We can change
the anchor later, if necessary.
2. Select the tool from the Drawing toolbar (Figure 7). The mouse pointer changes to

a drawing-functions pointer .
3. Move the cross-hair pointer to the place in the document where we want the
graphic to appear and then click-and-drag to create the drawing object. Release the
mouse button. The selected drawing function remains active, so we can draw
another object of the same type.
4. To cancel the selected drawing function, press the Esc key or click on the Select
icon (the arrow) on the Drawing toolbar.
5. We can now change the properties (fill color, line type and weight, anchoring, and
others) of the drawing object using either the Drawing Object Properties toolbar or
the choices and dialog boxes reached by right-clicking on the drawing object.
Set or Change Properties For Drawing Objects
To set the properties for a drawing object before we draw it:
1. On the Drawing toolbar (Figure 9), click the Select tool.
2. On the Drawing Object Properties toolbar (Figure 1.10), click on the icon for each
property and select the value we want for that property.
3. For more control, or to define new attributes, we can click on the Area or Line
icons on the toolbar to display detailed dialog boxes.
The default we set applies to the current document and session. It is not retained when
we close the document or close Writer, and it does not apply to any other document
we open. The defaults apply to all the drawing objects except text objects.

Figure 1.10. Drawing Object Properties toolbar


To change the properties for an existing drawing object:
1. Select the object.
2. Continue as described above.
We can also specify the position and size, rotation, and slant and corner radius properties
of the drawing object:
1. Right-click on the drawing object and then click Position and Size from the pop-
up menu. The Position and Size dialog box is displayed.
2. Choose any properties, as required.
Resizing a Drawing Object
The same considerations for resizing an image apply also to resizing an object. Select
the object, click on one of the eight handles around it and drag it to its new position.
For a scaled resizing, select one of the corner handles and keep the Shift key pressed
while dragging the handle to its new position.
For more sophisticated control of the size of the object,
• Select Format > Object > Position and Size from the menu bar.
• Use the Position and Size dialog box to set the width and height independently.
• If the Keep ratio option is selected, then the two dimensions change so that the
proportion is maintained, allowing for a scaled resizing.
Grouping Drawing Objects

To group drawing objects:


1. Select one object, then hold down the Shift key and select the others we want to
include in the group. The bounding box expands to include all the selected objects.
2. With the objects selected, hover the mouse pointer over one of the objects and
choose Format > Group > Group from the menu bar or right-click and choose
Group > Group from the pop-up menu.
We cannot include an embedded or linked graphic in a group with drawing objects.
Positioning Image/Graphics Within The Text

When we add a graphic to a text document, we need to choose how to position it


with respect to the text and other graphics.
Positioning of a graphic is controlled by four settings:
1. Arrangement refers to the placement of a graphic on an imaginary vertical axis.
Arrangement controls how graphics are stacked upon each other or relative to the
text.
2. Alignment refers to the vertical or horizontal placement of a graphic in relation
to the chosen anchor point.
3. Anchoring refers to the reference point for the graphics. This point could be the
page, or frame where the object is, a paragraph, or even a character. An image
always has an anchor point.
4. Text wrapping refers to the relation of graphics to the surrounding text, which
may wrap around the graphic on one or both sides, be overprinted behind or in
front of the graphic, or treat the graphic as a separate paragraph or character.

The settings can be accessed in a number of ways, depending on the nature of the
graphics:

1. From the Format menu, where we can find Alignment, Arrange, Wrap, and
Anchor (both for images and drawing objects).
2. From the pop-up menu displayed when we right-click on the graphic.
3. From the Object toolbar shown in Figure 1.11.
4. For images, from the Type and Wrapping pages of the Picture dialog box. Note
that we cannot control the arrangement using the dialog box. To open the
Picture dialog box, click on the image to select it and then choose Format >
Picture or right-click on the graphic and choose Picture on the pop-up menu.
5. For drawing objects, from the Position and Size page of the Position and Size
dialog box. To open the Position and Size dialog box, click on the drawing
object to select it and then choose Format > Object > Position and Size or
right-click on the graphic and choose Position and Size on the pop-up menu.
Note that we can only control the alignment and anchoring.
Figure 1.11. Object toolbar (graphical control of positioning for images)

SESSION : 3 CREATE AND USE TEMPLATE


Relevant Knowledge
A template is a predefined layout (or blue print) that contains sample content,
themes, colours, font styles, background styles, etc., and gives an initial foundation
to create a document.
Creating a Template
We can create our own templates in two ways: from a document, and using a wizard.
Creating A Template From A Document
To create a template from a document:
1. Open a new or existing document of the type we want to make into a template
(text document, spreadsheet, drawing, presentation).
2. Add the content and styles that we want.
3. From the main menu, choose File > Templates > Save.

Template Dialog

Figure 1.12: Saving a new template


The Templates dialog opens (see Figure 1.12).
1. In the New template field, type a name for the new template.
2. In the Categories list, click the category to which we want to assign the template.
The category we choose has no effect on the template itself; it is simply the
folder in which we save the template. Choosing an appropriate category makes
it easier to find the template when we want to use it. For example, we might
save Impress templates under the Presentations category.
3. Click OK to save the new template.
Any settings that can be added to or modified in a document can be saved in a template.
For example, below are some of the settings that can be included in a Writer document
and then saved as a template for later use:
1. Printer settings: which printer, single sided / double sided, and paper size, and so on
2. Styles to be used, including character, page, frame, numbering and paragraph styles
3. Format and settings regarding indexes, tables, bibliographies, table of contents
Templates can also contain predefined text, saving we from having to type it every
time w e create a new document. For example, a letter template may contain our
name, address and salutation.
Creating A Template Using A Wizard
We can use wizards to create templates for letters, faxes, agendas, presentations, and
Web pages. For example, the Fax Wizard guides we through the following choices:
1. Type of fax (business or personal)
2. Document elements like the date, subject line (business fax), salutation, and
complementary close
3. Options for sender and recipient information (business fax)
4. Text to include in the footer (business fax)
Creating a template using a wizard:
1. From the main menu, choose File > Wizards >[type of template required](see
Figure 1.13).
2. Follow the instructions on the
pages of the wizard. This process
is slightly different for each type
of template, but the format is very
similar.
3. In the last section of the wizard,
we can specify the name and location for saving the template. Figure 1.13.
Creating a template using a wizard
The default location is our user templates directory, but we can choose a
different location if we prefer.
4. Finally, we have the option of creating a new document from our template
immediately, or manually changing the template. For future documents, we can
reuse the template created by the wizard, just as we would use any other
template.
Setting A Default Template
If we create a document by choosing File > New > Text Document (or Spreadsheet,
Presentation, or Drawing) from the main menu, Open Office creates the document
from the Default template for that type of document. We can, however, set a custom
template to be the default. we can reset the default later if we choose.
Setting a custom template as the default
We can set any template to be the default, as long as it is in one of the folders displayed
in the Template Management dialog.
To set a custom template as the default:
1. From the main menu, choose File > Templates > Organize. The Template
Management dialog opens.
2. In the box on the left, select the folder containing the template that we want to
set as the default, then select the template.
3. Click the Commands button and choose Set As Default Template from the drop-
down menu.
The next time that we create a document by choosing File > New, the document will
be created from this template.
Resetting the default template
To re-enable Open Office’s Default template for a document type as the default:
1. In the Template Management dialog, click any folder in the box on the left.
2. Click the Commands button and choose Reset Default Template from the drop-
down menu.
The next time that we create a document by choosing File > New, the document will
be created from Open Office’s Default template for that document type.
Using The Template
To use a particular template, choose File > New > Templates and Documents. We'll
see the templates window and our templates; if we don't, select the Templates icon at
the left.

Figure 1.14. Opening templates


Select the template we want. Any information about the template will be displayed.

Figure 1.15. Using a template


Double-click the template or click on open to open it. Now we can use the template
according to our choice.
Changing To A Different Template
To change to a different template, choose File > New > Templates and Documents.
We'll see the templates window and our templates; if we don't, select the Templates
icon at the left.

Figure 1.16. Opening templates


Select the template we want. Any information about the template will be displayed.

Figure 1.17. Changing to a different template


Double-click the template or click on open to open it. Now we can use the template
according to our choice.
Updating a Document
To update a document simply go to File→ Save As and all changes made to the
document will be saved.
SESSION 4. CREATE AND CUSTOMIZE TABLE OF CONTENTS
Creating a Table of Contents
Writer’s Table of Contents feature lets us build an automated table of contents from
the headings in our document. Before we start, make sure that the headings are styled
consistently. For example, w e can use the Heading 1 style for chapter titles and
the Heading 2 and Heading 3 styles for chapter subheadings.
Opening Writer's Table Of Contents Feature
Although tables of contents can be customized extensively in Writer, often the default
settings are all we need. Creating a quick table of contents is simple:
1. Assign unique heading styles to each section or chapter of the document.
2. Insert a table of contents using the appropriate option from the menu or
toolbar.
3. Customize the table of contents by choosing the desired style and formatting
options to match the document's design and layout.
4. Update the table of contents whenever changes are made to the document's
structure or content to ensure its accuracy and usefulness to the reader.
OR
1. When we create our document, use the following paragraph styles for different
heading levels (such as chapter and section headings): Heading 1, Heading 2,
and Heading 3. These are what will appear in our table of contents. we can use
more levels of headings, but the default setting is to use only the first three levels
in the table of contents.
2. Place the cursor where we want the table of contents to be inserted.
3. Select Insert > Indexes and Tables > Indexes and Tables.
4. Change nothing in the Insert Index/Table dialog. Click OK.
If we add or delete text (so that headings move to different pages) or we add, delete,
or change headings, we need to update the table of contents. To do this:
1. Place the cursor within the table of contents.
2. Right-click and select Update Index/Table from the pop-up menu.

Figure 1.14. The Index/Table tab.


Using the Index/Table tab
Use the Index/Table tab, pictured in Illustration 1 on page 1, to set the table's
attributes.
Setting Basic Attributes
To set the table's basic attributes:
1. From the Type drop-down list in the Type and title area of the tab, select Table of
Contents if it isn't already selected.
2. From the drop-down list in the Create index/table area, select Entire document.
3. In the Create from area, check the Outline check box.
4. In the Create from area, clear the Index marks check box.
Adding A Title
If we'd like the Table of Contents to have a title, enter it in the Title field. (If Writer
entered a title in this field automatically, we can change it by simply typing over the
value.) To delete the title, clear the Title field.
Protecting Against Manual Changes
To protect the table of contents from being changed accidentally, check the Protected
against manual changes check box.
If this box is checked, the Table of Contents can only be changed using the context
menu or the Insert Table/Index window.
If the box isn't checked, the Table of Contents can be changed directly on the document
page, just like other text.
Changing The Number Of Levels
By default, Writer evaluates 10 levels of headings when it builds the table of contents.
To change the number of levels evaluated, enter the desired number in the Evaluate up
to level spin box.
Assigning Custom Styles
Writer automatically assigns to the table of contents all paragraphs formatted with the
default heading styles (Heading 1, Heading 2, and so on). To assign paragraphs
formatted with custom styles, follow these steps:
1. In the Create from area, check the Additional Styles check box.
2. Click the (...) button to the right of the check box. The Assign Styles window opens.

Figure 1.15. Assign Styles window


3. In the Not applied column, click the style that we want to assign to the Table of
Contents.
4. Use the >> button to move the selected style to the desired outline level. For
example, if we want paragraphs formatted with the selected style to appear as top-
level entries in the table of contents, click the >> button once to move the style into
the 1 column. To move the style in the opposite direction, use the << button.
5. Click OK to save our changes and return to the Index/Table tab. Or, click Cancel
to return without saving our changes.
Using The Entries Tab
Use the Entries tab, pictured in Illustration 3 on page 4, to format the entries in the
Table of Contents. For each outline level, we can add and delete elements, such as
chapter numbers, and we can also apply character styles to individual elements.

Figure 1.16. Entries tab


To begin, click a level number in the Level column to select the outline level whose
elements we want to format. (We'll be able to apply our changes to all outline levels
later.) The Structure line displays the elements for entries in that level. Each button on
the Structure line represents one element:
▪ The E# button represents the chapter number.
▪ The E button represents the entry text.
▪ The T button represents a tab stop.
▪ The # button represents the page number.
▪ The LS button represents the start of a hyperlink. (This button doesn't appear on the
default Structure line.)
▪ The LE button represents the end of a hyperlink. (This button doesn't appear on the
default Structure line.)
Each white field on the Structure line represents a blank space.
Deleting Elements
To delete an element from the Structure line, click the button that represents that element
and then press the Delete key on our keyboard. For example, to delete a tab stop, click
the T button and then press the Delete key.
Adding Elements
To add an element to the Structure line, follow these steps:
1. Place our cursor in the white field to the left of where we want to insert the element.
2. Click one of the five buttons that are just below the Structure line. (For example, to
add a tab stop, click the Tab stop button.) A button representing the new element
appears on the Structure line.
Note that if we insert a hyperlink, we must indicate both the beginning and end of the
link. For example, to change the default Structure line so that the chapter number and the
entry text form a hyperlink, follow these steps:
1. On the Structure line, place our cursor in the white field to the left of the E# button.
(Recall that the E# button represents the chapter number.)
2. Click the Hyperlink button. An LS button, representing the start of the hyperlink,
appears on the Structure line.
3. On the Structure line, place our cursor in the white field to the right of the E button.
(Recall that the E button represents the entry text.)
4. Click the Hyperlink button again. An LE button, representing the end of the hyperlink,
appears on the Structure line.
Applying Character Styles
To apply a character style to an element on the Structure line:
1. On the Structure line, click the button that represents the element to which we want
to apply a style.
2. From the Character Style drop-down list, select the desired style. Writer applies the
selected style to the selected element.
To view or edit the attributes of a character style, select the style from the Character
Style drop-down list and then click the Edit button.
Applying Changes To All Outline Levels
To apply the displayed structure and formatting to all outline levels, click the All button.
Using The Styles Tab
Use the Styles tab, pictured in Illustration 4 on page 6, to apply paragraph styles to the
table of contents. we can apply a different paragraph style to each outline level of the
table.

Figure 1.17. Styles tab


To apply a paragraph style to an outline level, follow these steps:
1. In the Levels list box, select the desired outline level by clicking it.
2. In the Paragraph Styles list box, click the paragraph style that we want to apply.
3. Click the < button to apply the selected paragraph style to the selected outline level.
To remove paragraph styling from an outline level:
1) In the Levels list box, select the desired outline level by clicking it.
2) Click the Default button.
To view or edit the attributes of a paragraph style, click the style in the Paragraph Styles
list box and then click the Edit button.
Using The Background Tab
Use the Background tab, pictured in Illustration 5 on page 7, to add color or a graphic to
the table background.
Adding Color
To add color to the background of the table of contents, simply click the desired color in the
color grid.

Figure 1.18. Background tab


Adding A Graphic
To add a graphic to the background of the table of contents, follow these steps:
1. From the As drop-down list, select Graphic. The Background tab displays the graphics
options.
2. Click the Browse button. The Find Graphics window opens.
3. Find the graphic file that we want to use and then click the Open button. The Find
Graphics window closes and the selected graphic appears in the graphic preview box
on the right-hand side of the Background tab. (If we don't see the graphic, check the
Preview check box underneath the graphic preview box.)

Figure 1.19. Graphics options on the Background tab

4. In the Type area of the Background tab, choose how we want the background graphic
to appear:
● To position the graphic in a specific location in the background, select Position and
then click the desired location in the position grid.
● To stretch the graphic so that it fills the entire background area, select Area.
● To repeat the graphic across the entire background area, select Tile.
Deleting Color Or Graphics
To delete color or graphics from the table background, follow these steps:
1. From the As drop-down list, select Color.
2. Click No Fill on the color grid.
Saving The Table Of Contents
To save the table of contents so that the table appears in our document, click OK. The
Insert Index/Table window closes and the table of contents appears in our document.
Maintaining A Table Of Contents Editing A Table Of Contents
To edit an existing table of contents:
1. Click anywhere in the table of contents and then right click. The context menu
appears.
2. From the context menu, choose Edit Index/Table. The Insert Index/Table window
opens and we can edit and save the table using the four tabs described in the previous
chapter.
Updating A Table Of Contents
To update a document's table of contents when changes are made to the document:
1. Click anywhere in the table of contents and then right click. The context menu
appears.
2. From the context menu, choose Update Index/Table. Writer updates the table of
contents to reflect the changes in the document.
Deleting A Table Of Contents
To delete the table of contents from a document:
1. Click anywhere in the table of contents and then right click. The context menu
appears.
2. From the context menu, choose Delete Index/Table. Writer deletes the table of
contents.
SESSION 5. IMPLEMENT MAIL MERGE
Advance concept of mail merge in word processing
A mail merge is a way to take a letter we’ve written and send it to a whole bunch of
people, personalizing it with information about them so they might think that we typed
that letter personally for them. A mail merge can also be a quick way to take a list of
people’s mailing addresses and generate labels or envelopes with the address for a
different person on each label or envelope.
Create a Mail Merge Document: Letter
1. Open a template, if we have one we want to use, or create a new Writer document.
2. Save the document with the appropriate name, like mailmerge_openenrollment.ods or
mailmerge_parents.odt.
Note: Don’t save it in Word format. we must save it in OpenOffice.org Writer format
or the mail merge won’t work.
3. Write out the text that will be going to everyone, and plan where we want the fields.
For instance, we might know that we are going to have an address block at the top of the
letter, so we’ll leave a few blank lines for that. Then we’d write something like this,
know that we’d add the fields firstname and years_of_service later:
Dear ,
Remember that next month is open enrollment for benefits. Employees with over five
years of experience are also eligible for sabbatical; you have been with us for years so
please get your application in early if you plan to apply.
Regards,
Human Resources
If we’re doing anything complex and this is our first mail merge letter, write out the
letter completely as we want it to read including sample data. Use all the text, including
samples for firstname, lastname, etc. This will help we determine which fields we need
to use, where we need spaces before and after fields, etc.
4. Once we have the letter written out and we know what fields we need, we can delete the
specific data like “Ms. Smithson” and insert the fields from the database instead.
To Make The Data Source And Entering Data
OpenOffice.org is set up with a middle-man file in the mail merge process to make
merging work easily. We’ll create a small file, one for each spreadsheet or other data
source. Once we create it, we don’t have to do it again.
1. Choose File > New > Database. We’ll see this window:

Figure 1.20 : Database Wizard


2. Select the type of data: spreadsheet data, text file data, o u r particular type of
address book, or the type of database we’re using like Access or MySQL. It’s very
important to select the right type.
Figure 1.21 : Selecting the database type in Database Wizard

3. Click Next.
4. What we do here depends on what we chose as the type of data we’re working with.
Spreadsheet
We’ll see this window. Click the Browse button and find the spreadsheet containing our
data. Then click Next and continue to step 5.

Figure 1.22 : Selecting the spreadsheet in Database Wizard


Text File
We’ll see this window. Click the Browse button and find the directory containing our
text files.

Figure 1.23: Selecting the text file in Database Wizard


Fill out the rest of the information:
Specify the type of files we want to access: Specify whether the file name ends in .txt
or .csv.
Row format: In the Field Separator list, specify what character separates each column: a
tab, a comma, etc. Tab and comma are common. In the other lists, if 11111, We don’t
know the characters used to indicate each type of information, just leave the defaults as
it is. Then click Next and continue to step 5.
Access
We’ll see this window. Click the Browse button and find the .mdb Access file containing
our data. Then click Next and continue to step 5.

Figure 1.24 : Selecting the Access database in Database Wizard


Address book
We don’t have to specify anything if we choose to get our data from our email address
book; the system automatically finds it. Continue to step 5.
5. In this window, just be sure to keep the option for registering selected. Unmark the
selection to open the database for editing unless we want to see the database editing
window. (We don’t need to unless we want to make a query or other database-related
item, which we haven’t talked about yet.)
Figure 1.25 : Deciding how to proceed after saving the database in Database Wizard
6. Click Finish.

7. We’ll be prompted to save the database file. Name it something very descriptive; this
is the name we’ll be looking for when we’re adding database files to our mail merge
documents. The name can be the same as the data source that we’re basing it on, or
entirely different. The file will end in .odb and be stored in whatever directory we
choose. It doesn’t have to be in the same directory as the data.

Figure 1.26 : Saving the database


8. We can see our databases by pressing F4 when we’re in a Writer or Calc document.
Click the + icon next to the database we created to see the items named Queries and
Tables. Click the + next to Tables to see the tables we created; select a table to see the
data in it.
Figure 1.27 :Viewing the content in selected table

When we’re done viewing our databases, press F4 again to hide the pane.

We’re done creating the database file. we only need to do this once for every
spreadsheet, database, or directory of text files.
Merging The Data Source With Main Document
1. Open the letter we want to use.
2. Once we have the letter written out and we know what fields we need, we can delete
the specific data like “Ms. Smithson” and insert the fields from the database
instead.
Press F4. Click the + next to the database we want, then click the + next to Tables and
the + next to the table we want.

Figure 1.28 :Viewing the content in selected table


3. Now just drag the field we want into the letter, to the place we want it.
a. Click and hold down on the name of the first field we want. Don’t click on the data, like
Smithson; click on the name of the field, like lastname.

Figure 1.29 : Selecting the field to insert in the document


b. Drag the field name into the letter to the place where we want it. The mouse will have
a + attached to it as shown.

c. Release the mouse. The field will appear. we won’t see the data yet; we’ll see the
field name.

4. If we didn’t get it exactly where we want it, just select it, and cut and paste it to
the place where we want it. The easiest way to select a field is to click on the right side
of it, hold down the Shift key, and press the left keyboard key once. Then it’s
selected and we can cut or copy.
5. Drag in all the other fields we want, the same way. If we want a field in the letter
twice, we can drag it twice, or drag it in once, then copy and paste it to the other
location.
6. The fields should display with a gray background, as shown. It won’t print; it just
helps we see which text is from the database and which text we typed.
7. Format the document any way we want it. The fields respond to formatting the
same way that normal text does.
8. We’re done creating the mail merge document. we only need to do this once. The
next step is to either print the letter to a printer, or “print” to a Writer file so we can see
all the data merged, and so we can customize, before printing on paper. Continue to the
printing step.
Editing a saved file of mailing labels
To edit a saved file of mailing labels, open the saved label file in the normal way. we
will be prompted to update all links. Choose No for the following reason: The first label
on the page is termed the “Master Label” and all other labels are linked to it. If we update
the links, then all labels will end up containing the same data, which is probably not what
we want. we can edit individual records in the normal way, by highlighting and
changing the font name, for example.
However, we cannot edit all labels globally (for example, to change the font name for all
records) by the technique of selecting the entire document. To achieve this result we have
to edit the paragraph style associated with the label records as follows.
● Right-click any correctly spelled word in a label record.
- Select Edit Paragraph Style from the context menu. (Note: If we click on a misspelled
word, a different menu appears.)
- Then from the Paragraph Style dialog, we can make changes to the font name, the font
size, the indents, and other attributes.
Printing Mailing Labels
Before beginning this process, note the brand and type of labels we intend to use.
Preparing For Printing
To prepare mailing labels for printing:
1. Choose File > New > Labels.
2. On the Options tab, ensure that the
Synchronize contents option is
selected.
3. On the Labels tab (), select the
Database and Table. Select the
Brand of labels to be used, and then
select the Type of label.
4. If we are unable to identify our Figure 1.30 : Required information for label set-up
label product in the list, then we can define the labels we have. Select the User
setting in the Type selection box. Click on the Format tab of the Labels dialog. The
default settings are shown in . Take a ruler and measure on our labels those
dimensions illustrated in , and enter them into the respective boxes on the left side.

Figure 1.31: Select Database, Table, label Brand, and label Type
Figure 1.32: User label default settings
5. We can now save our label template if we are likely to use it again. Click Save.
6. In the Save Label Format dialog that opens (), enter names for our label Brand
and Type. Click OK.

Figure 1.33: Name and save the label.


7. Click the Labels tab. Click the drop-down arrow under Database field. Select the first
field to be used in the label (in this example, Title). Click the left arrow button to
move this field to the Label text area, as shown in Figure.

Figure 1.34: Move fields from Database field list to Label text area
8. Continue adding fields and inserting desired punctuation, spaces, and line breaks until
the label is composed. shows the completed label.
Figure 1.35: The completed label
9. Click New Document. we now have a new, single-page document containing a
series of frames, one for each label of the selected type and filled with the data
source address fields that we selected. Quite often some of the fields in our address
data source will be unused, leading to blank lines in our labels. If this is not
important, go to “” on page; otherwise, continue with “”.
Removing Blank Lines From Labels
1. First ensure that the label frames are showing the field contents (data source
headings), rather than their underlying field names. If this is not the case, then either
press Ctrl+F9 or choose View > Field Names to toggle the view.
2. Next, ensure that we can see non-printing characters, such as paragraph marks, line
breaks and so on. If these are not already visible, choose View > Nonprinting
Characters from the Menu bar, or press Ctrl+F10, or click on the Nonprinting
Characters icon ( ) on the Standard toolbar.
We will now see that address field separation is created by line breaks ( ), rather
than paragraphs ( ). As the suppression of blank address fields depends on hiding
paragraphs, not lines, we need to replace line breaks with paragraphs as follows.
3. Click in the first label, at the end of the last data source address field in the first line
of the label. Press Delete to remove the new line character and then press Return (or
the Enter key) to insert a paragraph marker. Repeat this action for each line in the
address. If the line spacing in the first label is not satisfactory, we may wish to
correct this before proceeding, by modifying the paragraph style associated with the
address.
Unless we have changed it, the address uses the Default style.

Note: The objective of step 3) is to replace all line breaks at the end of data source address
fields with paragraphs. Sometimes the address data field may be longer than the width of
the label and will wrap to the next physical line: make sure that you are not misled by this
into deleting and replacing anything other than line break characters.

4. Click again at the end of the first paragraph to be conditionally suppressed and then
choose Insert > Fields > Other. Select the Functions tab and then click on
Hidden Paragraph in the Type column. Now click in the Condition box and enter
the details of the condition that defines a blank address field. It has the general
form of:
![Database.Table.Database field] where the „!‟ (NOT) character indicates the negative
case and the square brackets indicate the condition.
For example, in our Points database the condition to test if the Last Name field is empty
would be
![Points.Sheet1.Last Name] as illustrated in .
To test for multiple conditions, use the operators AND and/or OR between the conditional
statements, for example:
![Points.Sheet1.Title]AND![Points.Sheet1.Last Name]
Click Insert, but do not close the dialog until all lines have been amended.
● Repeat for each paragraph to be conditionally suppressed, remembering to advance
the cursor to the end of the line in question before changing the last element of the
condition and Inserting the result.

Note: The last paragraph of the label address block ends with a special field, Next record:
Database. Table (Next record: Points.Sheet1in our example), and the Hidden paragraph
field must be inserted before this field. This can generally be accomplished by clicking at
the end of the paragraph and then using the Left Arrowkey once to skip back over it. A
clue that we omitted this action is the observation that some records have been skipped
and are missing from the final output.

● Remembering that we selected Synchronize contents earlier, we should now be


able to see a small window containing a Synchronize Labels button. Click on this button
and the hidden paragraph fields are propagated to all the labels in our document.
We now have a template suitable for future use with the same data source and type of
label. If we wish to save it, use File > Templates > Save as Template to save it as an
Open Document Text Template (.ott) into the My Templates folder in the Templates
Manager dialog.

Printing
● Choose File > Print. The message shown in appears. Click Yes to print.
● In the Mail Merge dialog (), we can choose to print all records or selected records.
To select records to be printed, use Ctrl+click to select individual records. To select
a block of records, select the first record in the block, scroll to the last record in the
block, and Shift+click on the last record.
● Click OK to send the labels directly to the printer.
If we prefer to save the labels to a file, perhaps to allow some later editing such as
changing the typeface or paragraph format, then we should select File in the output
section of the Mail Merge dialog, rather than using the default Printer selection. This
changes the dialog to highlight the Save merged document section, where Save as single
document is preselected.
In this case, clicking OK brings up the Save as dialog, where a file name can be entered
for the saved labels.
If we did not save the prototype label fields document (template) in Step 6 of the
Removing blank lines from documents paragraph, then we are prompted to do so now by
another Save as dialog.
In either case, whether printing or saving to file, despite there apparently being only one
page of labels, the printed or saved output will be expanded to include all of the selected
records from the data source.

Printing to a File for Previewing or Customizing Before Printing on Paper


To print to a file – that is, to just generate a Writer document with the merged results –
select File and Save as Single Document. Then click OK.

Figure 1.36: Mail Merge Dialog box


We’ll be asked to give a file name. This is the name of the merged document. Name it
and click Save.
Figure 1.37: Saving the merged document
We’ll see the print monitor counting through the records.

Now choose File > Open and open that file we just named.
Note: When we open the output from merged labels, don’t click yes when we see this
message. Click No. If we click Yes accidentally, just close it without saving, and
reopening it, clicking No this time.

We’ll see the merged results.


Here’s one example of a merged letter:
Figure 1.38: The merged document
And merged labels:

Figure 1.39: The merged labels


At this point we can view the document and proof it, make any changes we want, and
save it. Then to print it, just print it like a normal document, since it’s already merged
with the data from the database.

ACTIVITY
1. Type a letter inviting friends and/or family to a party we are hosting. For example,
we can host a birthday party or our parents‟ anniversary party. we pick the event. our
letter will serve as our form letter. Save our letter as Mail Merge Letter.
2. Format the letter as left aligned (block letter) with .5” or 1” margins depending on
the length.
3. Make sure our address is listed at the top of the document. Then insert two blank
lines and put the date in the month, date, year format. Then enter four blank lines
and leave space for our merge fields. Example:
Title First Name Last
Name Address 1
Address 2 City,
State Pin Code
(Eventually we will be entering our merge fields to replace this information.)
4. Create a data source with the names and addresses of at least five families in which
we wish to mail the letters. Create fields such as: title, first name, last name, address
1, address 2, city, state, and pin code. Or make appropriate field names of our
choice but make sure we include the address information. Save our data source as
Mail Merge Data.
5. Now, return to our main document (Mail Merge Letter) and set it as the form
document and identify our data source.
6. Enter our merge fields into our main document. Merge fields should be used for
the recipients address and after Dear.
7. After our merge fields are entered merge the document and save it. Save the
merged document as Mail Merge Merged.
8. Create labels inserting our merge fields for the recipient’s name and address. Save
the merged labels as Mail Merge Labels.
9. Print our form letter, one merged letter,
and one label.
UNIT-2: ELECTRONIC SPREADSHEET (ADVANCED)
SESSION 1: ANALYZE DATA USING SCENARIOS AND GOAL SEEK
Consolidating data
Data Consolidation allows us to gather our data from separate worksheets into a master
worksheet. In other words, the Data Consolidation function takes data from a series of
worksheets or workbooks and summaries it into a single worksheet, that we can update
easily.
1) Open the worksheet that contains the cell ranges to be consolidated.
2) Choose the Consolidate option under the Data menu as shown. The Consolidate
dialog box is shown.

Figure 2.1: Consolidate option under Data Menu

Figure 2.2: Consolidate Dialog box defining the data to be consolidated

3) If the Source data range list contains named ranges, we can select a source cell
range to consolidate with other areas.
If the source range is not named, click in the field to the right and either type a
reference for the first source data range or use the mouse to select the range on the
sheet. (We may need to move the Consolidate dialog to reach the required cells.)
4) Click Add. The selected range now appears on the Consolidation ranges list.
5) Select additional ranges and click Add after each selection.
6) Specify where we want to display the result by selecting a target range from the Copy
results to box.
If the target range is not named, click in the field next to Copy results to and enter
the reference of the target range or select the range using the mouse or position the
cursor in the top left cell of the target range.
7) Select a function from the Function list. The function specifies how the values of the
consolidation ranges are linked. The Sum function is the default setting.
Most of the available functions are statistical (such as AVERAGE, MIN, MAX,
STDEV), and the tool is most useful when we are working with the same data over
and over.
8) Optionally click More in the Consolidate dialog to display additional settings.
• Select Link to source data to insert the formulas. This generates the results in
the target range instead of the actual results. If we link the data, any values
modified in the source range are automatically updated in the target range. The
corresponding cell references in the target range are inserted in consecutive
rows, which are automatically ordered and then hidden from view. Only the
result, based on the selected function, is displayed.
• Under Consolidate by setting, select either Row labels or Column labels, if
the cells of the source data range are not to be consolidated corresponding to
the identical position of the cell in the range, but instead according to a
matching row label or column label. To consolidate by row labels or column
labels, the label must be contained in the selected source ranges. The text in
the labels must be identical, so that rows or columns can be accurately
matched. If the row or column label does not match any that exist in the target
range, it will be appended as a new row or column.
9) Click OK to consolidate the ranges.
10) If we are continually working with the same range, then we probably want to use
Data > Define Range to give it a name. Define Range option is available under the
Data Menu.
The data from the consolidation ranges and target range are saved when we save the
worksheet. If we later open a worksheet in which consolidation has been defined,
this data will again be available.
Creating Subtotals
SUBTOTAL is a feature that is used for generating subtotals to summarise data. It helps
to manage, analyse, and extract specific information from the rows of related data. It is a
good practice to use sorted data while applying the Subtotal command on it. It is
accessible from Data menu as shown in Figure2.3.
Figure 2.3: Subtotal option under Data Menu

SUBTOTAL, totals/adds data arranged in an array—that is, a group of cells with labels
for columns and/or rows. Using the Subtotals dialog, w e can select arrays, and then
choose a statistical function to apply to them. For efficiency, we can choose up to three
groups of arrays to which to apply a function. When we click OK, Calc adds subtotals
and grand totals to the selected arrays, using the Result and Result2 cell styles for them.
Steps to insert subtotal values into a sheet:
1) Ensure that the columns have labels.
2) Select the range of cells that we want to calculate subtotals for, and then choose Data
-> Subtotals.
3) In the Subtotals dialog, in the Group by box, select the column that we want to add
the subtotals to. If the contents of the selected column change, the subtotals are
automatically recalculated.
4) In the Calculate subtotals for box, select the columns containing the values that we
want to subtotal.
5) In the Use function box, select the function that w e want to use to calculate the
subtotals.
6) Click OK.
Figure 2.4: Setting up subtotals
If we use more than one group, then we can also arrange the subtotals according to
choices made on the dialog‘s Options page (Figure 2.5), including ascending and
descending order or using one of the predefined custom sorts defined under Tools menu
as Tools-> Options-> OpenOffice.org Calc-> Sort Lists.

Figure 2.5: Choosing options for subtotals

Using “What If” Scenarios


Scenarios are a tool to test “what-if” questions. It enables us to manage and view data from
different input values. Each scenario is named, and can be edited and formatted separately.
When we print the spreadsheet, only the content of the currently active scenario is
printed.
A scenario is essentially a saved set of cell values for our calculations. we can easily
switch between these sets using the Navigator or a drop-down list which can be shown
beside the changing cells. For example, if we wanted to calculate the effect of different
interest rates on an investment, we could add a scenario for each interest rate, and quickly
view the results. Formulas that rely on the values changed by our scenario are updated
when the scenario is opened. If all our sources of income used scenarios, we could
efficiently build a complex model of our possible income.
Creating Scenarios
Use Scenarios option under Tools menu to enter variable contents—scenarios—in the
same cell. To create a scenario:
1) Select the cells that contain the values that will change between scenarios. To select
multiple cells, hold down the Ctrl key as we click each cell.
2) Choose Tools > Scenarios.
3) On the Create Scenario dialog (Figure 2.6), enter a name for the new scenario. It‘s
best to use a name that clearly identifies the scenario, not the default name as shown
in the illustration. This name is displayed in the Navigator and on the title bar of the
scenario on the sheet itself.

Figure 2.6: Creating a scenario


4) Optionally add some information to the Comment box. The example shows the
default comment. This information is displayed in the Navigator when we click the
Scenarios icon and select the desired scenario.
5) Optionally select or deselect the options in the Settings section. See below for more
information about these options.
6) Click OK to close the dialog. The new scenario is automatically activated.
we can create several scenarios for any given range of cells.
Using Goal Seek
Goal Seek is a feature of Calc that is used to find the optimum value for one or more
target variables, given with the certain conditions. It allows us to try different values in
the formula to arrive at a solution for the input value.
To take a simple example, imagine that the Chief Financial Officer of a company is
developing sales projections for each quarter of the forthcoming year. She knows what
the company’s total income must be for the year to satisfy stockholders. She also has a
good idea of the company’s income in the first three quarters, because of the contracts
that are already signed. For the fourth quarter, however, no definite income is available.
So how much must the company earn in Q4 to reach its goal? The CFO can enter the
projected earnings for each of the other three quarters along with a formula that totals all
four quarters. Then she runs a goal seek on the empty cell for Q4 sales, and receives her
answer.
Other uses of goal seek may be more complicated, but the method remains the same. Only
one argument can be altered in a single goal seek.
Goal Seek example
To calculate annual interest (I), create a table with the values for the capital (C), number
of years (n), and interest rate (r). The formula is I = C*n*r.
Let us assume that the interest rate r of 7.5% and the number of years n (1) will remain
constant. However, we want to know how much the investment capital C would have to
be modified in order to attain a particular return I. For this example, calculate how much
capital C would be required if we want an annual return of $15,000.
Enter each of the values mentioned above into adjacent cells (for Capital C, an arbitrary
value like $100,000 or it can be left blank; for number of years n, 1; for interest rate r,
7.5%). Enter the formula to calculate the interest I in another cell. Instead of C, n, and r ,
use the reference to the cell with the corresponding value. In our example, this would be
=B1*B2*B3.
1. Place the cursor in the formula cell (B4), and choose Tools > Goal Seek.
2. On the Goal Seek dialog, the correct cell is already entered in the Formula cell field.
3. Place the cursor in the Variable cell field. In the sheet, click in the cell that contains
the value to be changed, in this example it is B1.
4. Enter the desired result of the formula in the Target value field. In this example, the
value is 15000. The figure below shows the cells and fields.

Figure 2.7: Example setup for goal seek


5. Click OK. A dialog appears informing we that the Goal Seek was successful. Click
Yes to enter the result in the cell with the variable value. The result is shown below.

Figure2.8: Result of goal seek operation

Using the Solver


A Solver component modifies a set of input cells in a spreadsheet, observing the
impact on result and constraint formula cells. The goal is to find an optimal set of
input values, for which the result is minimized, maximized, or approximated to a
target value, while the constraints remain within specified limits.
Solver option under Tools menu amounts to a more elaborate form of Goal Seek. The
difference is that the Solver deals with equations with multiple unknown variables. It is
specifically designed to minimize or maximize the result according to a set of rules that
we define.
Each of these rules sets up whether an argument in the formula should be greater than,
lesser than, or equal to the value we enter. If we want the argument to remain unchanged,
we enter a rule that the cell that contains it should be equal to its current entry. For
arguments that we would like to change, we need to add two rules to define a range of
possible values: the limiting conditions. For example, we can set the constraint that one
of the variables or cells must not be bigger than another variable, or not bigger than a
given value. we can also define the constraint that one or more variables must be integers
(values without decimals), or binary values (where only 0 and 1 are allowed).
Once we have finished setting up the rules, we can adjust the argument and the results
by clicking the Solve button.
Solver example
Let's say we have $10,000 that we want to invest in two mutual funds for one year. Fund X
is a low risk fund with 8% interest rate and Fund Y is a higher risk fund with 12%
interest rate. How much money should be invested in each fund to earn a total interest of
$1000?
To find the answer using Solver:
1. Enter labels and data:
● Row labels: Fund X, Fund Y, and total, in cells A2 thru A4.
● Column labels: interest earned, amount invested, interest rate, and time period, in
cells B1 thru E1.
● Interest rates: 8 and 12, in cells D2 and D3.
● Time period: 1, in cells E2 and E3.
● Total amount invested: 10000, in cell C4.
2. Enter an arbitrary value (0 or leave blank) in cell C2 as amount invested in Fund X.
3. Enter the formulae given below:
● In cell C3, enter the formula C4-C2 (total amount - amount invested in Fund X)
as the amount invested in Fund Y.
● In cells B2 and B3, enter the formula for calculating the interest earned (see
below).
● In cell B4, enter the formula B2+B3 as the total interest earned.

Figure2.9: Example setup for solver

4. Choose Tools -> Solver. The solver dialog opens as shown in Figure 2.10.

Figure2.10: The Solver dialog


5. Click in the Target cell field. In the sheet, click in the cell that contains the target
value. In this example it is cell B4 containing total interest value.
6. Select Value of and enter 1000 in the field next to it. In this example, the target cell
value is 1000 because our target is a total interest earned of $1000. Select Maximum
or Minimum if the target cell value needs to be one of those extremes.
7. Click in the By changing cells field and click on cell C2 in the sheet. In this example,
we need to find the amount invested in Fund X (cell C2).
8. Enter limiting conditions for the variables by selecting the Cell reference, Operator
and Value fields. In this example, the amount invested in Fund X (cell C2) should not
be greater than the total amount available (cell C4) and should not be less than 0.
9. Click OK. A dialog appears informing we that the Solving successfully finished.
Click Keep Result to enter the result in the cell with the variable value. The result is
shown below.

Figure2.11: Result of Solver operation

ACTIVITY/ QUESTIONS:
1. A student is planning her goals about the marks she should attain in the forthcoming
Semester 4 examinations in order to achieve a distinction (75%). Assuming that
examination of each subject is for 100 marks, her marks of the previous semesters are
given as under.
Subject 1 Subject 2 Subjec3 Subject 4
Semester 1 82 67 53 87
Semester 2 88 78 76 69
Semester 3 89 85 91 67

Find out how many marks should she obtain in 4th semester to secure distinction.
2. A business owner wants to decide if he should try to increase the sales a product or
price of an existing product in order to increase the profit by 10%.
Current Sales 82
Cost per Unit 75
Profit per unit 12
The owner believes that he can either increase sales by 5 units without incurring
additional costs while the price can be increased by Rs 8 without affecting the sales.
3. The current profit situation of a business owner is as follows.
Current Sales 82
Cost per Unit 75
Profit per unit 12

Using the scenario manager, find the effect of in the new profit in case of the following
situations.
a. Sales = 70 and cost = 80
b. Sales = 90 and cost = 72
c. Sales = 85 and cost = 80
d. Sales = 65 and cost = 80

SESSION 2: LINK DATA AND SPREADSHEETS


USING MULTIPLE WORKBOOKS AND LINKING CELLS
Relevant Knowledge
Spreadsheet also allows we to link the cells from various worksheets and from various
other spreadsheets to summarize data from several sources. In this manner, we can create
formulas that span different sources and make calculations using a combination of local
and linked information. Multiple sheets help keep information organized
SETTING UP MULTIPLE SHEETS
Identifying sheets
When we open a new spreadsheet, by default, it has a sheet named Sheet1 which is
managed using tabs at the bottom of the spreadsheet, as shown below.

Figure 2.12 Identifying Sheets


Inserting new sheets
There are several ways to insert a new sheet. The first step, in all cases, is to select the
sheet that will be next to the new sheet. Then do any of the following:
• Select Insert > Sheet from the menu bar, or
• Right-click on the tab and select Insert Sheet, or
• Click in an empty space at the end of the line of sheet tabs.

Figure 2.13 Inserting New Sheets

Figure2.13 Creating a new sheet


Each method opens the Insert Sheet dialog. Here we can choose to put the new sheet
before or after the selected sheet and how many sheets to insert.

Figure2.14 Insert Sheet dialog


We need 6 sheets, one for each of the 5 accounts and one as a summary sheet so we will
add 3 more. We also want to name each of these sheets for the account they represent:
Summary, Checking Account, Savings Account, Credit Card 1, Credit Card 2, and Car
Loan.
We have two choices: insert 3 new sheets and rename all 6 sheets afterwards; or rename
the existing sheets, then insert the three new sheets 1 at a time, renaming each new sheet
during the insert step.
To insert sheets and rename afterwards:
1. In the Insert Sheet dialog, choose the position for the new sheets (in this example, we
use After current sheet).
2. Choose New sheet and 3 as the No. of sheets. (Three sheets are already provided by
default.) Because we are inserting more than one sheet, the Name box is not
available.
3. Click OK to insert the sheets.
4. For the next steps, go to “Renaming sheets” below.
To insert sheets and name them at the same time:
1. Rename the existing sheets Summary, Checking Account, and Savings Account, as
described in “Renaming sheets” below.
2. In the Insert Sheet dialog, choose the position for the first new sheet.
3. Choose New sheet and 1 as the No. of sheets. The Name box is now available.
4. In the Name box, type a name for this new sheet, for example Credit Card 1.
5. Click OK to insert the sheet.
6. Repeat steps 1–4 for each new sheet, giving them the names Credit Card 2 and Car
Loan.
On the Insert Sheet dialog, we can also add a sheet from a different spreadsheet file (for
example, another Calc or Excel spreadsheet), by choosing the From file option.
Click Browse and select the file; a list of the available sheets appears in the box. Select
the sheet to import. If, after we select the file, no sheets appear we probably selected an
invalid file type (not a spreadsheet, for example).
Note: For a shortcut to inserting a sheet from another file, choose Insert > Sheet from
file from the menu bar. The Insert Sheet dialog opens with the From file option
preselected, and then the Insert dialog opens on top of it.
Inserting sheets from a different spreadsheet
If we prefer, select the Link option to insert the external sheet as a link instead as a copy.
This is one of several ways to include “live” data from another spreadsheet. The links can
be updated manually to show the current contents of the external file; or, depending on
the options we have selected in Tools > Options > OpenOffice.org Calc > General >
Updating, whenever the file is opened.
Renaming Worksheets
At the bottom of each worksheet window is a small tab that indicates the name of the
worksheets in the workbook. These names (Sheet1, Sheet2, Sheet3, and so on) are not
very descriptive; we might want to rename our worksheets to reflect what they contain.
For instance, if our workbook contains Students Marks in individual Subject then we
may want to rename the worksheets as Subject names such as English, Mathematics and
Social Science etc.
There are three ways we can rename a worksheet, and the only difference between them
is the way in which we start the renaming process. we can do any of the following:
• Double-click on one of the existing worksheet names.
• Right-click on an existing worksheet name, then choose Rename from the resulting
Context menu.
• Select the worksheet we want to rename (click on the worksheet tab) and then select
the Sheet option from the Format menu. This displays a submenu from which we
should select the Rename option.

Create Or Change A Cell Reference


A cell reference refers to a cell or a range of cells on a worksheet and can be used to find
the values or data that we want formula to calculate.

In one or several formulas, we can use a cell reference to refer to:


• Data from one or more contiguous cells on the worksheet.
• Data contained in different areas of a worksheet.
• Data on other worksheets in the same workbook.
Referencing Other Sheets
There are two ways to reference cells in other sheets: by entering the formula directly
using the keyboard or by using the mouse. We will look at the mouse method first.
Creating The Reference With The Mouse
Look at the example below in Figure 2.14 which shows an account summary sheet with
a blank Balance column. On the Summary sheet, set up a place for all five account
balances, so we know where to put the cell reference. We want to place the reference for
the checking account balance in cell B3.
Figure 2.14 Blank summa
To make the cell reference in cell B3, select the cell and follow these steps.
1. Click on the = icon next to the formula bar. The icons change and an equals sign
appears in the formula bars shown below.

Figure 2.15 Equal sign in formula bar

2. Now, click on the sheet tab for the sheet containing the cell to be referenced. In this
case, that is the Checking Account sheet as shown below.

Figure 2.16 the checking account tab

3. Click on cell F3 (where the balance is) in the Checking Account sheet. The phrase
‘Checking Account’.F3 should appear in the formula bar as shown below.

4. Click the green checkmark in the formula bar to finish.


5. The Summary sheet should now look like the figure bel

Creating The Reference With The Keyboard


From the figure above, we can deduce how the cell reference is constructed. The
reference has two parts: the sheet name (’Checking Account’) and the cell reference (F3).
Notice that they are separated by a period.
Note: The sheet will be in single quotes because it contains a space, and the mandatory
period (.) always falls outside any quotes.
So, we can fill in the Savings Account cell reference by just typing it in. Assuming that
the balance is in the same cell in the Savings Account sheet, F3, the cell reference should
be =’Savings Account’.F3.

Figure2.19 Savings account reference


Referencing Other Worksheets
Calc can link different files together. The process is the same as described for different
sheets in a single spreadsheet, but we add one more parameter to indicate which file the
sheet is in.
Creating The Reference With The Mouse
To create the reference with the mouse, both spreadsheets need to be open. Select the cell
in which the formula is going to be entered.
1. Click the = icon next to the formula bar.
2. Switch to the other spreadsheet (the process to do this will vary depending on which
operating system we are using).
3. Select the sheet (Savings account) and then the reference cell (F3).

Figure 2.20 Selecting the savings account reference cell

4. Switch back to the original spreadsheet.


5. Click on the green check mark on the formula bar.
Your spreadsheet should now resemble the figure below.

Figure 2.21 Linked files


We will get a good feel for the format of the reference if we look closely at the formula
bar. Based on this line we can create the reference using the keyboard.
Creating The Reference With The Keyboard
Typing the reference is simple once we know the format the reference takes. The
reference has three parts to it:
• Path and file name
• Sheet name
• Cell
Looking at the figure above, we can see the general format for the reference is
=’file:///Path &File Name’#$SheetName.CellName.
Working with Hyperlinks
Hyperlinks can be used in Calc to jump to a different location from within a spreadsheet
and can lead to other parts of the current file, to different files or even to web sites.
Relative And Absolute Hyperlinks
Hyperlinks can be stored within our file as either relative or absolute.
An absolute link will stop working only if the target is moved. A relative link will stop
working only if the start and target locations change relative to each other. For instance,
if we have two spreadsheets in the same folder linked to each other and we move the
entire folder to a new location, a relative hyperlink will not break.
To change the way that OOo saves the hyperlinks in our file, select Tools > Options >
Load/Save > General and choose if we want URLs saved relatively when referencing
the File System, or the Internet, or both.
We can insert and modify links using the Hyperlink dialog. To display the dialog, click
the Hyperlink icon on the Standard toolbar or choose Insert > Hyperlink from the
menu bar. To turn existing text into a link, highlight it before opening the Hyperlink
dialog.

On the left hand side, select one of the four types of hyperlinks:

• Internet: the hyperlink points to a web address, normally starting with http://
• Mail & News: the hyperlink opens an email message that is pre-addressed to a particular
recipient.
• Document: the hyperlink points to a place in either the current worksheet or another
existing worksheet.
• New document: the hyperlink creates a new worksheet.
The top right part of the dialog changes according to the choice made for the hyperlink
category from the left panel. A full description of all the choices, and their interactions,
is beyond the scope of this chapter. Here is a summary of the most common choices used
in presentations.
For an Internet hyperlink, choose the type of hyperlink (choose between Web, FTP or
Telnet), and enter the required web address (URL).
For a Mail and News hyperlink, specify whether it is a mail or news link, the receiver
address and for email, also the subject.
For a Document hyperlink, specify the worksheet path (the Open File button opens a file
browser); leave this blank if we want to link to a target in the same spreadsheet.
Optionally specify the target in the worksheet (for example a specific sheet). Click on
the Target icon to open the Navigator where we can select the target, or if we know the
name of the target, we can type it into the box.
For a New Document type hyperlink, specify whether to edit the newly created worksheet
immediately (Edit now) or just create it (Edit later) and enter the file name and the type
of worksheet to create (text, spreadsheet, etc.). The Select path button opens a directory
picker dialog.
The Further settings section in the bottom right part of the dialog is common to all the
hyperlink types, although some choices are more relevant to some types of links.

• Set the value of Frame to determine how the hyperlink will open. This applies to
worksheets that open in a Web browser.
• Form specifies if the link is to be presented as text or as a button. The figure below shows
a link formatted as a button.

• Text specifies the text that will be visible to the user. If we do not enter anything here,
Calc will use the full URL or path as the link text. Note that if the link is relative and we
move the file, this text will not change, though the target will.
• Name is applicable to HTML documents. It specifies text that will be added as a NAME
attribute in the HTML code behind the hyperlink.
Linking To External Data

We can insert tables from HTML documents, and data located within named ranges from
an OpenOffice.org Calc or Microsoft Excel spreadsheet, into a Calc spreadsheet

We can do this in two ways: using the External Data dialog or using the Navigator.

Using the External Data dialog

1. Open the Calc worksheet where the external data is to be inserted. This is the target
worksheet.
2. Select the cell where the upper left-hand cell of the external data is to be inserted.
3. Choose Insert -> Link to External Data.
4. On the External Data dialog, type the URL of the source worksheet or click the [...] button
to open a file selection dialog. Press Enter to get Calc to load the list of available tables.
5. In the Available tables/range list, select the named ranges or tables we want to insert.
we can also specify that the ranges or tables are updated every (number of) seconds.
6. Click OK to close this dialog and insert the linked data.

Figure 2.24 Selecting a table or range in a source document from the Web
Linking To Registered Data Sources
We can access a variety of databases and other data sources and link them into Calc
worksheets. First we need to register the data source with OpenOffice.org. (To register
means to tell OOo what type of data source it is and where the file is located.) The way
to do this depends on whether or not the data source is a database in *.odb format.
To register a data source that is in *.odb format:

1. Choose Tools -> Options -> OpenOffice.org Base -> Databases.


2. Click the New button (below the list of registered databases) to open the Create
Database Link dialog.

Figure 2.25 Registering databases

3. Enter the location of the database file, or click Browse to open a file browser and
select the database file.
4. Type a name to use as the registered name for the database and click OK. The database
is added to the list of registered databases. The OK button is enabled only when both
fields are filled in.
SESSION 3: SHARING WORKSHEET DATA

Relevant Knowledge

In most office settings, there is a shared drive where teams can store common files for
everyone to use. This usually leads to sighting of the message: “The document [file name]
is locked for editing by another user. To open a read-only copy of this document, click“!!
This message appears because someone else already has the file open.
Sometimes however, it is necessary to have multiple people working on a file at the same
time. This can be to either speed up data entry or simply make things easier for
collaboration purposes.
Spreadsheet software allows the user to share the workbook and place it in the network
location where several users can access it simultaneously.
In this exercise, we will learn how to share a worksheet in OpenOffice Calc.
Setting Up A Spreadsheet For Sharing
At any time, we can set up a spreadsheet for sharing with others. With the spreadsheet
document open, choose Tools > Share Document to activate the collaboration features for
this worksheet. A dialog opens where we can choose to enable or disable sharing.
To enable sharing, select the box at the top of the dialog, and then click OK. A message
appears stating that we must save the worksheet to activate shared mode. Click Yes to
continue. The word (shared) is then shown on the title bar after the worksheet's title.
The Tools > Share Document command can be used to switch the mode for a
worksheet from unshared to shared. However, if we want to use a shared worksheet
in unshared mode, we need to save the shared worksheet using another name or path.
This creates a copy of the spreadsheet that is not shared.
Opening A Shared Spreadsheet
When we open a spreadsheet that is in shared mode, we see a message that the worksheet is
in shared mode and that some features are not available in this mode. we can choose to
disable this message for the future. After clicking OK, the worksheet is opened in
shared mode.
The following features are known to be disabled in a shared spreadsheet:
● Edit > Changes, except for Merge Document
● Edit > Compare Document
● Edit > Sheet > Move/Copy & Delete
● Insert > Cells Shift Cells Down & Shift Cells Right
● Insert > Sheet from file
● Insert > Names
● Insert > Comment
● Insert > Picture > From File
● Insert > Movie and Sound
● Insert > Object
● Insert > Chart
● Insert > Floating Frame
● Format > Sheet > Rename, Tab Color
● Format > Merge Cells > Merge and Center, Merge Cells, Split Cells
● Format > Print Ranges
● Tools > Protect Document
● Data > Define Range
● Data > Sort
● Data > Subtotals
● Data > Validity
● Data > Multiple Operations
● Data > Consolidate
● Data > Group and Outline (all)
● Data >DataPilot

Saving A Shared Spreadsheet


When we save a shared spreadsheet, one of several situations may occur:
● If the worksheet was not modified and saved by another user since we opened it, the
worksheet is saved.
● If the worksheet was modified and saved by another user since we opened it, one of
the following events will occur:
● If the changes do not conflict, the worksheet is saved, the dialog below appears, and
any cells modified by the other user are shown with a red border.

Figure 2.27 Update message after saving

● If the changes conflict, the Resolve Conflicts dialog is shown. we must decide for
each conflict which version to keep, yours or the other person’s. When all conflicts
are resolved, the worksheet is saved. While we are resolving the conflicts, no other
user can save the shared worksheet.
Figure 2.28 Resolve Conflicts dialog
● If another user is trying to save the shared worksheet and resolve conflicts, we see a
message that the shared spreadsheet file is locked due to a merge-in in progress. we can
choose to cancel the Save command for now, or retry saving later.
When we successfully save a shared spreadsheet, the worksheet shows the latest version
of all changes that got saved by all users.
Note: Most spreadsheets software automatically turns off some features in shared
workbooks. This is to simplify the workbook since multiple people can be working on the
file at the same time. For example, shared workbooks don‘t allow merging cells,
conditional formatting, or inserting pictures/graphs/etc.

Perform the following activity till we are confident:


S.No. Activity
1. Share worksheet data with other users.

Record Changes
Calc has the feature to track what data was changed, when the change was made, who
made the change and in which cell the change has occurred.
If we are the sponsor of a youth baseball team. The coach has submitted a budget to we
for the season and we need to edit the costs and return it to her. we are concerned that if
we just make the changes, then the coach won't see the changes we made. we decide to
use Calc with the record changes feature turned on, so that the coach can easily see the
changes we have made.
The figure below shows the budget spreadsheet our coach submitted.

Figure 2.29 Baseball budget spreadsheet


Looking Over The Values,
We see a few places where money could be saved:
● Post-game snacks can be bought by parents.
● New uniforms can wait; only buy 10 to replace damaged ones.
● Buy cheaper baseballs.
● Only buy 2 spare gloves.
To make these changes, use the record changes feature in Calc. To start recording
changes:
1. Open the Budget Spreadsheet.
2. Select Edit > Changes > Record from the menu bar.
3. Begin editing the worksheet.
A colored border, with a dot in the upper left-hand corner, appears around a cell
where changes were made. Other reviewers then quickly know which cells were
edited. A deleted column or row is marked by a heavy colored bar.

Figure 2.30 Edited worksheet with red border on changed cells


Some changes, for example cell formatting, are not recorded and marked.
To change the color that indicates changes, select Tools > Options > OpenOffice.org
Calc > Changes.
Viewing Changes
Calc gives we tremendous control over what changes we see when reviewing a
worksheet. To change the available filters, select Edit > Changes > Show. The following
dialog opens.

Figure 2.31 Show changes dialog


Using the different settings, we can control which changes appear on screen. we can
filter based on:
● Date – Only changes made in a certain time range are displayed.
● Author – Only changes made by a specific author are displayed. This is especially useful
if we have multiple reviewers on the worksheet.
● Range – Only changes made in a specific range of cells are displayed. This is especially
useful if we have a large spreadsheet and only want to review a part of it.
● Comment – Searches the content of the comments and only displays changes which have
comments that match the search criteria.
● Show accepted changes – Only changes we accepted are displayed.
● Show rejected changes – Only changes we rejected are displayed.
We can also access the filter control in the Accept or Reject Changes dialog shown
below. Click the Filter tab to get a set of options similar to those shown in the figure
above.
Adding Comments to Changes
Calc automatically adds to any recorded change a comment describing what was changed
(for example, Cell B4 changed from ‘9’ to ‘4’). Reviewers and authors can add their
comments to explain their changes.
To add a comment to a change:
1. Make the change to the spreadsheet.
2. Select the cell with the change.
3. Choose Edit > Changes > Comments. The dialog shown below appears. The
automatically-added comment provided by Calc appears in the title bar of this dialog and
cannot be edited.
4. Type our own comment and click OK.

Figure 2.32 Comment dialog


After we have added a comment to a changed cell, we can see it by hovering the mouse
pointer over the cell.

Figure 2.33 Comment added to cell B3


The comment also appears in the dialog when we are accepting and rejecting changes.
Editing change comments
1. Select the cell with the comment that we want to edit.
2. Select Edit > Changes > Comments.
3. Edit the comment and click OK.
Accepting or Rejecting Changes
When we receive a worksheet back with changes, the beauty of the recording changes
system becomes evident. Now, as the original author, we can step through each change
and decide how to proceed. To begin this process:
1. Open the edited worksheet.
2. Select Edit > Changes > Accept or Reject. The dialog shown below opens.
3. Calc steps through the changes one at a time. we can choose to accept or reject each
change as we go through.

Figure 2.34 Accept or Reject Changes dialog

The Comment column by default contains an explanation of the change that was made. If
the reviewer added a comment to the change, it is displayed, followed by the description
of the change.
If more than one person has reviewed the worksheet, one reviewer may have modified
another reviewer’s change. If so, the changes are hierarchically arranged with a plus sign
for opening up the hierarchy.
On the Filter tab of this dialog (not shown here), we can choose how to filter the list of
changes: by date, author, cell range, or comments containing specific terms. After
selecting the filter criteria, switch back to the List tab to see the results.
Merging Worksheets
Sometimes, multiple reviewers return edited versions of a worksheet at the same time. In
this case, it may be quicker to review all of these changes at once, rather than one review
at a time. For this purpose, Calc provides the feature of merging worksheets.
To merge worksheets, all of the edited worksheets need to have recorded changes in them.
1. Open the original worksheet.
2. Select Edit > Changes > Merge Document.
3. A file selection dialog opens. Select a file we want to merge and click OK.
4. After the worksheets merge, the Accept or Reject Changes dialog opens as shown below,
showing changes by more than one reviewer. If we want to merge more worksheets,
close the dialog and then repeat steps 2 and 3.

Figure 2.35 Accept or reject for merged worksheets

Now all of the changes are combined into one worksheet and we can accept or reject the
changes. Changes from different authors appear in different colors in the worksheet. In this
example, all of the changes from Robert are blue and the changes from Mia are red.

Figure 2.36 Merged worksheets with different author colors


Comparing Documents
When sharing worksheets reviewers may forget to record the changes they make. This is
not a problem with Calc because Calc can find the changes by comparing worksheets.
In order to compare worksheets we need to have the original worksheet and the one that
is edited. To compare them:
1. Open the edited worksheet that we want to compare with the original worksheet.
2. Select Edit > Compare Document.
3. An open worksheet dialog appears. Select the original worksheet and click Insert.
Calc finds and marks the changes as follows:
● All data that occurs in the edited worksheet but not in the original is identified as
inserted.
● All data that is in o u r original worksheet but is not in the edited worksheet is
identified as deleted.
● All data that is changed, is marked as changed.
SESSION 4: CREATE AND USE MACROS IN SPREADSHEET
Relevant Knowledge
A macro is a saved sequence of commands or keystrokes that are stored for later use. An
example of a simple macro is one that “types” our address. The OpenOffice.org (OOo)
macro language is very flexible, allowing automation of both simple and complex tasks.
Macros are especially useful to repeat a task the same way over and over again.
Using the macro recorder
This session provides a basis for understanding the general macro capabilities in
OpenOffice.org using the macro recorder. The following steps create a macro that
performs paste special with multiply.
1. Open a new spreadsheet.
2. Enter numbers into a sheet.

Figure 2.37 Enter numbers.


3. Select cell A3, which contains the number 3, and copy the value to the clipboard.
4. Select the range A1:C3.
5. Use Tools > Macros > Record Macro to start the macro recorder. The Record Macro
dialog is displayed with a stop recording button.

Figure 2.38 Stop recording button.


6. Use Edit > Paste Special to open the Paste Special dialog.

Figure 2.39 Paste Special dialog.

7. Set the operation to Multiply and click OK. The cells are now multiplied by 3.

Figure2.40 Cells multiplied by 3.


8. Click Stop Recording to stop the macro recorder. The OpenOffice.org Basic Macros
dialog opens.
9. Select the current worksheet. For this example, the current Calc worksheet is Untitled 1.
Existing worksheets show a library named Standard. This library is not created until the
worksheet is saved, or the library is needed, so at this point our new worksheet does not
contain a library. we can create a new library to contain the macro, but this is not
necessary.
Figure 2.41 Select the Standard library if it exists.
10. Click New Module. If no libraries exist, then the Standard library is automatically created
and used. In the New Module dialog, type a name for the new module or leave the name
as Module1.

Figure 2.42 New Module Dialog Box

11. Click OK to create a module named Module1. Select the newly created Module1, enter
the macro name PasteMultiply and click Save.

Figure 2.43 Select the module and name the macro.

12. The created macro is saved in Module1 of the Standard library in the Untitled 1 worksheet.
OR
1. Input data
2. Before performing any operation, go to Tools > Macros > Record Macro.
3. Now repeat the motion you just did.
4. Select "Stop Recording" from the drop-down menu. Now save the macro by giving it a
name.

Using A Macro As A Function


Using the newly created Calc worksheet CalcTestMacros.ods, enter the formula
=NumberFive() (see Figure 2.44). Calc finds the macro and calls it.
Figure 2.44 Use the NumberFive() Macro as a Calc function
Note: Function names are not case sensitive. we can enter =NumberFive() and
Calc clearly shows =NUMBERFIVE()
Save the Calc document, close it, and open it again. Depending on our settings in Tools
> Options > OpenOffice.org > Security > Macro Security, Calc will display one of
the warnings shown below. we will need to click Enable Macros, or Calc will not allow
any macros to be run inside the document.

OOo warns we that a document contains macros.

Warning if macros are disabled


If we choose to disable macros, then when the document loads, Calc can no longer find
the function.

Figure 2.45 The function is gone.


When a document is created and saved, it automatically contains a library named
Standard. The Standard library is automatically loaded when the document is
opened. No other library is automatically loaded.
Calc does not contain a function named NumberFive(), so it checks all opened and visible
macro libraries for the function. Libraries in OpenOffice.org Macros, My Macros, and the
Calc document are checked for an appropriately named function. The NumberFive()
function is stored in the AuthorsCalcMacros library, which is not automatically loaded
when the document is opened.
Use Tools > Macros > Organize Macros > OpenOffice.org Basic to open the
OpenOffice.org Basic Macros dialog shown further down the page. Expand
CalcTestMacros and find AuthorsCalcMacros. The icon for a loaded library is a different
color from the icon for a library that is not loaded.
Click the expansion symbol (usually a plus or a triangle) next to AuthorsCalcMacros to
load the library. The icon changes color to indicate that the library is now loaded.
Click Close to close the dialog.
Unfortunately, the cells containing =NumberFive() are in error. Calc does not recalculate
cells in error unless we edit them or somehow change them. The usual solution is to store
macros used as functions in the Standard library. If the macro is large or if there are many
macros, a stub with the desired name is stored in the Standard library. The stub macro
loads the library containing the implementation and then calls the implementation.

1. Use Tools > Macros > Organize Macros > OpenOffice.org Basic to open the
OpenOffice.org Basic Macros dialog. Select the NumberFive macro and click Edit to
open the macro for editing.
2. Change the name of NumberFive to NumberFive_Implementation (see Listing 3).
Listing 3. Change the name of NumberFive to NumberFive_Implementation

Function NumberFive_Implementation()
NumberFive_Implementation() = 5
End Function

3. In the Basic IDE, hover the mouse cursor over the toolbar buttons to display the tool tips.
Click the Select Macro button to open the OpenOffice.org Basic Macros dialog.
4. Select the Standard library in the CalcTestMacros document and click New to create a
new module. Enter a meaningful name such as CalcFunctions and click OK. OOo
automatically creates a macro named Main and opens the module for editing.
5. Create a macro in the Standard library that calls the implementation function (see Listing
4). The new macro loads the AuthorsCalcMacros library if it is not already loaded, and
then calls the implementation function.
Listing 4. Change the name of NumberFive to NumberFive_Implementation.

Function NumberFive()
If NOT BasicLibraries.isLibraryLoaded("AuthorsCalcMacros") Then
BasicLibraries.LoadLibrary("AuthorsCalcMacros")
End If
NumberFive = NumberFive_Implementation()
End Function
Save, close, and reopen the Calc document. This time, the NumberFive() function works.

Passing Arguments to Macros


To illustrate a function that accepts arguments, we will write a macro that calculates the
sum of its arguments that are positive—it will ignore arguments that are less than zero
(see Listing 5).
Listing 5. PositiveSum calculates the sum of the positive arguments.
The macro in Listing 5 demonstrates a couple of important techniques.

1. The argument x is optional. If the argument is not optional and it is called without an
argument, OOo prints a warning message every time the macro is called. If Calc calls the
function many times, then the error is displayed many times.
2. IsMissing checks that an argument was passed before the argument is used.
3. IsArray checks to see if the argument is a single value, or an array. For example,
=PositiveSum(7) or =PositiveSum(A4). In the first case, the number 7 is passed as an
argument, and in the second case, the value of cell A4 is passed to the function.
4. If a range is passed to the function, it is passed as a two-dimensional array of values; for
example, =PositiveSum(A2:B5). LBound and UBound are used to determine the array
bounds that are used. Although the lower bound is one, it is considered safer to use
LBound in case it changes in the future.
Note: The macro in Listing 5 is careful and checks to see if the argument is an array or a
single argument. The macro does not verify that each value is numeric. we may be
as careful as we desire. The more things we check, the more robust the macro
is, and the slower it runs.

Passing one argument is as easy as passing two: add another argument to the function
definition (see Listing 6). When calling a function with two arguments, separate the
arguments with a semicolon; for example, =TestMax(3; -4).
Listing 6. TestMax accepts two arguments and returns the larger of the two.

Passing Arguments as Values


Arguments passed to a macro from Calc are always values. It is not possible to know what
cells, if any, are used. For example, =PositiveSum(A3) passes the value of cell A3, and
PositiveSum has no way of knowing that cell A3 was used. If we must know which cells
are referenced rather than the values in the cells, pass the range as a string, parse the
string, and obtain the values in the referenced cells.
Writing Macros that act like built-in Functions
Although Calc finds and calls macros as normal functions, they do not really behave as
built-in functions. For example, macros do not appear in the function lists. It is possible
to write functions that behave as regular functions by writing an Add-In.
Accessing Cells Directly
We can access the OOo internal objects directly to manipulate a Calc document. For
example, the macro in Listing 7 adds the values in cell A2 from every sheet in the current
document. ThisComponent is set by StarBasic when the macro starts to reference the
current document. A Calc document contains sheets: ThisComponent.getSheets(). Use
getCellByPosition(col, row) to return a cell at a specific row and column.

Listing 7. Add cell A2 in every sheet.


Sorting
Sorting data can be automated in Open Office by creating a Macro in Calc. Data can be
sorted on a single column or more than one column. Each time the Macro runs the data
gets sorted. Such macros can be written using code in Open Office.
Consider sorting the data in the figure below. First, sort on column B descending and then
column A ascending.

.
Figure 2.47 Sort column B descending and column A ascending.
The example in Listing 9, however, demonstrates how to sort on two columns.
Listing 9. Sort cells A1:C5 on Sheet 1.

Sub SortRange
Dim oSheet ' Calc sheet containing data to sort.
Dim oCellRange ' Data range to sort.

REM An array of sort fields determines the columns that are


REM sorted. This is an array with two elements, 0 and 1.
REM To sort on only one column, use:
REM Dim oSortFields(0) As New com.sun.star.util.SortField
Dim oSortFields(1) As New com.sun.star.util.SortField

REM The sort descriptor is an array of properties.


REM The primary property contains the sort fields.
Dim oSortDesc(0) As New com.sun.star.beans.PropertyValue

REM Get the sheet named "Sheet1"


oSheet = ThisComponent.Sheets.getByName("Sheet1")

REM Get the cell range to sort


oCellRange = oSheet.getCellRangeByName("A1:C5")

REM Select the range to sort.


REM The only purpose would be to emphasize the sorted data.
'ThisComponent.getCurrentController.select(oCellRange)

REM The columns are numbered starting with 0, so


REM column A is 0, column B is 1, etc.
REM Sort column B (column 1) descending.
oSortFields(0).Field = 1
oSortFields(0).SortAscending = FALSE

REM If column B has two cells with the same value,


REM then use column A ascending to decide the order.
oSortFields(1).Field = 0
oSortFields(1).SortAscending = True
REM Setup the sort descriptor.
oSortDesc(0).Name = "SortFields"
oSortDesc(0).Value = oSortFields()

REM Sort the range.


oCellRange.Sort(oSortDesc())
End Sub

You might also like