TRAINING GUIDE Crystal Reprts fr Wrk
Crystal Reprts fr Wrk Orders This guide ges ver particular steps and challenges in created reprts fr wrk rders. Mst f the fllwing items can be issues fund in creating ther reprts, hwever; they are very cmmn in Wrk reprts. Table f Cntents Adding Tables... 2 Secured Fields... 5 Adding a Cmments Sectin... 7 Linking... 10 Linking Wrk Orders t Requests... 10 Linking Requests t Requests... 13 Linking Requests t Wrk Orders... 16 Linking Wrk Orders t Wrk Orders... 18 Using Wrk Order Asset Inventry Numbers... 20 Limiting Recrd Selectin t Specific Assets... 21 Asset Subreprts... 22 Bringing in Asset Wrk Orders with Cmment... 25 Wrk Order Summary Reprts and Filters... 27 Using Variables in a Reprt... 28 Secured Fields in Subreprts... 30 Mre n Variables Passing infrmatin frm a subreprt t the main reprt... 31 WO Subtask Infrmatin t Assets... 34
Adding Tables 1. Bring in all f the tables that culd pssibly be filtered n in the reprt. The fllwing is a simple Wrk Order Reprt with fields frm the WKORDER table with nly the WKORDER table in the Database Expert. If this reprt is run in Lucity with a Resurce Cde equal t 1 (emplyee) filter then the fllwing errr wuld shw up and the reprt wuld nt run. The reasn this ccurs is because the WKRESRCE table is nt a part f this reprt. Bring in any tables with pssible fields t be filtered n int the Database Expert and Link. Nte: Crystal Reprts fr Wrk Orders 2
The standard Wrk Order Summary reprt has the fllwing tables yet nly shws fields frm the WKORDER and WKORDERLOC tables: 2. In general the tables are linked with Left Outer Jin cnnectins. If the table n the left is true then mve t the right fr the next infrmatin. This shws with an arrw pinting t the Cnnecting tables. Inner jins can be used infrmatin in bth tables has t exist but smetimes Crystal has sme issues with this linking. This shws with a line with n arrws. Sme lder reprts shw all f the cnnectins withut arrws even thugh they are Left Outer Jins. If lking at an ld standard reprt and all f the cnnectins lk like inner jins, check each cnnectin by duble clicking each line and finding the Jin Type descriptin. 3. Many items in the Wrk Order mdule are fund in grids. Each grid is a different table. The nrmal user wants t start grabbing tables, linking and pulling in fields. As lng as yu can find the crrect linking fields this shuld wrk, right? Wrng. A typical field users wuld like t see is the address. Yu want the WKORDERLOC table amng the tables in the main bdy f the reprt s the reprt can be run with an address filter. If the address is brught directly in frm this table, the fllwing ccurs: Crystal Reprts fr Wrk Orders 3
The Wrk Order # 2006-01128 shws up twice because in this recrd there are tw addresses in the Address grid. This might nt be a prblem t see the wrk rder fr each lcatin but the Ttal Cst is ging t shw up each time as well which is nrmally undesirable. Pssible ways t handle this: If yu just want ne f the addresses yu culd grup n the WO # and then place all f the fields in the grup header r fter. Depending n whether yu wish t see the tp address r bttm address in the Wrk Order Lcatin grid yu culd g int the Recrd Srt Expert and select the address field t srt n in either ascending r descending rder. Anther pssibility is gruping n the WO# and then putting the address frmula in the Detail sectin. This desn t lk particularly gd but yu get all f the infrmatin. Crystal Reprts fr Wrk Orders 4
There can still be prblems if yu bring in anther field frm anther grid. In this next example the subtask frm the WKWOTSK table is brught in. There are three subtasks fr this wrk rder and ne f the Tasks has tw resurces. S, fr each address each task/resurce cmbinatin is brught in. Yu definitely dn t want this t happen. The prblem is the way Lucity passes the infrmatin ver t Crystal. The best way t handle grid infrmatin is with subreprts. Bth the SubTask and fields can be put in subreprts. Address Secured Fields Smetimes, fields shuld be hidden in reprts if the persn viewing the reprt des nt have the prper level f security. This can be dne by using parameters and frmatting ptins. Any field can be set up fr security, such as cst, addresses, r phne # s. Nte: This will nly wrk fr fields in the main bdy f the reprt. Fields that need t be hidden in subreprts will be addressed in ur related wrkbk, Advanced Crystal 3. Many cst fields in Wrk Order reprts are set t use the Hidden ptin in 2b belw. The Ttal cst field in the WO Summary reprt is already set up this way. Smetimes yu may wish t suppress the fields cmpletely as shwn in 2a. The fllwing steps are prvided s yu can set up yur wn field security. Crystal Reprts fr Wrk Orders 5
1. Right click Parameter Fields and select New. Type in the Name - ViewSecuredFields. This is a special parameter field that must have this name ViewSecuredFields. When the reprt is run within Lucity the security is passed t the reprt and will nt query the user. If the reprt is run utside f a Lucity mdule, in Crystal, then the security will be queried. Select the Type (Crystal XI) r Value Type (Crystal 10) - Number and under Optins - Discreet Value. Click OK. Field Viewing Optins 2. a. Field t Shw Blank Fr a blank field t shw up when the user des nt have rights t view the secure fields, d the fllwing: Right click the field that requires suppressin (ex. WO_TOTCOST) and select Frmat Field. Click the Cmmn tab. Click the frmula bx next t Suppress. Duble click the ViewSecuredFields parameter frm the Reprt Fields. Then, type = 0. {?ViewSecuredFields} = 0 2. b. Field t shw Hidden Fr the wrd Hidden t shw up when the user des nt have rights t view the secure fields, d the fllwing: Right click in the field that requires suppressin (ex. WO_TOTCOST) and select Frmat Field. Click the Cmmn tab Click the frmula bx next t Display String. Type in: if {?ViewSecuredFields}= 0 then 'Hidden' else '$'& ttext({@wocst}) The {@WOCst} is the field that is being hidden r seen depending n security. Save and Clse. Then click OK Crystal Reprts fr Wrk Orders 6
It wuld be helpful t make a ntatin at the bttm f the reprt t explain why sme f the fields are Hidden. A Hidden field indicates permissin t view the secured field is turned ff. Adding a Cmments Sectin The Cmment tab within Wrk Orders and Requests is frmatted differently than the Cmment sectins in ther mdules. Fr this example, we ll add a Cmment subreprt t the Wrk Order Summary Reprt. 1. First, we ll find the field definitin fr the Wrk Order Cmment sectin. Open the Wrk Orders Standard mdule. Click n the Cmments tab. Right click in the grid. Select Add Cmment r View Details fr an existing cmment. Ctrl + right click in the large cmments bx t view the field definitin. Nte that the table name is WKGDMEMO and the field name is GM_MEMO. Clse the cmment dialg. Nte: This Cmment sectin des nt hit the WKMEMO table. Instead, it uses the WKGDMEMO table. 2. Open the Wrk Orders mdule s Reprt Dialg. 3. Exprt the WOSum.rpt reprt and rename it MS_WOSumCmment.rpt. Then, pen the renamed reprt. 4. Right click in the left margin f the Grup Fter 1a sectin and select Insert Sectin Belw. 5. Click Insert Subreprt. Type a name fr the subreprt (Cmment) in the New reprt name sectin. Click Reprt Wizard. 6. Open Create New Cnnectin>>ODBC>>GBAWrk001 (Finish)>>Tables. Mve the WKGDMEMO table t Selected Tables. Then, chse Finish and OK. 7. Insert the Cmment bx int the Grup Fter 1b sectin. 8. Chse subreprt frmatting ptins and resize the bx. Ntes: Crystal Reprts fr Wrk Orders 7
9. Next, right click within the Cmment bx and select Change Subreprt Links. Select fields s it lks like the fllwing: Click OK. 10. Duble click n the Cmment bx. Yu are nw in the Cmment subreprt. Click Select Expert and add the fllwing t the frmula: and {WKGDMEMO.GM_PARENT} = "WKORDER" This can be dne with the New tab. OR In the Frmula Editr > Frmula Wrkshp yu can type and, duble click the field, WKGDMEMO.GM_PARENT, type in =, and then right click n WKGDMEMO.GM_PARENT within the list f fields and click Brwse Data and select WKORDER, Paste Data. Select Save and Clse and then click OK. Nte: The frmula in Requests wuld lk like this: {WKGDMEMO.GM_PAR_ID} = {?Pm-WKREQ.RQ_ID} and {WKGDMEMO.GM_PARENT} = "WKREQ" 11. Add clumn titles. Yu ll want t make the titles bld and underlined in rder t make them distinct. Crystal Reprts fr Wrk Orders 8
12. Drag in the apprpriate fields. Yu ll need t create frmulas befre yu can add the Date and Time fields. 13. Increase the size f the GM_MEMO field and frmat it s it Can Grw. 14. Place a bx arund the Cmment subreprt t separate it frm the rest f the data. Make sure the bttm f the bx is in the Reprt Fter sectin s the bx will grw t accmmdate the Mem field if necessary. Add a title fr the bx (Cmments). Frmat the Cmments text bx with a white backgrund. 15. Click the Design tab. 16. Click the Sectin Expert buttn. Select Grup Fter1b and the Suppress Blank Sectin ptin. Select Grup Fter 1 and the Keep Tgether ptin. Then, click OK. Preview Ntes: Crystal Reprts fr Wrk Orders 9
Linking Linking Wrk Orders t Requests In ur first step-by-step example, we will link a Wrk Order subreprt t a Request reprt. 1. Exprt ReqSum.rpt and rename it MS_ReqSumLinks.rpt. 2. Open MS_ReqSumLinks.rpt. 3. Open the Database Expert. 4. Add the WKWOMWO table and link it t WKREQ. The cnnected fields usually have an ID field with a cmmn part; in this case, it is RQ. T link the tables, click n the jining field in the parent table and drag it nt the jining field in the cnnecting table. Duble click n the jining arrw and select the Left Outer Jin Link Optin. Click OK and then click OK again. 5. Add a Detail sectin fr the Wrk Orders subreprt. Crystal Reprts fr Wrk Orders 10
6. Create a subreprt (Linked Wrk Orders). Fr the Selected Tables, bring in WKORDER and WKWOMWO. Select Next and link the tables. Left Outer Jin. Click Finish and then click OK. The parent table will be the table that is linked t the main reprt. 7. Place the subreprt in the new Details sectin. 8. Select the frmatting ptins and resize the subreprt. Ntes: Crystal Reprts fr Wrk Orders 11
9. Right click in the Linked Wrk Orders subreprt bx and select Change Subreprt Links. Set up as shwn belw: 10. Open the Linked Wrk Orders subreprt. Set up the subreprt with the desired infrmatin. Open the Sectin Expert in the main reprt and select Suppress Blank Sectin fr the subreprt Detail sectin. 11. Preview the reprt. Crystal Reprts fr Wrk Orders 12
12. In ur example, there is an extra space abve the first Wrk Order recrd. One way t remve this space is t g back int the Linked Wrk Orders subreprt Select Expert and add a statement fr Wrk Order IDs greater than zer. {WKWOMWO.MW_MW_ID} = {?Pm-WKWOMWO.MW_MW_ID} and {WKORDER.WO_ID} > 0 As yu can see in the Preview screen belw, this additinal statement has remved the blank space frm abve the first Wrk Order recrd. Linking Requests t Requests Fr ur next example, we ll cntinue with MS_ReqSumLinks.rpt frm abve. Here, we ll add the linked Requests. 1. Add a Detail sectin beneath the Linked Wrk Orders subreprt. 2. Insert a subreprt named Linked Requests. Fr the Selected Tables bring in WKWOMWO and WKREQ. Link as fllws: Place the subreprt in the newly created Detail sectin, select frmatting ptins, and resize. Crystal Reprts fr Wrk Orders 13
3. Right click n the Linked Requests subreprt and select Change Subreprt Links. Set up as shwn belw: Yu d nt want t shw the request yu are in when listing linked requests, s an additinal linking statement needs t be added. 4. Open the Linked Requests subreprt and click Select Expert. Crystal Reprts fr Wrk Orders 14
5. Yu ll need t mdify ne f the linking frmulas created in Subreprt Links. {WKWOMWO.MW_MW_ID} = {?Pm-WKREQ.RQ_MW_ID} and {WKREQ.RQ_ID} = {?Pm-WKREQ.RQ_ID} Change the secnd frmula t nt equal. Yu can d this in the Frmula Wrkshp by highlighting the = and then pening Operatrs>>Cmparisns and duble clicking Nt Equal (x<>y). OR Yu can just type in <>. The = will be replaced with <>. Remember t Save and Clse the Frmula Wrkshp and select OK t clse the Select Expert. The new frmula will appear as fllws: {WKWOMWO.MW_MW_ID} = {?Pm-WKREQ.RQ_MW_ID} and {WKREQ.RQ_ID} <> {?Pm-WKREQ.RQ_ID} 6. Set up the subreprt with the desired infrmatin. 7. G back t the main reprt and pen Sectin Expert. Select Suppress Blank Sectin fr this new Detail sectin. Preview Ntes: Crystal Reprts fr Wrk Orders 15
Linking Requests t Wrk Orders The prcedure fr adding the linked subreprts is very similar t the abve examples. In this case, we ll add a Linked Requests subreprt t the Wrk Order Summary Reprt. 1. Exprt WOSum.rpt and rename it MS_WOSumLinks.rpt. 2. Open MS_WOSumLinks.rpt. 3. Open Database Expert and add the WKWOMWO table, linking it t WKORDER. 4. Add an additinal Grup fter sectin beneath GF1a. This will be the new GF1b. Ntes: Crystal Reprts fr Wrk Orders 16
5. Create a subreprt named Linked Requests with the WKWOMWO and WKREQ tables. 6. Insert the Linked Requests subreprt int the new GF1b sectin. 7. Right click n the subreprt and select Change Subreprt Links. 8. Prceed with the subreprt details as previusly demnstrated. Crystal Reprts fr Wrk Orders 17
Linking Wrk Orders t Wrk Orders We will cntinue with the pen MS_WOSumLinks.rpt reprt and add a secnd subreprt, Linked Wrk Orders. 1. Add a new Grup Fter sectin. 2. Create a new subreprt named Linked Wrk Orders and bring in the WKWOMWO and WKORDER tables. 3. Place the Linked Wrk Orders subreprt in the new Grup Fter sectin. Ntes: Crystal Reprts fr Wrk Orders 18
4. Right click n the subreprt and select Change Subreprt Links. AND 5. Open the Linked Wrk Orders subreprt and click Select Expert. 6. Change the frmula as discussed previusly. {WKWOMWO.MW_MW_ID} = {?Pm-WKORDER.WO_MW_ID} and {WKORDER.WO_ID} <> {?Pm-WKORDER.WO_ID} 7. Prceed with the subreprt details. Crystal Reprts fr Wrk Orders 19
Using Wrk Order Asset Inventry Numbers Yu can use the Asset number fr recrd selectin. By adding a frmula in the Select Expert sectin, yu can limit recrds t the desired assets. Additinally, yu can use the Asset number fr select suppressin The fllwing Asset values are required t create any frmulas that wuld select specific Assets. Nte: These Assets cme frm the WKCATINV table. Crystal Reprts fr Wrk Orders 20
Limiting Recrd Selectin t Specific Assets We will create a Wrk Order Summary Reprt that will shw nly Sewer Pipe and Manhle recrds with their assets. 1. Exprt the WOSum.rpt reprt and rename it MS_WOSumPipeMan.rpt. 2. Yu can view just Sewer Pipe and Manhle recrds by adding the fllwing frmula: Open Select Expert. Click OK. Click OK. The 6 (Sewer Pipe) and 2 (Sewer Structure) values cme frm the WKCATINV table n the previus page. OR Yu can click Reprt>>Selectin frmulas>>recrd. Type in the fllwing frmula: {WKORDER.WO_INV_ID} in [2, 6] Crystal Reprts fr Wrk Orders 21
Preview As yu can see in the abve example, the Wrk Order Summary Reprt displays nly the Sewer Pipe and Manhle recrds. Asset Subreprts We will nw add Asset subreprts t the limited Wrk Order Summary Reprt we created abve. 1. We are ging t brrw subreprts frm WOFrmSewerAsset.rpt. Click File in the tp tl bar, then Open, and then duble click WOFrmSewerAsset.rpt. Right click n the SWPipe.rpt subreprt. Select Save Subreprt As. Enter a name fr yur subreprt (SWPipeSub.rpt) and then Save the subreprt. Repeat these steps fr the SWStruc.rpt subreprt, giving it a new name as well. Fr example, we ve named this subreprt, SWStrucSub.rpt. Nte: When yu are finished with these subreprts, yu may want t delete them frm yur family f Wrk reprts. This will help avid cnfusin in the future. 2. Clse WOFrmSewerAsset.rpt by clicking n the X in the tab. 3. Yu are back in MS_WOSumPipeMan.rpt. Insert tw new Grup Fter sectins. 4. In yur new Grup Fter sectins, insert the tw subreprts using the Chse an existing reprt ptin. 5. Chse the subreprt frmatting ptins. Remember t suppress the blank subreprts within frmatting and in the Sectin Expert. Ntes: Crystal Reprts fr Wrk Orders 22
6. Link the subreprts. 7. Within the subreprts, remve the blank sectins. 8. Remve the ld linking frmula in each subreprt s Select Expert. Ntes: Crystal Reprts fr Wrk Orders 23
Preview 9. As yu can see in the reprt Preview, the nrmal subreprt suppressin ptins are nt wrking here. Fr this Wrk Order Summary Reprt, the Sewer Structure subreprt needs t be suppressed. Subreprts can be suppressed using the Sectin Expert Suppress (N Drill-Dwn) ptin. Select Sectin Expert. Fr Grup Fter #1, click Keep Tgether. Fr the Sewer Pipe subreprt, Grup Fter 1b, click the frmula buttn next t Suppress (N Drill-Dwn). Enter the fllwing frmula: {WKORDER.WO_INV_ID} <> 6 Fr the Sewer Structure subreprt, Grup Fter 1c, click the frmula buttn next t Suppress (N Drill-Dwn). Enter the fllwing frmula. {WKORDER.WO_INV_ID} <> 2 Ntes: Crystal Reprts fr Wrk Orders 24
Preview Bringing in Asset Wrk Orders with Cmment In a Wrk Order reprt with Assets, it is smetimes desirable t see all f the Wrk Orders assciated with the Assets. A subreprt is added with the fllwing tables and internal links: The WKWOASSET table is brught in twice then linked with inner jins. The WKORDER table is a left uter jin. Ntes: Crystal Reprts fr Wrk Orders 25
The subreprt is linked t the main reprt as fllws: The Select Expert, in additin t the linking frmula, is given an additinal statement s the list f WOs des nt include the current WO. {WKWOASSET.AS_WO_ID} = {?Pm-WKORDER.WO_ID} and {WKORDER.WO_ID} <> {?Pm-WKORDER.WO_ID} The subreprt in this example lks like this: The gruping is n the Asset AS_LINK1 field. If there are multiple assets n the wrk rder they will shw up with the crrect Asset. The Wrk Order Cmment is shwn by bringing in the WKGDMEMO table then linking t the WKORDER table. The GM_MEMO field is placed in the reprt and then in the field Frmat Editr, Cmmn tab, within in the Suppress frmula buttn is the fllwing frmula: {WKGDMEMO.GM_PARENT}<>"WKORDER" Crystal Reprts fr Wrk Orders 26
Wrk Order Summary Reprts and Filters If yu have a mdule that allws yu t filter n a field that is in a grid with multiple recrds and yu plan n running a reprt (withut grupings) with this field as a filter, then the reprt may have sme issues. If yu have a field yu wish t summarize, yu need t set it up with grupings and variables. Fr example, in a Wrk Order reprt where the fields have been placed in the Detail sectin withut Gruping - the fllwing culd ccur: Filter n a grid field that has multiple values and run the reprt against this filter and see what the numbers d. Resurce = 1 (emplyee) is a gd ne. Lucity passes t Crystal the fllwing statement. {WKRESRCE.WR_RTYP_CD} = 1 This can be fund in the filter screen when yu click Advanced. Then click n the Reprt SQL tab. This will shw yu what is being sent t the reprt. When the reprt runs, it lks at the recrd every time the statement is true. If a reprt had three emplyees then it wuld hit the recrd three times. Crystal Reprts fr Wrk Orders 27
In WO# 2006-01128 there are tw emplyees s when the reprt is run with a resurce filter the WO line shws up twice. If the infrmatin being summarized is in the WKORDER table then gruping n the WO_NUMBER and setting up variables shuld be sufficient. If yu are summarizing a field within Task r Resurces yu will need t further grup and add mre variables. Using Variables in a Reprt The riginal Wrk Order Categry Summary reprt lked like this: It was a very simple reprt which gruped n Categry and used the Crystal Summary tl t calculate the Grup Ttal and Grand Ttal. This wrked fine if run withut filters. There were certain filters that caused duplicate Wrk Order csts. The prblem filters are the fields that cme frm grid data. In the Wrk Order mdule these wuld include Lcatin, Assets, Tasks and Resurces. This ccurs because f the filter statement being passed frm Lucity t Crystal. If there are tw Tasks n a Wrk Order that are true fr a Task filter being run then the reprt will run the recrd twice. T crrect this issue we used gruping and variables. Open WOCatSum.rpt and fllw the steps used t crrect the reprt: 1. Added a secnd gruping n the Wrk Order Number, WO_NUMBER. 2. Created a frmula fr the Wrk Order Cst (WOCst) and placed it in the WO Number Grup Fter 2. WhilePrintingRecrds; Shared numbervar WOCst ; WOCst:={WKORDER.WO_TOTCOST} 3. Created a frmula t summarize the cst fr the Categry (WOCstTt). Added a new sectin belw the WO Number Grup Fter 2. This is a secnd Grup Fter (GF2b) fr this sectin. Place this new frmula in this sectin. WhilePrintingRecrds; Shared numbervar WOCstTt ; Shared numbervar WOCst ; WOCstTt:= WOCstTt + WOCst Crystal Reprts fr Wrk Orders 28
4. Created a frmula t summarize the ttal cst fr the Wrk Orders (TtSum). This was placed in GF2b. WhilePrintingRecrds; Shared numbervar GrWOCst ; Shared numbervar WOCst ; GrWOCst:= GrWOCst + WOCst 5. Created a frmula t Zer the Wrk Order cst variable (ZerWO). Placed this in the WO Number Grup Header #2. Shared numbervar WOCst :=0; 6. Created a frmula t Zer the Categry Cst (Zer). Placed this in the Categry Grup Header #1. Shared numbervar WOCstTt :=0 ; Shared numbervar WOCst :=0; 7. Created a frmula t shw the Categry ttal cst (TaskTt). Placed this in the Categry Grup Fter #1. WhilePrintingRecrds; Shared numbervar WOCstTt ; WOCstTt 8. Created a frmula t shw the Grand ttal cst (Ttal). Placed this in the Reprt Fter. WhilePrintingRecrds; Shared numbervar GrWOCst ; GrWOCst Suppressed the new Grup Header and Fter sectins. Crystal Reprts fr Wrk Orders 29
Secured Fields in Subreprts When yu add the simple ViewSecuredFields parameter frmula t a field frmat in a subreprt, it des nt carry ver t the main reprt withut first asking fr the security f the subreprt. This defeats the purpse f security. The subreprt shuld be respnding t the Lucity Security setup. The main bdy f the reprt needs t cmmunicate with the subreprt. This requires the use f variables. We will lk at the Wrk Order Detail reprt and see hw security was added t the cst fields in the Task/Resurce subreprt. 1. First, we used a shared variable called Security. It was declared in bth the reprt and subreprt. Open MS_WODetail.rpt. The ViewSecuredFields parameter was created. Fr additinal infrmatin, please refer t the related wrkbk, Beginning Crystal 2. A new frmula was created called Security t declare the variable. Shared NumberVar Security := {?ViewSecuredFields}; 2. The new Security frmula was placed int the Reprt Header sectin. The field size was reduced and the field text frmatted t have white fnt. This ensured that the frmula was nt visible in the reprt. 3. In the TaskRes.rpt subreprt a new frmula called SecuritySub was created. Once again, the Security variable was declared. Shared NumberVar Security; The frmula was dragged int the suppressed Reprt Header. 4. There are fur fields set up t shw Hidden if the user des nt have prper security. See the Beginning Crystal 2 handbk t see hw the fields were set up. Ntes: Crystal Reprts fr Wrk Orders 30
Mre n Variables Passing infrmatin frm a subreprt t the main reprt Let s create a reprt that shws the number f Requests and Wrk Orders fr each Request Prblem type. The number f Requests is straightfrward enugh with the use f a Running Ttal field. The number f Wrk Orders gets a little trickier because Wrk Orders are attached t Requests thrugh a grid and thus need t be brught int the reprt as a subreprt. Infrmatin frm a subreprt t a parent reprt can be dne by using variables. 2. Create a new Wrk Reprt and name it MS_ReqSumRQWO. 3. Bring in the WKREQ table. Bring in the Prblem field and the Request Number: 4. Grup by Prblem Type. Mve the Prblem field t the Grup Fter. 5. Add a Number f Requests clumn title. Then, create a Distinct Cunt f the Request Numbers fr each Prblem Type and place it under the clumn header in the Grup Fter sectin. 6. Add a Ttal text in the Reprt Fter. Then put in a Distinct Cunt f the Request Numbers int the Reprt Fter. 7. Add the WKWOMWO table in the Database Expert and link as shwn in the related wrkbk, Advanced Examples 2. 8. Create a Wrk Order subreprt with the WKORDER and the WKWOMWO tables and place it in the Detail sectin. Link as shwn in the Advanced Examples 2 wrkbk. 9. In the subreprt, drag the WO_Number field int the Detail sectin. Create ne frmula (WOCunt): WhilePrintingRecrds; Shared numbervar WOCunt; WOCunt :=DistinctCunt({WKORDER.WO_NUMBER}) Crystal Reprts fr Wrk Orders 31
Place the frmula and the WO_NUMBER field as fllws and suppress the subreprt sectins. This subreprt is cunting the Wrk Orders fr each Request. WOCunt is a shared variable that is available t the main reprt. 10. In the main reprt, create five frmulas: Zer WhilePrintingRecrds; Shared numbervar WOCunt :=0; Shared numbervar PrbWOCunt :=0 ; WOCunt (The shared variable WOCunt is being passed in frm the subreprt) WhilePrintingRecrds; Shared numbervar WOCunt; WOCunt WOSum (WOCunt is being summed t calculate the Prblem Ttal fr Wrk Orders and the Grand Ttal fr Wrk Orders.) WhilePrintingRecrds; Shared numbervar WOCunt ; Shared numbervar PrbWOCunt ; Shared NumberVar GrTtWOCunt; PrbWOCunt:=PrbWOCunt + WOCunt; GrTtWOCunt:=GrTtWOCunt + WOCunt; PrbTt WhilePrintingRecrds; Shared numbervar PrbWOCunt ; PrbWOCunt TtalWO WhilePrintingRecrds; Shared numbervar GrTtWOCunt ; GrTtWOCunt Crystal Reprts fr Wrk Orders 32
11. Add anther Detail sectin. 12. Create a clumn header, Number f Wrk Orders, and place the frmulas as fllws: 13. In Sectin Expert, make sure yu select Suppress Blank Sectin fr the Detail sectin with the Wrk Order subreprt. Suppress sectins as fllws: Preview Ntes: Crystal Reprts fr Wrk Orders 33
WO Subtask Infrmatin t Assets The Wrk mdule nw allws Subtasks t be assigned t specific Assets. In rder t shw these relatinships in a reprt, sme fairly dd table linkings are required. This seemingly simple ne line reprt tk nine grupings and tw subreprts t get t the infrmatin. Ntes: Crystal Reprts fr Wrk Orders 34
Smething new in Lucity versin 7.4 is the availability f the WKTSKAST and WKWOTSK tables in the list f synnym tables. This will allw the additin f subtasks when creating reprts fr the varius inventry items. This t had sme interesting table linkings: This reprt had five grupings and three subreprts t assist the infrmatin ut f the tables and int the reprt. If yu are interested in creating a reprt with this subtask infrmatin, cntact the Lucity Help Desk and we can help step yu thrugh the prcess. The infrmatin is there; smetimes it is challenging t get it ut. Ntes: Crystal Reprts fr Wrk Orders 35