Sunteți pe pagina 1din 11

Page 1 of 11

Customizing the Report Database

ReportDatabase.mdb is a Microsoft Access file that contains the forms and data for the Setup Sheet function in
CAMWorks. Templates are supplied for generating Setup Sheets. You can use a template as is or you can create
customized templates.

IMPORTANT! In order to generate Setup Sheets and customize the Report Database, you need the full
version of Microsoft Access 2003 or 2007 or 2010 or 2013 or Microsoft Office 365. You should be familiar with
Microsoft Access and depending on the complexity of your modifications, you may need to know Visual Basic
and SQL.

Rules
The following rules should be observed when customizing the ReportDatabase.mdb file:

z SOLIDWORKS/CAMWorks Solids and CAMWorks must not be running.

z Open the file ReportDatabase.mdb by double clicking the file in Windows Explorer or using the Open command in Access.

z Do not modify any of the supplied report templates.

If a supplied report template is modified, these changes will be lost in future versions of CAMWorks.

If you want to create a customized Setup sheet based on one of the supplied report templates, make a copy of the
template and give it a unique name. This copy can then be modified as desired and can be imported into future
versions of the CAMWorks ReportDatabase. The procedure for importing user-defined reports is described in
the CAMWorks Installation & License Activation Guide.

Tables
The following table explains the design of the tables in the Report Database required for generating Setup Sheets
from CAMWorks.

Conventions

The field names in bold denote the fields that act as primary key. The field names in italic denote the fields that
act as foreign keys.

file:///C:/Users/hamzah/AppData/Local/Temp/~hh973.htm 7.12.2015
Page 2 of 11

file:///C:/Users/hamzah/AppData/Local/Temp/~hh973.htm 7.12.2015
Page 3 of 11

(1) Document data included in the Report database table rep_Doc includes the following
SOLIDWORKS/CAMWorks Solids information:

z Company
z Document name

(2) Custom Information data included in the Report database table rep_Custominfo contains data from
the SOLIDWORKS/CAMWorks Solids Summary Information dialog box, which is accessed from the Properties
command on the File menu. The following information from this dialog box is output to the rep_Custominfo
table:

Summary tab All fields on the Summary tab are output to the rep_Custominfo table including:

z Author z Subject
z Keywords z Created
z Comments z Last Saved
z Title z Last Saved By

Custom tab The standard Name fields and data from the Custom tab are saved to the rep_Custominfo table.
User defined fields are not output. The standard Name fields include:

z Checked by z Forward to z Purpose


z Client z Group z Received from
z Date completed z Language z Recorded by
z Department z Mailstop z Recorded date
z Destination z Matter z Reference
z Disposition z Office z Status

file:///C:/Users/hamzah/AppData/Local/Temp/~hh973.htm 7.12.2015
Page 4 of 11

z Division z Owner z Telephone number


z Document number z Project z Typist
z Editor z Publisher

Relationship Between Tables


The diagram below depicts the relationships between the various tables.

Mill Operation Tables(rep_3AxisFin , rep_3AxisRgh, rep_BoreFeaOperParams, rep_CenterDrillFeaOperParams, rep_CounterSunkFeaOperParams,


rep_DrillFeaOperParams, rep_FinishMillFeaOperParams, rep_PencilMillFeaOperParams, rep_ReamFeaOperParams,
rep_RghMillFeaOperParams, rep_ThreadMillFeaOperParams)

Turn Operation Tables(rep_TurnBoreFinOperParams, rep_TurnBoreRghOperParams, rep_TurnCenterDrillOperParams, rep_TurnCutOffOperParams,


rep_TurnDrillOperParams, rep_TurnFaceFinOperParams, rep_TurnFaceRghOperParams, rep_TurnFinOperParams,
rep_TurnGrooveFinOperParams, rep_TurnGrooveRghOperParams, rep_TurnRghOperParams, rep_TurnThreadOperParams)

