A machining report is an effective way to increase efficiency and reduce errors on the shop floor with little cost involved. The ESPRIT Report Generator automatically generates reports that include an easy-to-read list of all tools and operations in an ESPRIT document. Both standard and detailed reports are available that provide the machining details an operator needs to correctly set up a machine and perform the required machining operations. For manufacturing environments that need more complex, detailed, or differently formatted reports, ESPRIT offers tools you can use to create your own custom reports.
You Will Learn How the Report Generator works The basics of HTML How to customize the HTML formatting in the report How to add a company logo How to customize the data in the report How to add programming functionality with JavaScript
dptechnology.com
The Report Generator Outputs reports in HTML or PDF Outputs detailed and summary reports Generates reports from standard template files Lets you create customized template files
The ESPRIT Report Generator outputs HTML and PDF reports of machining operations and tool data in an ESPRIT document. The Report Generator includes 5 standard, preformatted reports: EDM: Outputs the operation list of all wire EDM operations Milling_Detailed and Turning_Detailed: Outputs the operation list, tool list, and details on individual operations and tools Milling_Summary and Turning_Summary: Outputs the operation list only
Summary report
Detailed reports
dptechnology.com
Set your options and preferred folder locations before generating a report.
Output PDF files Set the numerical formatting Generate the database schema file (described on the next page)
Change the folder location for generated reports Change the folder location for custom report templates Define the program or Web browser you will use to view the HTML files Define the program you will use as your XML editor Define the program you will use as your PDF viewer
dptechnology.com
dptechnology.com
HTML element s
HTML documents are made up of HTML elements, which consist of tags enclosed in angle brackets within the Web page content. HTML elements form the building blocks of all websites. HTML tags normally come in pairs like <p> and </p> to denote a paragraph of text. The first tag in a pair is the start tag, the second tag is the end tag (they are also called opening and closing tags). For example, a title element is defined by a pair of title tags: <title>This is the title</title> The title tags control the text displayed at the top of the Web browser or the browser tab title. All HTML documents have the key elements shown below: <html> <head> <title>Machining Report</title> </head> <body> </body> </html>
The text between the <html> tags describes the Web page. Content between the header tags is not displayed on the Web page, except for the title element. Everything between the <body> tags describes the visible content on the page (text, images, tables,...).
HTML at t ributes
Attributes define details about an element. Most elements have attributes that can be defined. Most attributes are name-value pairs, separated by = and written within the start tag of an element after the elements name. For example, the appearance of a paragraph element can be defined by a style attribute. <p style=color:red>Text of paragraph.</p> The class attribute provides a way of classifying similar elements. For example, to classify types of text. <p class=Title>Machining report</p>
S t y les
Instead of individually defining the style attributes for each element, style elements can be defined for the entire HTML document in the header. The type attribute must always be set to text/css (css stands for Cascading Style Sheet). <head> <style type=text/css> ****Style settings for paragraph elements, title elements, table elements, image elements, etc. go here**** </style> dptechnology.com 5
Ta bles
The default ESPRIT report templates use Table elements to keep the data organized. Instead of rows and columns, HTML tables are made up of rows and cells. Each row can contain any number of cells. The elements used in HTML tables are: The table <table> element Table row <tr> elements Table cell <td> elements The example shown below produces a simple table with one row that contains three cells: <table border=1> <tr> <td>First Cell</td> <td>Second Cell</td> <td>Third Cell</td> </tr> </table>
Images
Images are displayed with the <img> tag that contains a reference to the source of the image file. If the image is stored in the same folder as the HTML template, you only need to specify the name of the image file. Otherwise, the reference must also include the folder location. The IMG tag has no closing tag. <img src=company_logo.gif />
dptechnology.com
Pa st e t he t emplat es to t he user docum ent fold er In your user folder, navigate to the folder username\Documents\DP Technology\ESPRIT\Data\ReportGenerator. Right-click on the folder and select Paste.
dptechnology.com
Rena m e t he individual t emplat e fold er s There is no restriction on the name of the report folder. However, the name of the summary template must always be OpSummary.htm and the detailed template must be OpDetailed.htm. A report will not generate if you use any other names. Rename the folders in your user folder by adding -Custom to the name.
V iew t he new t emplat es in t he Repor t G enerator dialog In ESPRIT, click Create Reports on the File menu. Notice that the custom reports are added to the list.
dptechnology.com
Up d at e t he custom repor t t emplat e In the folder EDM-Custom, open the file OpSummary.htm in your preferred editor. This is the template file used to create the summary report for EDM operations. Replace ESPRIT_Logo_RGB_180x64_Web.gif in the template with genericlogo_200x200.gif . Add attributes for width and height to scale the image from 200 pixels x 200 pixels to 110 wide x 110 high: When you float a visible element like an image, it becomes a block that can then be shifted to the left or right as far as possible. Any text is then nicely wrapped around the image. The logo in this template will always appear at the far right of the screen, no matter how much the screen is resized. <p><img src=generic-logo_200x200.gif width=110 height=110 style=float: right /></p>
dptechnology.com
V iew t he up d at e Save the file. View the file in your Web browser to see the new logo. Keep the EDM-Custom\OpSummary.htm template file open for the next lesson.
Notice that the title now wraps to the left of the logo.
dptechnology.com
10
Replac e t he t hird row of dat a in t he head er t abl e The third row of the header table displays information about auto wire threader, submerged tank, wire diameter and start position from SolidWire Part Setup.
This information does not change often, so you will replace this row with three new rows that display data about the part type and material from KnowledgeBase Document Setup. Copy the second row in the table: <tr> <td style=width: 15% class=style1><strong>ESPRIT File Path:</ strong></td> <td colspan=3>Gen_FileName</td> </tr>
Replace the third row with the copied code (all the code between the third set of <tr> </tr> tags). Change the third row as follows: The general keywords shown here are listed in the database schema file under the heading General Data. <tr> <td style=width: 15% class=style1><strong>Machine:</strong></td> <td colspan=3>Gen_PartType</td> </tr> Copy the second row two more times and then change to these values: <tr> <td style=width: 15% class=style1><strong>Machine:</strong></td> <td colspan=3>Gen_PartType</td> </tr> <tr> <td style=width: 15% class=style1><strong>Material Class:</ strong></td> <td colspan=3>Gen_PartMaterialClass</td> </tr> <tr> <td style=width: 15% class=style1><strong>Material Condition:</ strong></td> <td colspan=3>Gen_PartMaterialCondition</td> </tr> Save the template file. Open the file Wire EDM Example.esp and generate the custom report. Open the report OpSummary.htm in a Web browser.
dptechnology.com
11
Fix t he spacing in t he head er Now that youve added extra rows to the header table, you need to adjust the row spacing for the image to make it span 7 rows instead of 5. In the first row, change the rowspan value. The attributes rowspan and colspan can be used in HTML tables to stretch a cell across the number of rows or columns specified. <tr> <td class=style2 style=width: 15%><strong>Part Name:</strong></ td> <td colspan=3 class=style3><strong>Gen_Name</strong></td> <td style=width: 24% rowspan=7> <img src=PartPic.jpg width=350 height=350 /></td> </tr>
dptechnology.com
12
Move t he Comm ent column in t he t abl e of op erat ions In the second table that lists the operations, you will move the operation comments from the last column to the third column in the table. In the first row, move the Comment heading to the third item in the row (Cut and Paste the line of code).
When a CL code is referenced in a template, it must be followed by the letter C or V. C outputs the caption of the parameter. V outputs the value. CL7 corresponds to the Comment parameter on a technology page.
In the third row, move the cell containing CL7V to the third item in the row.
Remove t he Wor k Coordinat e column Remove the header and variable cells for Work Coordinate. Delete the following lines of code: <td><strong>WORK COORD</strong></td> <td>OP_WorkCoordinateName</td>
Remove one column from the column span for the operation list. <tr> <td colspan=7>BEGIN_EDMOP</td> </tr> <tr> <td colspan=7>END_EDMOP<br /> INSERT_OPERATIONS</td> </tr>
dptechnology.com
13
A pply a st yle t ag to a row A style called .style1 is defined in this HTML template. The only attribute of style1 is a background color of light gray. .style1 { background-color: #F0F0F0; }
You can apply this style to individual cells in the table or you can apply it to an entire row. In this lesson, you will set the background color for an entire row. The class attribute is typically used to point to a class in a style sheet. When a class is assigned to an element, it overrides the default formatting only for that element. Add the style1 class attribute to the header row of the operation list. <table style=width: 100% cellspacing=0> <tr class=style1> <td><strong>OP#</strong></td> <td><strong>OPERATION</strong></td> <td><strong>COMMENT</strong></td> <td><strong>OFFSET<br /> OFFSET #</strong></td> <td><strong>POWER</strong></td> <td><strong>FEEDRATE</strong></td> <td><strong>CYCLE TIME<br /> LENGTH OF CUT</strong></td> </tr>
Save the file and generate the report again to see your changes.
dptechnology.com
14
Every setting on a technology page has a corresponding CL code. You can find the CL code by right-clicking on a setting and selecting Edit Properties. The CL code is displayed in the title of the dialog.
Lists of CL codes can also be found in the Post help (on the Help menu, click Post Help). In the Appendix are lists of CL codes for every machining technology in ESPRIT, including cutting tools.
The format is: CLT{N}{###}[V/C]. N identifies the tool on operations that have more than one tool (first, second, third)
dptechnology.com
15
### identifies the CL code number V or C returns the Value or Caption For example, CLT1101V is the value of ToolNumber (CL Code 101) of the first (primary) tool. CLT2103V is the ToolDiameter (CL Code 103) of the second tool. CLT3105V is the ToolLength (CL code 105) of the third tool.
The settings in the OpSummary template also control whether tool and tool holder pictures are created. <p>BEGIN_SETTINGS<br /> ... CreateToolingPictures=1<br /> CreateToolingHolderPictures=0<br />
To enable the creation of tool holder pictures, set CreateToolingHolderPictures to 1. To show tool pictures, the template should contain the following references: Tool498.jpg for the first tool of an operation Tool711.jpg for the second tool Tool707.jpg for the third tool To show holder pictures, the template should contain the following references: Holder498.jpg for the first tool Holder711.jpg for the second tool Holder707.jpg for the third tool
dptechnology.com
16
Lesson Summary Add a disclaimer to the summery report Replace the operation type in the detailed report with the incremental depth
G enerat e a d et ailed milling repor t Open the file Milling Example.esp. Generate a Milling_Detailed-Custom report. In the detailed report for the first operation in the list, the data for Op Type is not very useful. You will replace it with information about the incremental depth.
Ad d a disclaim er to t he summar y repor t In a text editor, open the file ReportGenerator\Templates\Milling_DetailedCustom\OpSummary.htm. At the bottom of the report, add a paragraph element <p> for a document control disclaimer: </table> <p class=disclaimer>The information in this report is intended solely for the internal use of Generic Corp. employees. Access to the information contained in this report by anyone else is unauthorized and prohibited.</p> </body>
Add the disclaimer style to the report. .style1 { background-color: #F0F0F0; } The font family for the <p> element has already been defined at the beginning of the style section (fontfamily:Arial, Helvetica, sans-serif;), so you dont need to define it again. When you create any additional classes for paragraphs, you only need to define attributes that are new or different because paragraphs will first inherit the root attributes. .disclaimer { font-size: medium; color: DarkRed; font-weight: bold; } </style>
Save the template file and generate the Milling_Detailed-Custom report again to see the new disclaimer.
dptechnology.com
17
Find t he CL cod e for Increm ent al D ept h In Milling Example.esp, double-click on the first operation in the Operation Manager to open the technology page. On the Strategy tab, rightclick on Incremental Depth and click Edit Properties. Notice that Incremental Depth = CL Code (175) Close the dialog.
Ad d d at a for increm ent al d ept h to t he d et ail ed milling repor t In a text editor, open the file ReportGenerator\Templates\Milling_DetailedCustom\OpDetailed.htm. In the second row of the table, replace Op Type with CL175C (to output the caption) as shown below. Replace OP_GuiTypeName with CL175V (to output the value). <table style=width: 100% cellspacing=0> <tr> <td colspan=2 class=style2><strong>OP OP_Key : CL613V</ strong></td> <td rowspan=12><img src=AfterSim.jpg width=350 height=350 /></td> </tr> <tr> <td style=width: 22% class=style1>CL175C</td> <td style=width: 28%><strong>CL175V</strong></td> </tr>
Save the template file and generate the detailed custom report again to see the changes.
dptechnology.com
18
JavaSc ript sy nt a x
Special tags are needed to embed Javascript within an HTML document: <script type=text/javascript> </script> JavaScript variables are used to hold values or expressions. Variables are declared with the var keyword. Variable names must begin with a letter or the underscore character: JavaScript is casesensitive, so variable names are also casesensitive. var toolNum; (Integer) var toolName; (String)
After variables are declared, they are empty (they have no values yet). Variables can hold values and mathematical expressions: toolNum=5; toolNum=x+y-4;
When you assign a string to a variable, use quotes around the value. If you place numbers inside the quotes, they are treated as a string rather than a numerical value. toolName=Drill; Variables can be declared globally or locally. A variable declared within a JavaScript function becomes LOCAL and can only be accessed within that function. Variables declared outside a function become GLOBAL, and all scripts and functions on the Web page can access them.
dptechnology.com
19
Lesson Summary Declare a global variable to use as a counter for operation numbers Add a function to count all operations Overwrite the operation numbers from the ESPRIT document with consecutive operation numbers in the report
G enerat e a summar y tur ning repor t Open the file Turning Example.esp. Generate the Turning_Summary-Custom report. Notice that the operation numbers are set in the order the operations were created in ESPRIT. When operations are sorted, moved, added, or deleted in the Operation Manager, the numbers are no longer consecutive and may have gaps between numbers. This is not useful for machine operators.
D eclare a global var iable You will begin by declaring a global variable that you can use as a counter for the operation numbers. You will set the initial value to 1. In a text editor, open the template file ReportGenerator\Templates\Turning_ Summary-Custom\OpSummary.htm. Add the following code: <body> <p>BEGIN_SETTINGS<br /> CreateSimulationPictures=0<br /> SimulationPictureWidth=350<br /> ... NAReplacementString=-<br /> END_SETTINGS</p> <!--Define Global Variables--> <script type=text/javascript> opNum=1; </script> dptechnology.com 20
Ad d a scr ipt to count t he op erat ions In the second table that lists the operations, rename the first cell in the first row to ORDER. <table style=width: 100% cellspacing=0> <tr> <td class=style1><strong>ORDER</strong></td> <td style=width: 13%><strong>OPERATION</strong></td>
Rename the second cell in the first row OPERATION(OP#) to make it easy to cross-reference the operation numbers in the ESPRIT document. <table style=width: 100% cellspacing=0> <tr> <td class=style1><strong>ORDER</strong></td> <td style=width: 13%><strong>OPERATION(OP#)</strong></td> <tr> <td colspan=10>BEGIN_TURNINGOP</td> </tr> <tr> <td><script type=text/javascript> document.write(opNum); opNum=opNum+1; </script></td> <td style=width: 13% class=style1>CL613V</td>
The function called document.write outputs a number or string into the HTML document. It must be written in all lower case. DP Technology Corp. 1150 Avenida Acaso Camarillo, CA 93012 USA North America +1 800 627 8479 esprit@dptechnology.com International +1 805 388 6000 esprit@dptechnology.com About DP Technology DP Technology is a leading developer and supplier of computer-aided manufacturing (CAM) software for a full range of machine tool applications. ESPRIT, DP Technologys flagship product, is a powerful, high-performance, fullspectrum programming system for milling, turning, wire EDM, and multitasking machine tools. ESPRIT embodies DP Technologys passion for excellence and its vision of technologys potential. Copyright DP Technology All rights reserved. ESPRIT is a registered trademark of DP Technology Corp.
Add logic in the first cell after BEGIN_TURNINGOP for the operation counter.
Add the Op_Number from the ESPRIT document to the second cell in the row. Repeat the same steps below BEGIN_MILLINGOP. <td style=width: 13% class=style1>CL613V(OP Op_Number)</td>
Save the template file and generate the summary turning report again to see the reordered operation numbers.
Customizing your machining reports just takes some creativity and a little HTML know-how.
dptechnology.com
21