Class NSReportAgent
Run reports, set favorites, labels.
Syntax
Examples
NSReportAgent agent;
agent.callMethod(arg1, arg2);
Constructors
NSReportAgent()
Run reports, set favorites, labels.
Declaration
NSReportAgent
Examples
NSReportAgent agent;
agent.callMethod(arg1, arg2);
Methods
CreateDefaultReportEntity()
Sets default values into a new NSReportEntity.
Declaration
NSReportEntity CreateDefaultReportEntity()
Returns
| Type | Description |
|---|---|
| NSReportEntity |
Remarks
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Examples
NSReportAgent agent;
NSReportEntity thing = agent.CreateDefaultReportEntity();
thing = agent.SaveReportEntity(thing);
CreateDefaultReportLabelLayoutEntity()
Sets default values into a new NSReportLabelLayoutEntity.
Declaration
NSReportLabelLayoutEntity CreateDefaultReportLabelLayoutEntity()
Returns
| Type | Description |
|---|---|
| NSReportLabelLayoutEntity |
Remarks
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Examples
NSReportAgent agent;
NSReportLabelLayoutEntity thing = agent.CreateDefaultReportLabelLayoutEntity();
thing = agent.SaveReportLabelLayoutEntity(thing);
CreateFavorite(Integer,String,String)
Creates the report as favorite.
Declaration
NSReportEntity CreateFavorite(Integer sourceId, String name, String description)
Parameters
| Type | Name | Description |
|---|---|---|
| Integer | sourceId | The key to the report that the favorite is based on. |
| String | name | |
| String | description |
Returns
| Type | Description |
|---|---|
| NSReportEntity |
Examples
NSReportAgent agent;
Integer sourceId;
String name;
String description;
NSReportEntity res = agent.CreateFavorite(sourceId, name, description);
DeleteFavorite(Integer)
Deletes the report favorite.
Declaration
Void DeleteFavorite(Integer reportEntityId)
Parameters
| Type | Name | Description |
|---|---|---|
| Integer | reportEntityId |
Returns
| Type | Description |
|---|---|
| Void |
Examples
NSReportAgent agent;
agent.callMethod(arg1, arg2);
DeleteReport(Integer)
Deletes the report with the given ID.
Declaration
Bool DeleteReport(Integer reportId)
Parameters
| Type | Name | Description |
|---|---|---|
| Integer | reportId | The ID of the report to delete. |
Returns
| Type | Description |
|---|---|
| Bool |
Examples
NSReportAgent agent;
Integer reportId;
Bool res = agent.DeleteReport(reportId);
DeleteReportLabelLayoutEntity(Integer)
Deletes the NSReportLabelLayoutEntity
Declaration
DeleteReportLabelLayoutEntity(Integer reportLabelLayoutEntity)
Parameters
| Type | Name | Description |
|---|---|---|
| Integer | reportLabelLayoutEntity | The identity of the ReportLabelLayoutEntity to delete. |
Returns
| Type | Description |
|---|---|
| Void |
Examples
NSReportAgent agent;
agent.DeleteReportLabelLayoutEntity(123);
GenerateReport(Integer,Integer,String,String,String,NSArchiveRestrictionInfo[])
Generates the report in PDF format.
Declaration
String GenerateReport(Integer reportId, Integer labelLayoutId, String filename, String language, String fileType, NSArchiveRestrictionInfo[] restrictions)
Parameters
| Type | Name | Description |
|---|---|---|
| Integer | reportId | The ID of the report. |
| Integer | labelLayoutId | The ID of the label layout. Use 0 if the report isn't of type label. |
| String | filename | Filename of the report. |
| String | language | Language to use when generating the report. |
| String | fileType | |
| restrictions | Use restrictions to provide additional restrictions when generating the report. |
Returns
| Type | Description |
|---|---|
| String |
Examples
NSReportAgent agent;
Integer reportId;
Integer labelLayoutId;
String filename;
String language;
String fileType;
NSArchiveRestrictionInfo[] restrictions;
String res = agent.GenerateReport(reportId, labelLayoutId, filename, language, fileType, restrictions);
GetReportEntity(Integer)
Gets an NSReportEntity object.
Declaration
NSReportEntity GetReportEntity(Integer reportEntityId)
Parameters
| Type | Name | Description |
|---|---|---|
| Integer | reportEntityId | The identifier of the NSReportEntity object. |
Returns
| Type | Description |
|---|---|
| NSReportEntity |
Examples
NSReportAgent agent;
NSReportEntity thing = agent.GetReportEntity(123);
GetReportLabelLayoutEntity(Integer)
Gets an NSReportLabelLayoutEntity object.
Declaration
NSReportLabelLayoutEntity GetReportLabelLayoutEntity(Integer reportLabelLayoutEntityId)
Parameters
| Type | Name | Description |
|---|---|---|
| Integer | reportLabelLayoutEntityId | The identifier of the NSReportLabelLayoutEntity object. |
Returns
| Type | Description |
|---|---|
| NSReportLabelLayoutEntity |
Examples
NSReportAgent agent;
NSReportLabelLayoutEntity thing = agent.GetReportLabelLayoutEntity(123);
ImportReport(String)
Takes the input stream and create a report. This stream must be on a valid XML format.
Declaration
Integer ImportReport(String report)
Parameters
| Type | Name | Description |
|---|---|---|
| String | report | The report to import in a correct XML format. |
Returns
| Type | Description |
|---|---|
| Integer |
Examples
NSReportAgent agent;
String report;
Integer res = agent.ImportReport(report);
SaveReportEntity(NSReportEntity)
Updates the existing NSReportEntity or creates a new NSReportEntity if the id parameter is 0
Declaration
NSReportEntity SaveReportEntity(NSReportEntity reportEntity)
Parameters
| Type | Name | Description |
|---|---|---|
| NSReportEntity | reportEntity | The NSReportEntity to save. |
Returns
| Type | Description |
|---|---|
| NSReportEntity |
Examples
NSReport agent;
NSReportEntity thing = agent.CreateDefaultReportEntity();
thing = agent.SaveReportEntity(thing);
SaveReportLabelLayoutEntity(NSReportLabelLayoutEntity)
Updates the existing NSReportLabelLayoutEntity or creates a new NSReportLabelLayoutEntity if the ID parameter is 0.
Declaration
NSReportLabelLayoutEntity SaveReportLabelLayoutEntity(NSReportLabelLayoutEntity reportLabelLayoutEntity)
Parameters
| Type | Name | Description |
|---|---|---|
| NSReportLabelLayoutEntity | reportLabelLayoutEntity |
Returns
| Type | Description |
|---|---|
| NSReportLabelLayoutEntity | The new or updated NSReportLabelLayoutEntity. |
Examples
NSReport agent;
NSReportLabelLayoutEntity thing = agent.CreateDefaultReportLabelLayoutEntity();
thing = agent.SaveReportLabelLayoutEntity(thing);
UpdateFavorite(NSReportEntity)
Updates the favorite.
Declaration
NSReportEntity UpdateFavorite(NSReportEntity reportEntity)
Parameters
| Type | Name | Description |
|---|---|---|
| NSReportEntity | reportEntity | ReportEntity carrier containing updated data. |
Returns
| Type | Description |
|---|---|
| NSReportEntity |
Examples
NSReportAgent agent;
NSReportEntity reportEntity;
NSReportEntity res = agent.UpdateFavorite(reportEntity);