file:///C:/Users/hamzah/AppData/Local/Temp/~hh973.htm 7.12.2015
Page 5 of 11

Mill Tool Tables(rep_BORES, rep_CenterDrill, rep_CornerRounding, rep_CounterSink, rep_Dovetail, rep_DRILLS, rep_Keyway, rep_MILLC,
rep_MillUDTool , rep_nTaps, rep_REAMERS, rep_Taper, rep_ThreadMillMultiPt, rep_ThreadMillSinglePt)

*Turn Tool Tables(rep_TurnBoringBarParams, rep_TurnCenterDrill, rep_TurnDrillTool, rep_TurnTool)

In case of entry in rep_TurnTool look for a matching entry in following tables for insert data

Insert Tables(rep_TurnCircularInsert, rep_TurnDiamondInsert, rep_TurnGrooveInsert, rep_TurnHexagonInsert, rep_TurnSquareInsert,


rep_TurnThreadInsert, rep_TurnTriangleInsert, rep_TurnTrigonInsert)

And rep_TurnHolderParams for holder data.

Mill Feature Tables(rep_FeaCirBoss,rep_FeaCornerRectSlot, rep_FeaCtrBoreHole, rep_FeaCtrSunkHole, rep_FeaHole, rep_FeaIrrBoss,


rep_FeaIrrPocket, rep_FeaIrrSlot, rep_FeaMSHole, rep_FeaObroundBoss, rep_FeaRectBoss, rep_FeaRectPocket, rep_FeaRectSlot)

Turn Feature Tables(rep_FeaTurnCutOff, rep_FeaTurnFace, rep_FeaTurnGrooveGeneric, rep_FeaTurnGrooveObround, rep_FeaTurnGrooveRect,


rep_FeaTurnProfileID, rep_FeaTurnProfileOD)

All Report Database tables have been grouped under following categories:

Mill Operations

Turn Operations

Mill Tools

Turn Tools

Mill Features

Turn Features

Other Tables

Other Turn Tables

Adding New Fields to Report Templates


CAMWorks provides sample Report templates for Mill and Turn; however, you may want to create customized
templates with fields that re not provided in the samples. The information below describes the procedure to
create new templates and add the following types of fields:

file:///C:/Users/hamzah/AppData/Local/Temp/~hh973.htm 7.12.2015
Page 6 of 11

z Mill Tool Fields: Tool-Diameter, Tip-Angle, Protrusion

z Turn operation Fields: Max-Cut-Amount, Radial-Allowance, Clearance-Plane and WIP

Notes
z Always work on a copy of ReportDatabase.mdb.

z Do not modify any of the supplied report templates. If a supplied report template is modified, these changes will be lost in future versions of CAMWorks.

If you want to create a customized Setup sheet based on one of the supplied report templates, make a copy of the
template and give it a unique name. This copy can then be modified as desired and can be imported into future
versions of the CAMWorks ReportDatabase. The procedure for importing user-defined reports is described in
the CAMWorks Installation & License Activation Guide.

z You should be familiar with Microsoft Access and SQL.

z Refer to the topic Customizing the Report Database for the Tables and Relationship Between Tables information.

z All data seen on Feature-Operation-Tool dialog boxes are output to specific tables in ReportDatabase.mdb. If some data is not traceable, then email the
description of the field to support@camworks.com, mentioning the tables in which you tried to locate it.

Opening the Report Database for Design Changes


1. Open ReportDatabase.mdb.

2. Select Window on the menu bar and click Unhide.

3. Click OK to display all the Tables, Queries and Reports.

Adding Mill Tool Fields


The current Mill-Template displays only the Tool-Comment in the Setup Sheets. The procedure below explains
how to add the Tool-Diameter, Tip (or CounterSink Angle) and Protrusion fields to the template.

1. Copy the rep_Template report and name it rep_myTemplate.

2. Copy the following queries and name them as indicated:

Copy New Name


