- Nozzle Reports for AutoCAD Plant 3D
- Configuring a Nozzle Report for AutoCAD Plant 3D
Today’s article will continue where the last left off. Previously, we looked at how to add the Equipment Tag and Description fields to a nozzle. Today we will continue that by seeing how to configure a report to match our new fields.
The report creator is new in 2012, and it provides much more flexibility than the previous reporting engine in Plant 3D. One of the nicest features is that you can define the look, and then export the report to Excel, pdf or a several other formats and they all look the same.
I’ve included the report I created as a download.[Download id not defined]
First we will start off with an existing report, and create two calculated fields. Next we will group the items by the equipment tag and description, and then place the fields in the appropriate locations on the report. Last of all, we will configure styles and apply them to the labels and fields.
Here’s a snapshot of the final report.
Creating new Report
First open the project.xml for your project.
Click the drop down under Report Configuration and choose New.
Click From Existing report and select the EquipmentList, and click Ok.
Enter Nozzle list for the report Configuration name and click Save.
Click Edit Query.
Switch to Plant 3D classes, Expand Pipe Run Component and select Nozzles. Click the > button to move it to the included classes list.
*With some Windows font settings (150%), the buttons may not appear. Make sure you have installed the latest service packs to fix this issue or use the following workaround. You can go to Control Panel > Appearance and Personalization > Display and make sure that the Smaller or medium resolution resolution is selected.
Click Test Query results to see the data that will be available in the report, click Ok to accept the query changes.
Creating Calculated Fields
Click Edit Report Layout to bring up the Report Designer. The report designer is a powerful editing UI that functions much like the Microsoft Access Report designer…except a little better IMO.
First we are going to create a calculated field to combine our Equipment tag and description. Then we will create a calculated field to combine the nozzle length and nozzle cut length fields.
Switch to the Field List panel, right-click and select Add Calculated field.
In the property grid, change the name to EquipmentNameandDesc. Select the Expression row and click the Ellipses button.
To combine our two fields, we are going to use a function called Concat, short for concatenation.
Select Functions, the scroll in the middle panel and double-click Concat(). Notice the help hint in the right panel.
Next, select the Fields item from the left panel and find [Nozzle_Equipment Tag]. In the top box, put your cursor after the first parenthesis and then double-click Nozzle_Equipment Tag. Then type in “,‘ – ‘” making sure to use the single quote around the dash. Then put in the Nozzle_Equipment Description field after the last comma. The entire value will look like this:
Next add another calculated field, called NozzleLengths.
We’re going to use a more complicated expression to use a 0 if there is no value in one of the fields. You should be able to paste this expression in the Expression editor:
Concat(iif(IsNullOrEmpty([Nozzle_Length]),0,[Nozzle_Length]),’ / ‘,iif(IsNullOrEmpty([Nozzle_CutLength]),0,[Nozzle_CutLength]))
We use the Concat function again. This time though we use an iif statement which lets us say, if Nozzle_Length is blank (IsNullOrEmpty), put in a 0, otherwise put in the Nozzle Length value. We then add a slash and repeat the iif statement on the Nozzle_CutLength field.
We want a list of nozzle under each piece of equipment, so we are going to use the grouping functionality. Click Add a Group and select EquipmentNameandDesc.
From our Field list panel, drag and drop the EquipmentNameandDesc on the the Group Header one page.
In the Detail section, drag and drop the PipeRunComponent_Tag field. In the second column, drop the EngineeringItems_PartSizeLongDescription field.
Delete the model number detail field by right-clicking on it, selecting Delete and then Cell.
Drag and drop EngineeringItems_DesignStd onto the third field. The last two fields will be our NozzleLengths field and the Nozzle_CutbackAngle field.
You can hover over the vertical bars in the table and click to drag them to a different spot. Edit the column names and adjust/align them with the detail columns.
Right now, the preview looks pretty rough (Print Preview tab), but we have all the necessary fields in place.
Configuring the Look
One of the best features of the report designer is that we can work with styles. Styles are a way of setting the appearance for items that appear in the report.
Drag a label onto the report and place it at the left of the GroupHeader1 section. Change the value for the label to “Equipment:”. Select the label and find the Styles property in the Property Grid. Select it, and then click the expand button.
You should see the styles editor come up.
The styles have not be setup to match the current report content. The title of the report (Equipmentlist) is in the font Tahoma. We will change all of the styles to match that font. Also, we are going to turn off all the borders (color = transparent or width = 0) and set the text alignment to center for the DataField and FieldCaption styles. Last, the foreground color should be black for all the styles.
You can assign the style to an object by selecting the object, going to the property grid, expand the style and then select the style.
For the fields that shouldn’t be middle center, you can override them by scrolling down and setting the alignment manually.
Once we have adjusted our fields, and cleaned up the appearance our report preview looks much better.