Number of columns added to report definition
authorAlex Kirhenshtein <alk@netxms.org>
Mon, 1 Jul 2013 11:08:05 +0000 (11:08 +0000)
committerAlex Kirhenshtein <alk@netxms.org>
Mon, 1 Jul 2013 11:08:05 +0000 (11:08 +0000)
src/java/netxms-client-api/src/main/java/org/netxms/api/client/reporting/ReportDefinition.java
src/java/netxms-client/src/main/java/org/netxms/client/NXCSession.java

index 0982272..5408517 100644 (file)
@@ -8,6 +8,7 @@ public class ReportDefinition
 {
        private UUID id;
        private String name;
+       private int numberOfColumns = 1;
        private List<ReportParameter> parameters = new ArrayList<ReportParameter>(0);
 
        public UUID getId()
@@ -40,9 +41,27 @@ public class ReportDefinition
                parameters.add(parameter);
        }
 
+       public int getNumberOfColumns()
+       {
+               return numberOfColumns;
+       }
+
+       public void setNumberOfColumns(int numberOfColumns)
+       {
+               if (numberOfColumns > 0)
+               {
+                       this.numberOfColumns = numberOfColumns;
+               }
+               else
+               {
+                       this.numberOfColumns = 1;
+               }
+       }
+
        @Override
        public String toString()
        {
-               return "ReportDefinition [id=" + id + ", name=" + name + ", parameters=" + parameters + "]";
+               return "ReportDefinition [id=" + id + ", name=" + name + ", numberOfColumns=" + numberOfColumns + ", parameters="
+                               + parameters + "]";
        }
 }
index 5fde5e5..00d29d9 100644 (file)
@@ -6707,7 +6707,9 @@ public class NXCSession implements Session, ScriptLibraryManager, UserManager, S
                return new Table(response);\r
        }\r
 \r
-       /* (non-Javadoc)\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
         * @see org.netxms.api.client.reporting.ReportingServerManager#listReports()\r
         */\r
        @Override\r
@@ -6726,7 +6728,9 @@ public class NXCSession implements Session, ScriptLibraryManager, UserManager, S
                return ret;\r
        }\r
 \r
-       /* (non-Javadoc)\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
         * @see org.netxms.api.client.reporting.ReportingServerManager#getReportDefinition(java.util.UUID)\r
         */\r
        @Override\r
@@ -6740,6 +6744,7 @@ public class NXCSession implements Session, ScriptLibraryManager, UserManager, S
                final ReportDefinition definition = new ReportDefinition();\r
                definition.setId(reportId);\r
                definition.setName(response.getVariableAsString(NXCPCodes.VID_NAME));\r
+               definition.setNumberOfColumns(response.getVariableAsInteger(NXCPCodes.VID_NUM_COLUMNS));\r
                int count = response.getVariableAsInteger(NXCPCodes.VID_NUM_ITEMS);\r
                long base = NXCPCodes.VID_ROW_DATA_BASE;\r
                for(int i = 0; i < count; i++, base += 10)\r
@@ -6757,7 +6762,9 @@ public class NXCSession implements Session, ScriptLibraryManager, UserManager, S
                return definition;\r
        }\r
 \r
-       /* (non-Javadoc)\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
         * @see org.netxms.api.client.reporting.ReportingServerManager#executeReport(java.util.UUID, java.util.Map)\r
         */\r
        @Override\r
@@ -6777,7 +6784,9 @@ public class NXCSession implements Session, ScriptLibraryManager, UserManager, S
                return response.getVariableAsUUID(NXCPCodes.VID_JOB_ID);\r
        }\r
 \r
-       /* (non-Javadoc)\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
         * @see org.netxms.api.client.reporting.ReportingServerManager#listReportResults(java.util.UUID)\r
         */\r
        @Override\r
@@ -6800,7 +6809,9 @@ public class NXCSession implements Session, ScriptLibraryManager, UserManager, S
                return results;\r
        }\r
 \r
-       /* (non-Javadoc)\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
         * @see org.netxms.api.client.reporting.ReportingServerManager#deleteReportResult(java.util.UUID, java.util.UUID)\r
         */\r
        @Override\r
@@ -6813,8 +6824,11 @@ public class NXCSession implements Session, ScriptLibraryManager, UserManager, S
                waitForRCC(msg.getMessageId());\r
        }\r
 \r
-       /* (non-Javadoc)\r
-        * @see org.netxms.api.client.reporting.ReportingServerManager#renderReport(java.util.UUID, java.util.UUID, org.netxms.api.client.reporting.ReportRenderFormat)\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
+        * @see org.netxms.api.client.reporting.ReportingServerManager#renderReport(java.util.UUID, java.util.UUID,\r
+        * org.netxms.api.client.reporting.ReportRenderFormat)\r
         */\r
        @Override\r
        public File renderReport(UUID reportId, UUID jobId, ReportRenderFormat format) throws NetXMSClientException, IOException\r