ToolQueryDef MyMillToolQueryDef
MillCombinedQry MyMillCombinedQry
SummQuery MyMillSummQuery
3. Modify MyMillToolQueryDef so that it queries the required fields from all the Mill-Tool-Tables. Refer to the topic
Customizing the Report Database for the Tables. Run the query by double clicking it.

Query name SQL


ToolQueryDef SELECT Op_RepID, Comment from rep_Relation, rep_BORES where Op_RepID = ID UNION ALL

SELECT Op_RepID, Comment from rep_Relation, rep_CenterDrill where Op_RepID = ID UNION ALL

.
Old query

. (For all tools)

file:///C:/Users/hamzah/AppData/Local/Temp/~hh973.htm 7.12.2015
Page 7 of 11

SELECT Op_RepID, Comment from rep_Relation, rep_MillUDTool where Op_RepID = ID UNION ALL

SELECT Op_RepID, Comment from rep_Relation, rep_Dummy where Op_RepID = ID;


MyMillToolQueryDef SELECT Op_RepID, MinBorDia as ToolDiameter,"NA"as [Tool Sink Angle], Protrusion from rep_Relation,
rep_BORES where Op_RepID = ID UNION ALL

SELECT Op_RepID, DrillDiameter ,CounterSinkAngle , Protrusion from rep_Relation, rep_CenterDrill where


Op_RepID = ID UNION ALL
New query
.

. (For all tools)

Click here for full SQL code


.

SELECT Op_RepID, CutDia,"NA", Protrusion from rep_Relation, rep_MillUDTool where Op_RepID = ID UNION
ALL

SELECT Op_RepID, "NA","NA","NA" from rep_Relation, rep_Dummy where Op_RepID = ID;

Notes
z Headers ("ToolDiameter", "Tool Sink Angle") have been added to Queries. These headings will be used later. If the heading is not provided the FieldName is
taken as heading. If the header has a space in between, then it has to be enclosed in rectangular braces ([Tool Sink Angle]).

z Fields that are not applicable to some tools are marked NA.

z You can add any number of fields, but the number of fields from all tools should be same.

z If any tool-type is missed, then operations using this tool will not be seen in the Setup sheet.

z The Tool-Diameter field may be named "CutDia" in one table and "DrillDia" in another. Open each table in Design View and confirm that the field name being
queried is correct

4. Open MyMillCombinedQry in Design View and Add the MyToolQuerDef query.

5. Replace all instances of ToolQuerDef with MyToolQuerDef and select all the required fields.

6. Maintain a 1-to-1 relationship between Op-RepID of different queries. Delete the ToolQuerDef. All fields in both the queries
can be selected by using *. Run the query by double clicking it.

The SQL-View of the query will be


SELECT MyMillToolQueryDef.*, rep_MillHolderLibrary.*

FROM MyMillToolQueryDef INNER JOIN rep_MillHolderLibrary ON MyMillToolQueryDef.Op_RepID = rep_MillHolderLibrary.ID

WHERE (((MyMillToolQueryDef.Op_RepID)=[rep_MillHolderLibrary].[ID]));

7. Open MyMillSummQuery in Design View, then Add MyMillCombinedQry and select all required fields.
Maintain a 1-to-1 relationship between Op-RepID of different queries. Do not select all fields as this will
create a multiple Op-RepID in the query. Run the query by double clicking it. Click here for full SQL code

8. Go to the Reports tab and open rep_MyTemplate in Design-View.

9. Right click on the header at Report->Properties and go to the Data tab.

10. Set the RecordSource to MyMillSummQuery.

11. Remove the fields that are not required and add 3 text boxes for the new fields.

12. Right click on each text box and set the Control-Source on the Data tab.

file:///C:/Users/hamzah/AppData/Local/Temp/~hh973.htm 7.12.2015
Page 8 of 11

13. Open rep_MyTemplate and confirm that no errors are reported.

14. Set this template to the default Mill template.

15. Close the ReportDatabase.mdb and open CAMWorks.

