The ERS 3.4 default Raw Data reports do not show any factor values in the report heading area. This is because the factor values should, in theory, be different for each row of the table, making it difficult to show any single value in the header. This White Paper will give step-by-step instructions for designing a custom template and adding the first Text and Numeric Factor values from the first record displayed to the header area of one of the standard Raw Data templates.
Identifying the Factor Location
In QC-CALC Real-Time, the data collection process assigns the factors to a specific location within the database and that location (there are locations 1 – 30 for Text Factors and also 1 – 30 for Numeric Factors) is used to reference those values everywhere within QC-CALC, QC-Gage, and SPC Office Buddy. The majority of ERS just shows the Factor Labels and no mention is made of the actual Factor Location. When it comes to the reports, those Factor Locations come back into play. Before the rest of the directions can be followed you will need to learn where the Factors you want to display are being stored. If you already know where your factors are stored based on the locations within QC-CALC, skip to The Report Designer section.
- From the Data View tab in ERS choose the Numeric Factors tab in the Grid Display Properties area in the bottom left corner of the screen.
- Find the Numeric Factor you want to add to your report and count from the top to find the corresponding number.
- Write down the number of any of the Factors you will be adding to your report. For these directions “Shift” (Numeric Factor 1) will be used.
- Follow the same directions on the Text Factors tab for any Text Factors.
The Report Designer
The directions shown here will add Numeric Factor 2 (Machine) to the header area of the report. This is a lengthy process, but relatively simple to accomplish.
- From ERS, choose the Report – Design Templates menu or the corresponding button in the Toolbar (circled in the picture below), then choose the “Raw Data Report (*.raw)” item in the lower right corner of the next screen that appears to narrow down the choices to just the Raw Data templates.
- Make a copy of the “RawDataReport.raw” file, give it a name that makes sense, highlight that new file in the list of files, and click Open.
- The Report Designer now appears on the screen.
- To start, we need to draw a Text box on the screen so there is somewhere to display the Factor values. To do this use the Objects > Insert > Text menu, then while the mouse is a large + sign click where you want the upper left of the box to be and drag down and to the right until you have a rectangle of the size you want as shown in red in the picture above.
- The Edit Text window is automatically displayed at this point so you can add the first line of text to the box.
- For the first line we are going to add the Text Factor 1 Label followed by the value.
- From the Variables and Functions tab area click the > next to section in the Variables list, scroll down until you find the “text_factor_label_01” item (it is a long way down in the list), and highlight that item.
- Now click the Insert button (or double-click the item in the list). The variable you chose will be automatically moved to the bottom window.
- Next, click on the Text tab and click the Tab button. This will automatically show the Tab Properties window.
- Choose left aligned, set the Position to 1.20, and click OK. This will set the tab to be 1.2 mm from the left side of the Text box that was drawn on the report.
- Back in the Edit Text screen, click the Insert button in the middle of the screen and this will add a “÷” (tab) to the line.
- At this point you will see a “Syntax error” at the bottom of the screen. This is because we need to join the 2 items (the Label and the tab character) together in a way the Report Designer recognizes. In order to tell the Report Designer to concatenate the 2 items a + needs to be added between them. Put the cursor right before the “÷” and add a + to the line as shown below.
- Before adding the factor value to the line another + needs to be added to join the new item to the existing ones. Put the cursor at the end of the line and add a +.
- To insert the actual Text Factor 1 value into the line, go back to the Variables and Functions tab, find the “text_factor_01” item in the list above where you found the label, and click the Insert button.
- The line should look like the one above when you have finished. Now click OK on the Edit Text window.
- Back in the main Report Designer screen you’ll now see an empty box if you are on the Layout Preview tab (shown in the picture in Step #3). Don’t worry, there will be values shown when you run the report, but at this time no values are being sent during the design process so the box appears empty.
- In my case the background of the box is pink. This is showing that this ended up as part of the “Table Layer” layer. This is not really the layer we want that box to appear on, so right-click on the box and choose the Assign to Layer menu.
- This box should only appear on the first page of the report, so choose the “First Page” layer in the Choose a Layer box.
- If you look in the Objects area in the upper left section (shown to the right) you’ll see the “[Text]” item shown at the bottom. This is referencing the text box we just created, but as you can see if you added a few text boxes it would be hard to tell them apart. To make life easier, we need to give that text box a name. Highlight that “[Text]” item in the Objects area, then look at the Properties area in the lower left corner and type “Information Box 2” into the Name box.
- The next step is to add Numeric Factor 1 to the same box. To do this, double-click the “Information Box 2” item in the Objects area and the Paragraph Properties window will appear.
- Each line in this window is the definition for a line in the box that will be printed on the report. You control the layout and font of these lines from this area.
- To add a new line at the bottom, double-click on the “---“ line in the window and the Edit Text window will appear again. You can also click the Insert a paragraph button circled in the picture, but the placement of the new line will vary depending on the line highlighted when using that method.
- Adding the Numeric Factor 1 line will be the same as what was done for the Text Factor 1 line, except we will also need to control the formatting of the number when adding the value portion. Follow steps 6 through 13 from above except add “num_factor_label_01”.
- At this point the screen should look like below:
- To format the Numeric Factor, put the cursor at the very end of the line (after the last +), open the Numerical functions section of the window, highlight the “FStr$” item, and click the Insert button.
- This will add the “FStr$” function to the line and leave the cursor exactly where we need it to be.
- Back in the Variables and Functions area, find the “num_factor_01” item in the list (above where you found the label) and click the Insert button.
- Next, move the cursor over 1 place (so it is on the right side of that next comma) and start typing the following (including the “): “######&”
- QC-CALC is only able store 7 digits, so there are enough places represented to hold a value that QC-CALC collected. If your number is not a whole number, then you can also add a decimal point and more # to the right to hold those characters. The & tells the report to print a 0 in that place if no value was received. The # will suppress leading 0s, so using all & should be done if you want a number like “002036” to be printed vs. “2036”. If you can have negative numbers replace all of the # with – (“------&” for example).
- Delete the remaining comma from the line and the error at the bottom of the screen should go away. The formula for this line should be:
section.num_factor_label_01+"÷"+Fstr$ (section.num_factor_01,"######&")
- Click OK on the Edit Text and Paragraph Properties windows.
- Click File – Save, then File – Exit to get out of the Report Designer.
- Now run your Raw Data report using the template you just changed.