Class ReportAgent
Facade for the Report Agent Run reports, set favourites, labels
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
public class ReportAgent : AgentBase<IReportAgent>, IDisposable, IReportAgent, IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ReportAgent agent = new ReportAgent())
{
// call methods on agent here...
}
}
Constructors
ReportAgent()
Facade for the Report Agent Run reports, set favourites, labels
Declaration
public ReportAgent()
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ReportAgent agent = new ReportAgent())
{
// call methods on agent here...
}
}
Methods
CreateDefaultReportEntity()
Loading default values into a new ReportEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public ReportEntity CreateDefaultReportEntity()
Returns
Type | Description |
---|---|
ReportEntity | New ReportEntity with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ReportAgent agent = new ReportAgent())
{
// call methods on agent here...
}
}
CreateDefaultReportLabelLayoutEntity()
Loading default values into a new ReportLabelLayoutEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public ReportLabelLayoutEntity CreateDefaultReportLabelLayoutEntity()
Returns
Type | Description |
---|---|
ReportLabelLayoutEntity | New ReportLabelLayoutEntity with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ReportAgent agent = new ReportAgent())
{
// call methods on agent here...
}
}
CreateFavorite(Int32, String, String)
Creates the report as favorite. The sourceId is the key to the report that the favorite is based on.
Declaration
public ReportEntity CreateFavorite(int sourceId, string name, string description)
Parameters
Type | Name | Description |
---|---|---|
Int32 | sourceId | The primary key to the report to make the favorite from. |
String | name | The name of the new favorite. |
String | description | The description of the new favorite. |
Returns
Type | Description |
---|---|
ReportEntity | The new favorite ReportEntity. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ReportAgent agent = new ReportAgent())
{
// call methods on agent here...
}
}
DeleteFavorite(Int32)
Deletes the report favorite.
Declaration
public void DeleteFavorite(int reportEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | reportEntityId | The id of the report favorite to delete. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ReportAgent agent = new ReportAgent())
{
// call methods on agent here...
}
}
DeleteReport(Int32)
Delete the report with the given id
Declaration
public bool DeleteReport(int reportId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | reportId | The id of the report to delete |
Returns
Type | Description |
---|---|
Boolean | Delete ok? |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ReportAgent agent = new ReportAgent())
{
// call methods on agent here...
}
}
DeleteReportLabelLayoutEntity(Int32)
Deletes the ReportLabelLayoutEntity
Declaration
public void DeleteReportLabelLayoutEntity(int reportLabelLayoutEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | reportLabelLayoutEntityId | The identity of the ReportLabelLayoutEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ReportAgent agent = new ReportAgent())
{
// call methods on agent here...
}
}
GenerateReport(Int32, Int32, String, String, String, ArchiveRestrictionInfo[])
Generates the report in PDF format
Declaration
public string GenerateReport(int reportId, int labelLayoutId, string filename, string language, string fileType, ArchiveRestrictionInfo[] restrictions)
Parameters
Type | Name | Description |
---|---|---|
Int32 | reportId | The id of the report. |
Int32 | labelLayoutId | The id of the labellayout. 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 | |
ArchiveRestrictionInfo[] | restrictions | Use restrictions to provide additional restrictions when generating the report. |
Returns
Type | Description |
---|---|
String | Batch task id, as string. Used to be path to the generated report, but no more. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ReportAgent agent = new ReportAgent())
{
// call methods on agent here...
}
}
GetReportEntity(Int32)
Gets a ReportEntity object.
Declaration
public ReportEntity GetReportEntity(int reportEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | reportEntityId | The identifier of the ReportEntity object |
Returns
Type | Description |
---|---|
ReportEntity | ReportEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ReportAgent agent = new ReportAgent())
{
// call methods on agent here...
}
}
GetReportLabelLayoutEntity(Int32)
Gets a ReportLabelLayoutEntity object.
Declaration
public ReportLabelLayoutEntity GetReportLabelLayoutEntity(int reportLabelLayoutEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | reportLabelLayoutEntityId | The identifier of the ReportLabelLayoutEntity object |
Returns
Type | Description |
---|---|
ReportLabelLayoutEntity | ReportLabelLayoutEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ReportAgent agent = new ReportAgent())
{
// call methods on agent here...
}
}
ImportReport(String)
Takes the input stream and create a report. This stream must be on a valid xml format
Declaration
public int ImportReport(string report)
Parameters
Type | Name | Description |
---|---|---|
String | report | The report to import in a correct xml format |
Returns
Type | Description |
---|---|
Int32 | The id of the newly imported report |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ReportAgent agent = new ReportAgent())
{
// call methods on agent here...
}
}
SaveReportEntity(ReportEntity)
Updates the existing ReportEntity or creates a new ReportEntity if the id parameter is empty
Declaration
public ReportEntity SaveReportEntity(ReportEntity reportEntity)
Parameters
Type | Name | Description |
---|---|---|
ReportEntity | reportEntity | The ReportEntity that is saved. |
Returns
Type | Description |
---|---|
ReportEntity | New or updated ReportEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ReportAgent agent = new ReportAgent())
{
// call methods on agent here...
}
}
SaveReportLabelLayoutEntity(ReportLabelLayoutEntity)
Updates the existing ReportLabelLayoutEntity or creates a new ReportLabelLayoutEntity if the id parameter is empty
Declaration
public ReportLabelLayoutEntity SaveReportLabelLayoutEntity(ReportLabelLayoutEntity reportLabelLayoutEntity)
Parameters
Type | Name | Description |
---|---|---|
ReportLabelLayoutEntity | reportLabelLayoutEntity | The ReportLabelLayoutEntity that is saved. |
Returns
Type | Description |
---|---|
ReportLabelLayoutEntity | New or updated ReportLabelLayoutEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ReportAgent agent = new ReportAgent())
{
// call methods on agent here...
}
}
UpdateFavorite(ReportEntity)
Updates the favorite.
Declaration
public ReportEntity UpdateFavorite(ReportEntity reportEntity)
Parameters
Type | Name | Description |
---|---|---|
ReportEntity | reportEntity | ReportEntity carrier containg updated data. |
Returns
Type | Description |
---|---|
ReportEntity | The updated ReportEntity carrier. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ReportAgent agent = new ReportAgent())
{
// call methods on agent here...
}
}