When you generate Setup Sheets for any Mill part, the rep_MyTemplate template with the new tool fields will
be used to generate the report.

17. For adding operation fields, refer to Adding Turn Operation Fields below.

Adding Turn Operation Fields


The current Turn-Template does not have any other details about the operations except for the operation name
and tool-details. We will add the Max-Cut-Amount, Radial-Allowance, Clearance-Plane and WIP fields to this
template:

1. Copy the rep_TurnTemplate report and name it rep_MyTurnTemplate.

2. Copy the following queries and name them as indicated:

Copy New Name


TurnOperQry MyTurnOperQry
TurnTableQry MyTurnTableQry

3. Modify MyTurnOperQry so that it queries the required fields from all the Turn-Operation-Tables. Run the query by double
clicking it.

Query name SQL


TurnOperQry SELECT ID, SpindleSpeed, SpindleMode, FeedRateIPM, FeedRateIPR, FeedType FROM
rep_TurnBoreFinOperParams UNION ALL

SELECT ID, SpindleSpeed, SpindleMode, FeedRateIPM, FeedRateIPR, FeedType FROM


rep_TurnBoreRghOperParams UNION ALL

SELECT ID, SpindleSpeed, SpindleMode, FeedRateIPM, FeedRateIPR, FeedType FROM


rep_TurnCenterDrillOperParams UNION ALL

. (For all operations)

SELECT ID, SpindleSpeed, SpindleMode, FeedRateIPM, FeedRateIPR, FeedType FROM


rep_TurnThreadOperParams UNION ALL SELECT ID, SpindleSpeed, SpindleMode, FeedRateIPM,
FeedRateIPR, FeedType FROM rep_TurnDummyOperParams;
MyTurnOperQry SELECT ID, MaxCutAmt, RadialStockAmt,ClearancePlane, ConsiderWIP, SpindleSpeed, SpindleMode,
FeedRateIPM, FeedRateIPR, FeedType FROM rep_TurnBoreFinOperParams UNION ALL

SELECT ID, MaxCutAmt, RadialStockAmt,ClearancePlane, ConsiderWIP,SpindleSpeed, SpindleMode,


FeedRateIPM, FeedRateIPR, FeedType FROM rep_TurnBoreRghOperParams UNION ALL
New query
.

. (For all operations)

Click here for full SQL code


.

SELECT ID, DepthPerCut, "NA", ClearanceAmt, ConsiderWIP,SpindleSpeed, SpindleMode, FeedRateIPM,


FeedRateIPR, FeedType FROM rep_TurnThreadOperParams UNION ALL

file:///C:/Users/hamzah/AppData/Local/Temp/~hh973.htm 7.12.2015
Page 9 of 11

SELECT ID, 0, 0,0, 0,SpindleSpeed, SpindleMode, FeedRateIPM, FeedRateIPR, FeedType FROM


rep_TurnDummyOperParams;

Notes
z Fields that are not applicable to some tools are marked NA.

z You can add any number of fields, but the number of fields from all operations should be same.

z If any operation-type is missed, then these types of operations will not be seen in the Setup sheet.

z The Cut-Amount field may be named "MaxCutAmt" in one table and "SubCutAmt" in another. Open each
table in Design View and confirm the field name being queried is correct.

4. Open MyTurnTableQry in Design View and then in SQL View replace all instances of TurnOperQry with
MyTurnOperQry. Run the query by double clicking it. Click here for full SQL code
5. Go to the Reports tab and open rep_MyTurnTemplate in Design-View.
6. Right click on the header at Report->Properties and go to the Data tab.
7. Set the RecordSource to MyTurnTableQry.
8. Remove the fields that are not required and add 4 text boxes for the new fields.
9. Right click on each Text box and set the Control-Source on the Data tab.
10. Open rep_MyTurnTemplate and confirm that no errors are reported.
11. Set this template to the default Turn template.
12. Close the ReportDatabase.mdb and open CAMWorks.

