10
Using ChemBasic with Data Forms Manager and ChemSketch Version 5.0 for Windows Application Note Create customized reports or submission forms

Using ChemBasic with Data Forms Manager and ChemSketchUsing ChemBasic with Data Forms Manager and ChemSketch: Create customized reports or submission forms Robin Martin, Ph.D. Advanced

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Using ChemBasic with Data Forms Manager and

ChemSketch Version 5.0 for Windows

Application Note

Create customized reports or submission forms

ACD/ChemBasic Application Notes 2

Advanced Chemistry Development Inc.

Copyright © 2002 Advanced Chemistry Development Inc. All rights reserved.

ACD/Labs is a trademark of Advanced Chemistry Development Inc.

Microsoft is a registered trademark and Windows is a trademark of Microsoft Corporation.

IBM is a registered trademark of International Business Machines Corporation.

PDF, Acrobat, Portable Document Formats, and associated data structures and operators are Copyright (C) Adobe Corporation.

All the other trademarks mentioned within this Manual are the property of their respective owners.

All trademarks are acknowledged.

Information in this document is subject to change without notice and is provided "as is" with no warranty. Advanced Chemistry Development Inc. makes no warranty of any kind with regard to this material, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. Advanced Chemistry Development Inc. shall not be liable for errors contained herein or for any direct, indirect, special, incidental or consequential damages in connection with the use of this material.

ACD/ChemBasic Application Notes 3

Using ChemBasic with Data Forms Manager and ChemSketch:

Create customized reports or submission forms

Robin Martin, Ph.D.

Advanced Chemistry Development Inc., 90 Adelaide Street West, Suite 600, Toronto, Ontario, Canada M5H 3V9

Introduction

Wouldn’t it be nice to have lab reports handed in on a report form containing all the necessary user identification and reaction conditions every time? Or how about submission forms for Mass Spectrometry analysis filled in with the complete sample details (including the structure) and the analysis type the MS technician requires for running the sample efficiently?

ACD offers easy-to-use tools that offer solutions for the situations described above. The interactive relationship between ACD/ChemSketch, ACD/ChemBasic and ACD/DataForms Manager makes it possible to create a report template, fill in a form with the necessary information, and then populate the report with the data. And best of all, these tools are available for free to download from our website (http://www.acdlabs.com).

Building the ChemSketch Template file

The first step is to build the layout of your report/form template. ACD/ChemSketch provides all the necessary tools for drawing structures, objects (rectangles, lines, ellipses, etc.), and text editing. When the foundation is complete, it is essential to include special text placeholders for the incoming Form data. An example of a submission form template for Mass Spectrometry Analysis Request is shown in Figure 1.

The text in “bold” are the data labels for the submission form. The text surrounded with “< >” are the placeholders for the information that the user is going to be filling out on the data Form.

ACD/ChemBasic Application Notes 4

Figure 1. ChemSketch Template file for the Mass Spectrometry Analyst Request submission form.

ACD/ChemBasic Application Notes 5

Building the user data input Form

Now that a ChemSketch template file has been designed and constructed, a Data Form needs to be prepared for entering the information. The ACD/Data Forms Manager has been an integral part of ACD/SpecManager for databasing additional user information about the compound along with its related spectra in the ACD/Spec DB module. It is now available directly from within ChemSketch.

The Form editor is used to design and layout the appearance of the Form. It is here where the data field names, types and initial values are set. Figure 2. shows the Edit Form dialog box that is used to build the Form and enter the required data fields.

Figure 2. Edit Form dialog box showing the data fields and their arrangement.

ACD/ChemBasic Application Notes 6

Double-clicking on any of the data fields will bring up the Form Item Properties box (Figure 3.).

Figure 3. Form Item Properties Dialog box.

There are a number of options that can be set. The data type can be set as CheckBoxes, Radio Buttons, List Box, Edit Box, etc. The available options will change according to the “Edit Type” selected. If the data from this particular field must be present on the submission form, then the “Cannot Be Empty” option should be set appropriately. A “Default Value” can be set and this value will be filled onto the Form automatically. The user can then change the value if necessary before submitting the Form.

Once the components of the Form are set, the Form can be tested to see how it will look and behave when used to fill in the template. Figure 4. shows the completed Form.

ACD/ChemBasic Application Notes 7

Figure 4. The completed Form filled with the required data.

Placing the Form data onto the Template

Now that the ChemSketch template file and the Data Form have been prepared, all that remains is to create a ChemBasic program to link the two together.

ChemBasic is a simple, convenient and functionally rich programming language for the presentation and manipulation of molecular structure, related objects and all the content of ACD/Labs’ current and future programs. To be a universal application that extends the capability of the existing program set, ChemBasic is designed as an object-oriented language. This means that all the chemistry-related things are described as objects – that is, specific data structures that correspond to molecules, conformations, etc. There exist a number of predefined methods to

ACD/ChemBasic Application Notes 8

manipulate these objects. The hierarchy of the objects and methods is at the very essence of ChemBasic.

A sample of the ChemBasic program used with the template and Form used in this document is shown in Figure 5.

Figure 5. A portion of the ChemBasic program used to create the MS submission form.

ChemBasic contains the necessary commands and methods to read the information off the Form. It is then a matter of text string manipulation and resetting the ChemSketch textboxes contents to place the data onto a copy of the Template page. The final submission form with all the data filled in is shown in Figure 6. This form could then be printed and handed in with the sample for analysis, or sent through email to the technician.

ACD/ChemBasic Application Notes 9

Figure 6. The completed Mass Spectrometry Analysis Request form.

ACD/ChemBasic Application Notes 10

Numerous possible applications

It has been shown how the three software applications (ACD/ChemSketch, ACD/Data Forms Manager and ACD/ChemBasic) can come together to create a report/submission form. This example provides a starting point that can be built upon for creating a wide variety of templates.

An educator could design templates that the students could use for handing in assignments, lab reports, quizzes, etc.

Analysis submission forms for NMR, UV-IR, HPLC, GC could be designed in a similar fashion to that shown for MS.

One is only limited by their imagination.