Generate quantities report for a group of sample lines.
Namespace: Autodesk.Civil.DatabaseServicesAssembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.2.3892.0
Syntax
C#
public static void ReportQuantities( ObjectId sampleLineGroupId, string materialList, string reportFile, string styleSheetFile )
Visual Basic
Public Shared Sub ReportQuantities ( _ sampleLineGroupId As ObjectId, _ materialList As String, _ reportFile As String, _ styleSheetFile As String _ )
Visual C++
public: static void ReportQuantities( ObjectId sampleLineGroupId, String^ materialList, String^ reportFile, String^ styleSheetFile )
Parameters
- sampleLineGroupId
- Type: ObjectId
The ObjectId of sample line group.
- materialList
- Type: System.String
Name of the matiernal list to report quantities.
- reportFile
- Type: System.String
Name of the report (XML) file.
- styleSheetFile
- Type: System.String
Name of the style sheet (XSL) file. (Optional) If present, the XML report will contain a processing instruction for the style sheet specified by styleSheetFile. Otherwise (null or empty), the XML report won't have processing instruction for style sheet.
Examples
This example shows how to create quantities report for a sample line group.
CopyC#
1// Assume all referenced objects are available in current document. 2 3// 'alignment' is an Alignment object opened for read. 4var allSlgOids = alignment.GetSampleLineGroupIds(); 5ObjectId oidSlg = allSlgOids[0]; 6 7SampleLineGroup slg = oidSlg.GetObject(OpenMode.ForRead) as SampleLineGroup; 8string[] mappingNams = slg.GetQTOMappingNames(); 9 10// Plain XML report. 11SampleLineGroup.ReportQuantities(oidSlg, mappingNams[0], "report-01.xml", ""); 12 13// Report with style sheet. 14SampleLineGroup.ReportQuantities(oidSlg, mappingNams[0], "report-02.xml", "style.xsl");
Exceptions
| Exception | Condition |
|---|---|
| System.ArgumentException | Thrown when sampleLineGroup is not valid, or null/empty value passed in for materialList or reportFile. |
| [!:System.Runtime.InteropServices::COMException] | Thrown when error occurs during XML generation and save. |