When you generate Setup Sheets for any Turn part, the rep_MyTurnTemplate template with the new operation
fields will be used to generate the report.

13. For adding tool fields, refer to Adding Mill Tool Fields above.

SQL Code for New Queries


MyMillToolQueryDef SELECT Op_RepID, MinBorDia as ToolDiameter, "NA" as [Tool Sink Angle], Protrusion from rep_Relation,
rep_BORES where Op_RepID = ID UNION ALL

SELECT Op_RepID, DrillDiameter ,CounterSinkAngle , Protrusion from rep_Relation, rep_CenterDrill where


Op_RepID = ID UNION ALL

SELECT Op_RepID, Diameter,CounterSinkAngle,Protrusion from rep_Relation, rep_CounterSink where


Op_RepID = ID UNION ALL

SELECT Op_RepID, CutDia,"NA", Protrusion from rep_Relation, rep_DRILLS where Op_RepID = ID UNION
ALL

SELECT Op_RepID, CuttingDia,"NA", Protrusion from rep_Relation, rep_MILLC where Op_RepID = ID UNION
ALL

SELECT Op_RepID, [Thread Diameter], "NA", Protrusion from rep_Relation, rep_nTaps where Op_RepID = ID
UNION ALL

SELECT Op_RepID, MinCutDia,"NA", Protrusion from rep_Relation, rep_REAMERS where Op_RepID = ID


UNION ALL

file:///C:/Users/hamzah/AppData/Local/Temp/~hh973.htm 7.12.2015
Page 10 of 11

SELECT Op_RepID, Dia,"NA", Protrusion from rep_Relation, rep_ThreadMillMultiPt where Op_RepID = ID


UNION ALL

SELECT Op_RepID, Dia,"NA", Protrusion from rep_Relation, rep_ThreadMillSinglePt where Op_RepID = ID


UNION ALL

SELECT Op_RepID, ToolDiameter,"NA", Protrusion from rep_Relation, rep_Taper where Op_RepID = ID


UNION ALL

SELECT Op_RepID, EffectiveDia,"NA", Protrusion from rep_Relation, rep_Dovetail where Op_RepID = ID


UNION ALL

SELECT Op_RepID, EffectiveDia,"NA", Protrusion from rep_Relation, rep_Keyway where Op_RepID = ID


UNION ALL

SELECT Op_RepID, CutDia,"NA", Protrusion from rep_Relation, rep_MillUDTool where Op_RepID = ID UNION
ALL SELECT Op_RepID, "NA","NA","NA" from rep_Relation, rep_Dummy where Op_RepID = ID;
MyMillCombinedQry SELECT MyMillToolQueryDef.*, rep_MillHolderLibrary.*

FROM MyMillToolQueryDef INNER JOIN rep_MillHolderLibrary ON MyMillToolQueryDef.Op_RepID =


rep_MillHolderLibrary.ID

WHERE (((MyMillToolQueryDef.Op_RepID)=[rep_MillHolderLibrary].[ID]));
MyMillSummQuery SELECT DISTINCT OperQueryDef.DocID, OperQueryDef.Mch_RepId, OperQueryDef.WrkPiece_RepID,
OperQueryDef.Setup_RepID, OperQueryDef.Op_RepID, OperQueryDef.OperationName,
OperQueryDef.ZFeedrate, OperQueryDef.SpindleSpeed, OperQueryDef.ToolStn,
MyMillCombinedQry.ToolDiameter,

MyMillCombinedQry.[Tool Sink Angle],

MyMillCombinedQry.Protrusion

FROM OperQueryDef INNER JOIN MyMillCombinedQry ON OperQueryDef.Op_RepID =


MyMillCombinedQry.Op_RepID;

MyTurnOperQuery SELECT ID, MaxCutAmt, RadialStockAmt as [Allowance],ClearancePlane, ConsiderWIP, SpindleSpeed,


SpindleMode, FeedRateIPM, FeedRateIPR, FeedType FROM rep_TurnBoreFinOperParams UNION ALL

