Table of Contents

Class reportws

Namespace
PHCWS
Assembly
PHCWS.dll

url = urlBase."/REST/reportws/".

[WebService(Namespace = "http://www.phcgo.net/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[DesignerGenerated]
public class reportws : PHCTypedWS<BaseReportVO>, IComponent, IDisposable, IServiceProvider
Inheritance
reportws

Methods

GetEntityFields(string, string)

[WebMethod]
public PHCResult GetEntityFields(string searchTerm, string entity)

Parameters

Nome Tipo Descrição
searchTerm string
entity string

Returns

PHCResult

SaveImage(ImageInfoVO, byte[])

Grava uma imagem, representada pela entidade IFL.

[WebMethod]
public PHCResult SaveImage(ImageInfoVO image, byte[] byteArray)

Parameters

Nome Tipo Descrição
image ImageInfoVO

Contém a path da imagem a gravar.

byteArray byte[]

Contém o ficheiro propriamente dito que corresponde à imagem.

Returns

PHCResult

PHCResult containing the ImageInfoVO recorded in the database and / or errors returned by the database engine that may have been generated in the recording process.

Remarks

Record an image, represented by the entity IFL and identifies source as REP.

SearchImages(string, string)

Consult a list of images.

[WebMethod]
public PHCResult SearchImages(string name, string stamp)

Parameters

Nome Tipo Descrição
name string

Contains the value to search for in the field descricao of ImageInfoVO.

stamp string

Contains the value to search for in the field iflstamp of ImageInfoVO.

Returns

PHCResult

PHCResult containing a list of ImageInfoVO with thumbnail images.

Remarks

Consult a list of the type images ImageInfoVO.

UpdateInternalStatus(string, bool)

Changes a the property isReadOnly the report of the value of the given status.

[WebMethod]
public PHCResult UpdateInternalStatus(string stamp, bool status)

Parameters

Nome Tipo Descrição
stamp string

Indicates the entity's stamp.

status bool

Indicates whether the report should be enabled or not.

Returns

PHCResult

PHCResult containing the updated report.

UpdateName(string, string)

Altera a propriedade reportname do relatório para o valor do status fornecido.

[WebMethod]
public PHCResult UpdateName(string stamp, string name)

Parameters

Nome Tipo Descrição
stamp string

Indicates the entity's stamp.

name string

Indicates the entity's name.

Returns

PHCResult

PHCResult containing the updated report.

UpdateReportGama(string, int)

Changes the range for which the report is available for the given range of value.

[WebMethod]
public PHCResult UpdateReportGama(string stamp, int gama)

Parameters

Nome Tipo Descrição
stamp string

Indicates the entity's stamp.

gama int

Indicates the edition from which the report should be available.

Returns

PHCResult

PHCResult containing the updated report.

UpdateReportStatus(string, bool)

Change value of status report.

[WebMethod]
public PHCResult UpdateReportStatus(string stamp, bool status)

Parameters

Nome Tipo Descrição
stamp string

Indica o stamp da entidade.

status bool

Indica se o relatório deverá ficar activo ou não.

Returns

PHCResult

PHCResult containing the updated report.

exportReport(string)

Export to file the selected reports.

[WebMethod]
public PHCResult exportReport(string stamp)

Parameters

Nome Tipo Descrição
stamp string

Identifies the report to be exported to file.

Returns

PHCResult

PHCResult containing the contents of the exported reports.

Remarks

Export to report that is identified by the parameter stamp.

getEmailForReport(EntityRecordVO)

[WebMethod]
public PHCResult getEmailForReport(EntityRecordVO item)

Parameters

Nome Tipo Descrição
item EntityRecordVO

Returns

PHCResult

getReport(string)

[WebMethod]
public PHCResult getReport(string stamp)

Parameters

Nome Tipo Descrição
stamp string

Returns

PHCResult

getReportLines(string)

[WebMethod]
public PHCResult getReportLines(string basereportstamp)

Parameters

Nome Tipo Descrição
basereportstamp string

Returns

PHCResult

getReports(string, int)

View a list of reports for a particular entity.

[WebMethod]
public PHCResult getReports(string entityname, int numdoc)

Parameters

Nome Tipo Descrição
entityname string

Indicates the entity name.

numdoc int

Indicates the number of a document type for organizations with multiple types of document for entities that do not have this specificity this value is expected to zero.

Returns

PHCResult

PHCResultcontaing a list of BaseReportVO.

Remarks

View a list of reports for a particular entity entitynameand if the parameter numdoc is greater than 0 corresponds to the reports list in a document.

getReportsForPrint(string, int)

Query a list of reports for a given entity for printing purposes.

[WebMethod]
public PHCResult getReportsForPrint(string entityname, int numdoc)

Parameters

Nome Tipo Descrição
entityname string

Identifica o nome da entidade.

numdoc int

Identifies the corresponding internal number to the type of billing document or type of internal case. When the entity is different from Bo or Ft should be filled with zero.

Returns

PHCResult

PHCResult containing a list of ReportListVO.

Examples

ALGORITMO COMPLETO PARA SE IMPRIMIR UM REGISTO A PARTIR DE UM DESENHO ESCOLHIDO:.

.

Resumo: O seguinte algoritmo serve para se listar as definições de relatórios existentes de um determinado tipo de entidade, imprimir para ficheiro (que pode ser no formato .pdf, .csv, .rtf, .png, .mht) um registo com um determinado desenho de relatório escolhido e por fim efectuar-se o download. .

.

1.

Pedido de listagem de relatórios disponíveis:.

reportws.getReportsForPrint(entityName:String, numdoc:Integer):PHCResult.

.

Parâmetros:.

entityName - Identifica o nome da entidade.

numdoc - Identifica o número interno correspondente ao tipo de documento (por exemplo para casos de tipos de documentos de facturação ou de dossiers internos devendo ser preenchido com 0 para os restantes casos).

.

Retorno:.

Um PHCResult com um array do tipo ReportListVO (contém o stamp da definição do relatório e o nome do mesmo).

.

Exemplo:.

reportws.getReportsForPrint("FT", 1).

.

2.

Neste passo temos 2 métodos à escolha, o primeiro é para imprimir em .PDF e o segundo num formato à escolha.

Pedido de impressão para pdf de determinado relatório:.

reportws.runReport(repstamp:String, list:Array(Of String), serie:String).

Pedido de impressão para um formato à escolha de um determinado relatório:.

reportws.runReportByContentType(repstamp:String, list:Array(Of String), serie:String, contentType:String, signDocument:Boolean).

.

Parâmetros:.

repstamp - Identifica o registo da entidade FullReportVO ao qual se deseja imprimir o relatório para pdf.

list - Contém os filtros dos registos que se pretende imprimir.

serie - Identificação da série a imprimir (2VIA, DUPLICADO, NORMAL).

contentType - Indica o formato do ficheiro a produzir, que pode ser: "pdf", "csv", "rtf", "mht" ou "png".

signDocument - Indica se o documento é para ser assinado digitalmente, só se contentType="pdf".

.

Retorno:.

Um PHCResult com um array do tipo StringVO (contém a propriedade phcString com o endpoint de uma directoria + nome e extensão do ficheiro gerado).

.

Exemplo:.

reportws.runReport("919-41c6-a7d8-e88c2446a49", ["242-41d5-acf8-70a227fc3df"], "NORMAL").

.

3.

Pedido de download do relatório já impresso no formato indicado:.

Endereço do backend + /cpdf.aspx?filename= + nome e extensão do ficheiro gerado (atenção que aqui só se pode utilizar o nome do ficheiro gerado, pelo que deve haver um tratamento para remover a directoria).

Exemplo:.

https://sis.phcfx.com/XXXX/cpdf.aspx?filename=reportc4c780db-6d06-4930-a792-16818408921b.pdf.

getReportsWithoutReportConfig(string, int, bool)

[WebMethod]
public PHCResult getReportsWithoutReportConfig(string entityname, int numdoc, bool isStamp)

Parameters

Nome Tipo Descrição
entityname string
numdoc int
isStamp bool

Returns

PHCResult

importReport(StringVO, string, int)

Import reports from an XML file.

[WebMethod]
public PHCResult importReport(StringVO xmlString, string targetType, int targetNdoc)

Parameters

Nome Tipo Descrição
xmlString StringVO

XML representing the reports to import.

targetType string

Type of entity contained in the reports to import.

targetNdoc int

Internal document number in the report to import.

Returns

PHCResult

PHCResult containing the contents of the imported XML.

Remarks

Import reports from an XML file defined by parameter xmlString.

print(ReportPrintOptionsVO)

Process a print job.

[WebMethod]
public PHCResult print(ReportPrintOptionsVO options)

Parameters

Nome Tipo Descrição
options ReportPrintOptionsVO

Print job options

Returns

PHCResult

printall(ReportPrintOptionsVO)

Process a print job.

[WebMethod]
public PHCResult printall(ReportPrintOptionsVO options)

Parameters

Nome Tipo Descrição
options ReportPrintOptionsVO

Print job options

Returns

PHCResult

setDefaultTemplate(string)

Allow to set the layout to be used as a basis for the reports.

[WebMethod]
public PHCResult setDefaultTemplate(string layout)

Parameters

Nome Tipo Descrição
layout string

Indicates the type of layout to apply.

Returns

PHCResult

PHCResult empty if you run properly.

Remarks

Set the layout to be used as the basis for all reports, those who do not have the layout here specified by the layout, will be disabled.

setDuplicateQuantity(string, int)

Change quantity of status report.

[WebMethod]
public PHCResult setDuplicateQuantity(string stamp, int quantity)

Parameters

Nome Tipo Descrição
stamp string

The Layout identifier

quantity int

Quantity of copies to be printed for this layout

Returns

PHCResult

PHCResult containing the updated report.

setImageSize(string, int)

Change quantity of status report.

[WebMethod]
public PHCResult setImageSize(string stamp, int imageSize)

Parameters

Nome Tipo Descrição
stamp string

The Layout identifier

imageSize int

Layout Image Type

Returns

PHCResult

PHCResult containing the updated report.

setLogoHeight(string, int)

Change quantity of status report.

[WebMethod]
public PHCResult setLogoHeight(string stamp, int logoHeight)

Parameters

Nome Tipo Descrição
stamp string

The Layout identifier

logoHeight int

Quantity of copies to be printed for this layout

Returns

PHCResult

PHCResult containing the updated report.

setLogoWidth(string, int)

Change quantity of status report.

[WebMethod]
public PHCResult setLogoWidth(string stamp, int logoWidth)

Parameters

Nome Tipo Descrição
stamp string

The Layout identifier

logoWidth int

Quantity of copies to be printed for this layout

Returns

PHCResult

PHCResult containing the updated report.

setTemplate(string)

[WebMethod]
public PHCResult setTemplate(string layout)

Parameters

Nome Tipo Descrição
layout string

Returns

PHCResult