SELECT ID, MaxCutAmt, RadialStockAmt,ClearancePlane, ConsiderWIP,SpindleSpeed, SpindleMode,


FeedRateIPM, FeedRateIPR, FeedType FROM rep_TurnBoreRghOperParams UNION ALL

SELECT ID, SubsequentPeckAmt, "NA",ClearancePlane, ConsiderWIP, SpindleSpeed, SpindleMode,


FeedRateIPM, FeedRateIPR, FeedType FROM rep_TurnCenterDrillOperParams UNION ALL

SELECT ID, SubPeckAmt, RadialStockAmt, ClearancePlane, ConsiderWIP,SpindleSpeed, SpindleMode,


FeedRateIPM, FeedRateIPR, FeedType FROM rep_TurnCutOffOperParams UNION ALL

SELECT ID, SubsequentPeckAmt, "NA",ClearancePlane, ConsiderWIP,SpindleSpeed, SpindleMode,


FeedRateIPM, FeedRateIPR, FeedType FROM rep_TurnDrillOperParams UNION ALL

SELECT ID, MaxCutAmt, RadialStockAmt,ClearancePlane, ConsiderWIP,SpindleSpeed, SpindleMode,


FeedRateIPM, FeedRateIPR, FeedType FROM rep_TurnFaceFinOperParams UNION ALL

SELECT ID, MaxCutAmt, RadialStockAmt,ClearancePlane, ConsiderWIP,SpindleSpeed, SpindleMode,


FeedRateIPM, FeedRateIPR, FeedType FROM rep_TurnFaceRghOperParams UNION ALL

SELECT ID, MaxCutAmt, RadialStockAmt,ClearancePlane, ConsiderWIP,SpindleSpeed, SpindleMode,


FeedRateIPM, FeedRateIPR, FeedType FROM rep_TurnFinOperParams UNION ALL

SELECT ID, MaxCutAmt, RadialStockAmt,ClearancePlane, ConsiderWIP,SpindleSpeed, SpindleMode,


FeedRateIPM, FeedRateIPR, FeedType FROM rep_TurnGrooveFinOperParams UNION ALL

SELECT ID, Stepover, RadialStockAmt,ClearancePlane, ConsiderWIP,SpindleSpeed, SpindleMode,


FeedRateIPM, FeedRateIPR, FeedType FROM rep_TurnGrooveRghOperParams UNION ALL

SELECT ID, MaxCutAmt, RadialStockAmt,ClearancePlane, ConsiderWIP,SpindleSpeed, SpindleMode,


FeedRateIPM, FeedRateIPR, FeedType FROM rep_TurnRghOperParams UNION ALL

SELECT ID, "NA", "NA",ClearancePlane, ConsiderWIP,SpindleSpeed, SpindleMode, FeedRateIPM,


FeedRateIPR, FeedType FROM rep_TurnTapOperParams

UNION ALL

SELECT ID, DepthPerCut, "NA", ClearanceAmt, ConsiderWIP,SpindleSpeed, SpindleMode, FeedRateIPM,

file:///C:/Users/hamzah/AppData/Local/Temp/~hh973.htm 7.12.2015
Page 11 of 11

FeedRateIPR, FeedType FROM rep_TurnThreadOperParams

UNION ALL

SELECT ID, 0, 0,0, 0,SpindleSpeed, SpindleMode, FeedRateIPM, FeedRateIPR, FeedType FROM


rep_TurnDummyOperParams;
MyTurnTableQry SELECT MyTurnOperQry.*, TurnToolQueryDef.*, rep_Relation.*

FROM rep_Relation INNER JOIN (MyTurnOperQry INNER JOIN TurnToolQueryDef ON MyTurnOperQry.ID =


TurnToolQueryDef.ID) ON rep_Relation.Op_RepID = TurnToolQueryDef.ID;

file:///C:/Users/hamzah/AppData/Local/Temp/~hh973.htm 7.12.2015