Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

Índice:


              

Índice
exclude.*ndice:

Introdução:


       O Web Service Reports Fornece serviços para gerar relatórios do TOTVS Reports de forma Síncrona síncrona e assíncrona. O modelo de autenticação utilizado é o Basic Authentication.

(informação)      Utilizando Web Service do RM Reports no Fluig

Como Funciona:


       Estão expostos no wsReportswsReport alguns serviços, onde para consumi-los, é necessário enviar através de uma requisição um envelope SOAP , passando os parâmetros de cada serviço. 

        É necessário adicionar o parâmetro "DefaultDB" no arquivo de configuração do Host (RM.host.Service.exe.config).

           Ex: <add key="DefaultDB" value="CorporeRM" /> 

 

O serviço é exposto pelo host conforme documentação abaixo:

      Como Expor os Web Services do RM através do Host


Aviso
iconfalse

Para utilização dos Web Services através do aplicativo "Totvs Web Service Test"baixar os arquivos da aplicação exemplo em ASP.Net, clique aqui.

 


       Segue Segue abaixo o detalhamento e exemplos de utilização dos serviços em envelope SOAP.:


Expandir
titleGetReportList
Informações
iconfalse

Retorna a lista de todos os relatórios de uma determinada coligada.


card
Deck of Cards
id.
Card
label
Request
Bloco de código
languagexml
titleRequest
GetReportList:
  • GetReportList:

Retorna a lista de todos os relatórios de uma determinada coligada.

Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tot="http://www.totvs.com/">
  

   <soapenv:Header/>
  

   <soapenv:Body>
     

      <tot:GetReportList>
        

         <!--Optional:-->
        

         <tot:codColigada>1</tot:codColigada>
     

      </tot:GetReportList>
  

   </soapenv:Body>

</soapenv:
Envelope> 
Envelope> 
Card
labelResponse
Bloco de código
languagexml
titleResponse
:
<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  

   <s:Body>
      <GetReportListResponse

      <GetReportListResponse
xmlns="http://www.totvs.com/">
         <GetReportListResult>0,TOTVS

         <GetReportListResult>0,TOTVS
Educacional,306,Boletim,Boletim,06/10/2010
15:43:00,597e2978-351d-4629-a2fb-b57432cad210;,0,TOTVS
Educacional,30,Contrato,Contrato,06/10/2010
15:43:00,71eff25f-0960-4ab7-bbc9-564044dde0fe;,0,TOTVS Gestão
Financeira,312,Boleto Itaú.2.1,Cópia de Cópia de Boleto Itaú,08/04/2016
07:49:00,c9c51350-3cfa-410e-b818-224a013d0296;,0,TOTVS Inteligência de
Negócios,316,filtrosNomeados,filtrosNomeados,11/04/2016
10:37:12,d19713e7-eda0-4bf1-8e92-140714240c16;,0,TOTVS
Educacional,31,EDUREL002,Listagem de Alunos com foto,06/10/2010
15:43:00,b84b941c-54e5-43c1-996b-3e9eae05e902.......
         </GetReportListResult>
     

      </GetReportListResponse>
  

   </s:Body>

</s:Envelope>
label
Expandir
titleGetReportMetadata:
GetReportMetadata:
Informações
iconfalse

Retorna a estrutura de um determinado relatório (utilizado apenas para conferencia).

card
Deck of Cards
id.
Card
labelRequest
:
Bloco de código
languagexml
titleRequest
<soapenv:Envelope xmlns:
<soapenv:Envelope xmlns:
soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tot="http://www.totvs.com/">
  

   <soapenv:Header/>
  

   <soapenv:Body>
     

      <tot:GetReportMetaData>
        

         <!--Optional:-->
        

         <tot:codColigada>1</tot:codColigada>
        

         <!--Optional:-->
        

         <tot:id>306</tot:id>
      <

      </tot:GetReportMetaData>
  

   </soapenv:Body>

</soapenv:Envelope>
Card
 
labelResponse
:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

   <s:Body>

      <GetReportMetaDataResponse
Bloco de código
languagexml
titleResponse
<s:Body>
      <GetReportMetaDataResponse xmlns="http://www.totvs.com/">
        

         <GetReportMetaDataResult><![CDATA[<NewDataSet>
 

  <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop">
   

    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msdata:AutoRemoveRelations="True" msdata:EnforceConstraints="False">
     

      <xs:complexType>
       

        <xs:choice minOccurs="0" maxOccurs="unbounded">
         

          <xs:element name="PFUNC" msprop:_x0023__x0023_SQLFetch="00:00:00.0160016" msprop:DISPLAYNAME="Funcionários" msprop:ASSEMBLYFONTE="RM.Rpt.Lib.Server" msprop:CLASSEFONTE="RM.Rpt.Lib.RptRMProvider" msprop:_x0024_OriginTables="System.String[]" msprop:_x0040_SQL="SELECT * FROM PFUNC WHERE 0=1">

            <xs:complexType>

              <xs:sequence>

                <xs:element

            <xs:complexType>
              <xs:sequence>
                <xs:element name="CODCOLIGADA" msdata:Caption="Código Identificador da Coligada" msprop:_x0024_SecTableOrigin="PFUNC" msprop:_x0024_Origin="PFUNC.CODCOLIGADA" msprop:_x0024_SecField="CODCOLIGADA" type="xs:short" minOccurs="0" />
               

                <xs:element name="CHAPA" msdata:Caption="Chapa do Funcionário" msprop:_x0024_SecTableOrigin="PFUNC" msprop:_x0024_Origin="PFUNC.CHAPA" msprop:_x0024_SecField="CHAPA" type="xs:string" minOccurs="0" />
               

                <xs:element name="NROFICHAREG" msdata:Caption="Número da Ficha de Registro" msprop:_x0024_SecTableOrigin="PFUNC" msprop:_x0024_Origin="PFUNC.NROFICHAREG" msprop:_x0024_SecField="NROFICHAREG" type="xs:int" minOccurs="0" />
               

                <xs:element name="CODRECEBIMENTO" msdata:Caption="Código do Recebimento" msprop:_x0024_SecTableOrigin="PFUNC" msprop:_x0024_Origin="PFUNC.CODRECEBIMENTO" msprop:_x0024_SecField="CODRECEBIMENTO" type="xs:string" minOccurs="0"
/>

               

     
 />
                
      <xs:unique name="Constraint1">
       

        <xs:selector xpath=".//PFUNC" />
       

        <xs:field xpath="CODCOLIGADA" />
        <xs

        <xs:field xpath="CHAPA" />
     

      </xs:unique>
     

      <xs:unique name="pfdepend_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
       

        <xs:selector xpath=".//pfdepend" />
       

        <xs:field xpath="CODCOLIGADA" />
       

        <xs:field xpath="CHAPA" />
       

        <xs:field xpath="NRODEPEND" />
      </

      </xs:unique>
     

      <xs:unique name="Constraint2">
       

        <xs:selector xpath=".//pfdepend" />
       

        <xs:field xpath="CODCOLIGADA" />
       

        <xs:field xpath="CHAPA" />
     

      </xs:unique>
     

      <xs:keyref name="PFUNC.pfdepend" refer="Constraint1" msprop:rel_CHILDFIELD="CODCOLIGADA,CHAPA" msprop:rel_MASTERFIELD="CODCOLIGADA,CHAPA">
       

        <xs:selector xpath=".//pfdepend" />
       

        <xs:field xpath="CODCOLIGADA" />
       

        <xs:field xpath="CHAPA" />
     

      </xs:keyref>
     

      <xs:keyref name="pfdepend.PFUNC" refer="Constraint2" msprop:rel_CHILDFIELD="CODCOLIGADA,CHAPA" msprop:rel_MASTERFIELD="CODCOLIGADA,CHAPA">
       

        <xs:selector xpath=".//PFUNC" />
       

        <xs:field xpath="CODCOLIGADA" />
       

        <xs:field xpath="CHAPA" />
     

      </xs:keyref>
   

    </xs:element>
 

  </xs:schema>

</NewDataSet>]]></GetReportMetaDataResult>
     

      </GetReportMetaDataResponse>
  

   </s:Body>

</s:Envelope>
label
Expandir
titleGetReportInfo
GetReportInfo:
Informações
iconfalse

Retorna as informações de filtro e parâmetros, caso o relatório possua. 

O retorno é um xml de duas estruturas serializadas. Elas devem ser utilizadas separadamente ao chamar o método de geração do relatório.

card
Deck of Cards
id.
Card
labelRequest
Bloco de código
languagexml
titleRequest
:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tot="http://www.totvs.com/">
  

   <soapenv:Header/>
  

   <soapenv:Body>
     

      <tot:GetReportInfo>
        

         <!--Optional:-->
        

         <tot:codColigada>1</tot:codColigada>
        

         <!--Optional:-->
        

         <tot:idReport>306</tot:idReport>
     

      </tot:GetReportInfo>
  

   </soapenv:Body>

</soapenv:Envelope>
 
Card
labelResponse
Bloco de código
languagexml
titleResponse
:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

   <s:Body>

      <GetReportInfoResponse

   <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <GetReportInfoResponse xmlns="http://www.totvs.com/">
         <GetReportInfoResult

         <GetReportInfoResult xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
           

            <a:string><![CDATA[<?xml version="1.0" encoding="utf-16"?>

<ArrayOfRptFilterReportPar xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.totvs.com.br/RM/">

  <RptFilterReportPar>

   

  <RptFilterReportPar>
    <BandName>RptReport</BandName>

    <FiltersByTable>

      <RptFilterByTablePar>

       

    <FiltersByTable>
      <RptFilterByTablePar>
        <Filter>PFUNC.CHAPA &gt;= '00001' AND
 
PFUNC.CHAPA &lt;= '00010'

</Filter>
       

        <TableName>PFUNC</TableName>
     

      </RptFilterByTablePar>
   

    </FiltersByTable>
   

    <MainFilter>true</MainFilter>
   

    <Value>(PFUNC.CHAPA &gt;= '00001' AND
 
PFUNC.CHAPA &lt;= '00010'

)</Value>
 

  </RptFilterReportPar>

</ArrayOfRptFilterReportPar>]]></a:string>
           

            <a:string><![CDATA[<?xml version="1.0" encoding="utf-16"?>

<ArrayOfRptParameterReportPar xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.totvs.com.br/RM/">

  <RptParameterReportPar>

   

  <RptParameterReportPar>
    <Description>PARAM_COLIGADA</Description>
   

    <ParamName>PARAM_COLIGADA</ParamName>
    <Type

    <Type xmlns:d3p1="http://schemas.datacontract.org/2004/07/System" xmlns:d3p2="-mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089-System-System.RuntimeType" i:type="d3p2:RuntimeType" xmlns:d3p3="-mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089-System-System.UnitySerializationHolder" z:FactoryType="d3p3:UnitySerializationHolder" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
      <Data

      <Data xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">System.String</Data>
      <UnityType

      <UnityType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:int" xmlns="">4</UnityType>
      <AssemblyName

      <AssemblyName xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyName>
   

    </Type>
    <Value

    <Value xmlns:d3p1="http://www.w3.org/2001/XMLSchema" i:type="d3p1:string"></Value>
   

    <Visible>true</Visible>
 

  </RptParameterReportPar>

  <RptParameterReportPar>

   

  <RptParameterReportPar>
    <Description>PARAM_TESTE</Description>
   

    <ParamName>PARAM_TESTE</ParamName>
    <Type

    <Type xmlns:d3p1="http://schemas.datacontract.org/2004/07/System" xmlns:d3p2="-mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089-System-System.RuntimeType" i:type="d3p2:RuntimeType" xmlns:d3p3="-mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089-System-System.UnitySerializationHolder" z:FactoryType="d3p3:UnitySerializationHolder" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
      <Data

      <Data xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">System.String</Data>
      <UnityType

      <UnityType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:int" xmlns="">4</UnityType>
      <AssemblyName

      <AssemblyName xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyName>
   

    </Type>
    <Value

    <Value xmlns:d3p1="http://www.w3.org/2001/XMLSchema" i:type="d3p1:string"></Value>
   

    <Visible>true</Visible>
 

  </RptParameterReportPar>

</ArrayOfRptParameterReportPar>]]></a:string>
        

         </GetReportInfoResult>
     

      </GetReportInfoResponse>
  

   </s:Body>

</s:Envelope>
label
Expandir
titleGenerateReport
GenerateReport:
Informações
iconfalse

Gera efetivamente o relatório e retorna o identificador a ser utilizado para fazer o download do relatório pelo método GetFileChunk.

Veja que os filtros e os parâmetros correspondem ao que o método GetReportInfo retornou e foi passado separadamente.

Os filtros e parâmetros podem ser alterados conforme destaque abaixo.

Informações
titleImportante

Caso esteja executando um relatório Global, o valor da Coligada para execução do relatório e das consultas presentes no relatório pode ser passado através do parâmetro Contexto, por exemplo:

Bloco de código
languagexml
<tot:contexto>CodColigada=7;CodFilial=1</tot:contexto>

Caso não seja enviado, será utilizado a Coligada do relatório.

card
Deck of Cards
id.
Card
labelRequest
Bloco de código
languagexml
titleRequest
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tot="http://

Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tot="http://
www.totvs.com/">
  

   <soapenv:Header/>
  

   <soapenv:Body>

      <tot:GenerateReport>

        

      <tot:GenerateReport>
         <!--Optional:-->
        

         <tot:codColigada>1</tot:codColigada>
        

         <!--Optional:-->
        

         <tot:id>306</tot:id>
        

         <!--Optional:-->
        

         <tot:filters><![CDATA[<?xml version="1.0" encoding="utf-16"?>

<ArrayOfRptFilterReportPar xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.totvs.com.br/RM/">

  <RptFilterReportPar>

   

  <RptFilterReportPar>
    <BandName>RptReport</BandName>

    <FiltersByTable>

      <RptFilterByTablePar>

       

    <FiltersByTable>
      <RptFilterByTablePar>
        <Filter>PFUNC.CHAPA &gt;= '00001' AND

PFUNC.CHAPA &lt;= '00010'

</Filter>
       

        <TableName>PFUNC</TableName>
     

      </RptFilterByTablePar>
   

    </FiltersByTable>
   

    <MainFilter>true</MainFilter>
   

    <Value>(PFUNC.CHAPA &gt;= '00001' AND

PFUNC.CHAPA &lt;= '00010')</Value>
 

  </RptFilterReportPar>

</ArrayOfRptFilterReportPar>]]></tot:filters>
        

         <!--Optional:-->
        

         <tot:parameters><![CDATA[<?xml version="1.0" encoding="utf-16"?>

<ArrayOfRptParameterReportPar xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.totvs.com.br/RM/">

  <RptParameterReportPar>

   

  <RptParameterReportPar>
    <Description>PARAM_COLIGADA</Description>
   

    <ParamName>PARAM_COLIGADA</ParamName>
    <Type

    <Type xmlns:d3p1="http://schemas.datacontract.org/2004/07/System" xmlns:d3p2="-mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089-System-System.RuntimeType" i:type="d3p2:RuntimeType" xmlns:d3p3="-mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089-System-System.UnitySerializationHolder" z:FactoryType="d3p3:UnitySerializationHolder" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
      <Data

      <Data xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">System.String</Data>
      <UnityType

      <UnityType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:int" xmlns="">4</UnityType>
      <AssemblyName

      <AssemblyName xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyName>
   

    </Type>
    <Value

    <Value xmlns:d3p1="http://www.w3.org/2001/XMLSchema" i:type="d3p1:string">1</Value>
   

    <Visible>true</Visible>
 

  </RptParameterReportPar>

  <RptParameterReportPar>

   

  <RptParameterReportPar>
    <Description>PARAM_TESTE</Description>
   

    <ParamName>PARAM_TESTE</ParamName>
    <Type

    <Type xmlns:d3p1="http://schemas.datacontract.org/2004/07/System" xmlns:d3p2="-mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089-System-System.RuntimeType" i:type="d3p2:RuntimeType" xmlns:d3p3="-mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089-System-System.UnitySerializationHolder" z:FactoryType="d3p3:UnitySerializationHolder" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
      <Data

      <Data xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">System.String</Data>
      <UnityType

      <UnityType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:int" xmlns="">4</UnityType>
      <AssemblyName

      <AssemblyName xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyName>
   

    </Type>
    <Value

    <Value xmlns:d3p1="http://www.w3.org/2001/XMLSchema" i:type="d3p1:string">1</Value>
   

    <Visible>true</Visible>
 

  </RptParameterReportPar>

</ArrayOfRptParameterReportPar>]]></tot:parameters>
         <

         <!--Optional:-->
        

         <tot:fileName>Report.pdf</tot:fileName>
     

		 <!--Optional:-->
         <tot:contexto>CodColigada=1;CodFilial=1</tot:contexto>
      </tot:GenerateReport>
  

   </soapenv:Body>

</soapenv:Envelope>
 
Card
labelResponse
Bloco de código
languagexml
titleResponse
:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  

   <s:Body>
      <GenerateReportResponse

      <GenerateReportResponse xmlns="http://www.totvs.com/">
        

         <GenerateReportResult>33f3bc8a-2553-4ad2-a53f-a03b487844cf</GenerateReportResult>
     

      </GenerateReportResponse>
  

   </s:Body>

</s:Envelope>
label
Expandir
titleGetGeneratedReportSize
GetGeneratedReportSize:
Informações
iconfalse

Retorna o tamanho do relatório em bytes. Este resultado é utilizado para fazer o download parcial ou total do relatório pelo método GetFileChunk.

card
Deck of Cards
id.
Card
labelRequest
Bloco de código
languagexml
titleRequest
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tot="http://www.totvs.com/">
  

   <soapenv:Header/>
  

   <soapenv:Body>
     

      <tot:GetGeneratedReportSize>
        

         <!--Optional:-->
        

         <tot:guid>33f3bc8a-2553-4ad2-a53f-a03b487844cf</tot:guid>
     

      </tot:GetGeneratedReportSize>
  

   </soapenv:Body>

</soapenv:Envelope>
 
Card
labelResponse
Bloco de código
languagexml
titleResponse
:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  

   <s:Body>
      <GetGeneratedReportSizeResponse

      <GetGeneratedReportSizeResponse xmlns="http://www.totvs.com/">
        

         <GetGeneratedReportSizeResult>45484</GetGeneratedReportSizeResult>
     

      </GetGeneratedReportSizeResponse>
  

   </s:Body>

</s:Envelope>
label
Expandir
titleGetFileChunk
GetFileChunk:
Informações
iconfalse

Retorna o relatório gerado em base 64 e no formato especificado no parâmetro filename do método GenerateReport.

card
Deck of Cards
id.
Card
labelRequest
Bloco de código
languagexml
titleRequest
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tot="http://www.totvs.com/">
  

   <soapenv:Header/>
  

   <soapenv:Body>
     

      <tot:GetFileChunk>
        

         <!--Optional:-->
         <tot:

         <tot:guid>33f3bc8a-2553-4ad2-a53f-a03b487844cf</tot:guid>
        

         <!--Optional:-->
        

         <tot:offset>0</tot:offset>
        

         <!--Optional:-->
        

         <tot:length>45484</tot:length>
     

      </tot:GetFileChunk>
  

   </soapenv:Body>

</soapenv:Envelope>
 
Card
labelResponse
Bloco de código
languagexml
titleResponse
:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  

   <s:Body>
      <GetFileChunkResponse

      <GetFileChunkResponse xmlns="http://www.totvs.com/">
               

	[CONTEUDO DO RELATÓRIO EM BASE 64]
               

	</GetFileChunkResult>
     

      </GetFileChunkResponse>
  

   </s:Body>

</s:Envelope>
label
Expandir
titleGenerateReportAsynchronous
GenerateReportAsynchronous:
Informações
iconfalse

Funciona da mesma forma que o GenerateReport, porém não aguarda a geração do relatório e retorna um identificador único a ser utilizado para consultar o status da geração.

Informações
titleImportante

Caso esteja executando um relatório Global, o valor da Coligada para execução do relatório e das consultas presentes no relatório pode ser passado através do parâmetro Contexto, por exemplo:

Bloco de código
languagexml
<tot:contexto>CodColigada=7;CodFilial=1</tot:contexto>

Caso não seja enviado, será utilizado a Coligada do relatório.

Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tot="http://www.totvs.com/">

   <soapenv:Header/>

   <soapenv:Body>

      <tot:GenerateReportAsynchronous>

         <!--Optional:-->

         <tot:codColigada>1</tot:codColigada>

         <!--Optional:-->

         <tot:id>306</tot:id>

         <!--Optional:-->

         <tot:filters><![CDATA[<?xml version="1.0" encoding="utf-16"?>

<ArrayOfRptFilterReportPar xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.totvs.com.br/RM/">

  <RptFilterReportPar>

    <BandName>RptReport</BandName>

    <FiltersByTable>

      <RptFilterByTablePar>

        <Filter>PFUNC.CHAPA &gt;= '00001' AND

PFUNC.CHAPA &lt;= '00010'

</Filter>

        <TableName>PFUNC</TableName>

      </RptFilterByTablePar>

    </FiltersByTable>

    <MainFilter>true</MainFilter>

    <Value>(PFUNC.CHAPA &gt;= '00001' AND

PFUNC.CHAPA &lt;= '00010'

)</Value>

  </RptFilterReportPar>

</ArrayOfRptFilterReportPar>]]></tot:filters>

         <!--Optional:-->

         <tot:parameters><![CDATA[<?xml version="1.0" encoding="utf-16"?>

<ArrayOfRptParameterReportPar xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.totvs.com.br/RM/">

  <RptParameterReportPar>

    <Description>PARAM_COLIGADA</Description>

    <ParamName>PARAM_COLIGADA</ParamName>

    <Type xmlns:d3p1="http://schemas.datacontract.org/2004/07/System" xmlns:d3p2="-mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089-System-System.RuntimeType" i:type="d3p2:RuntimeType" xmlns:d3p3="-mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089-System-System.UnitySerializationHolder" z:FactoryType="d3p3:UnitySerializationHolder" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">

      <Data xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">System.String</Data>

      <UnityType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:int" xmlns="">4</UnityType>

      <AssemblyName xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyName>

    </Type>

    <Value xmlns:d3p1="http://www.w3.org/2001/XMLSchema" i:type="d3p1:string">1</Value>

    <Visible>true</Visible>

  </RptParameterReportPar>

  <RptParameterReportPar>

    <Description>PARAM_TESTE</Description>

    <ParamName>PARAM_TESTE</ParamName>

    <Type xmlns:d3p1="http://schemas.datacontract.org/2004/07/System" xmlns:d3p2="-mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089-System-System.RuntimeType" i:type="d3p2:RuntimeType" xmlns:d3p3="-mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089-System-System.UnitySerializationHolder" z:FactoryType="d3p3:UnitySerializationHolder" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">

      <Data xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">System.String</Data>

      <UnityType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:int" xmlns="">4</UnityType>

      <AssemblyName xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyName>

    </Type>

    <Value xmlns:d3p1="http://www.w3.org/2001/XMLSchema" i:type="d3p1:string">1</Value>

    <Visible>true</Visible>

  </RptParameterReportPar>

</ArrayOfRptParameterReportPar>]]></tot:parameters>

         <!--Optional:-->

         <tot:fileName>Report.pdf</tot:fileName>

      </tot:GenerateReportAsynchronous>

   </soapenv:Body>

</soapenv:Envelope>

 

Response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

   <s:Body>

      <GenerateReportAsynchronousResponse xmlns="http://www.totvs.com/">

         <GenerateReportAsynchronousResult>ff3fe362-2433-42a1-bda6-44e6d811e578</GenerateReportAsynchronousResult>

      </GenerateReportAsynchronousResponse>

   </s:Body>

</s:Envelope>

card
Deck of Cards
id.
Card
labelRequest
Bloco de código
languagexml
titleRequest
<soapenv:Envelope 
Card
labelGenerateReportAsynchronous
  •   GenerateReportAsynchronous:

Funciona da mesma forma que o GenerateReport, porém não aguarda a geração do relatório e retorna um identificador único a ser utilizado para consultar o status da geração.

Request:

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tot="http://www.totvs.com/">
  

   <soapenv:Header/>
  

   <soapenv:Body>
     

      <tot:GenerateReportAsynchronous>
        

         <!--Optional:-->
        

         <tot:codColigada>1</tot:codColigada>
        

         <!--Optional:-->
        

         <tot:id>306</tot:id>
        

         <!--Optional:-->
        

         <tot:filters><![CDATA[<?xml version="1.0" encoding="utf-16"?>

<ArrayOfRptFilterReportPar xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.totvs.com.br/RM/">

  <RptFilterReportPar>

   

  <RptFilterReportPar>
    <BandName>RptReport</BandName>

    <FiltersByTable>

      <RptFilterByTablePar>

       

    <FiltersByTable>
      <RptFilterByTablePar>
        <Filter>PFUNC.CHAPA &gt;= '00001' AND

PFUNC.CHAPA &lt;= '00010'

</Filter>
       

        <TableName>PFUNC</TableName>
     

      </RptFilterByTablePar>
   

    </FiltersByTable>
   

    <MainFilter>true</MainFilter>
   

    <Value>(PFUNC.CHAPA &gt;= '00001' AND

PFUNC.CHAPA &lt;= '00010'

)</Value>
 

  </RptFilterReportPar>

</ArrayOfRptFilterReportPar>]]></tot:filters>
        

         <!--Optional:-->
        

         <tot:parameters><![CDATA[<?xml version="1.0" encoding="utf-16"?>

<ArrayOfRptParameterReportPar xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.totvs.com.br/RM/">

  <RptParameterReportPar>

   

  <RptParameterReportPar>
    <Description>PARAM_COLIGADA</Description>
   

    <ParamName>PARAM_COLIGADA</ParamName>
    <Type

    <Type xmlns:d3p1="http://schemas.datacontract.org/2004/07/System" xmlns:d3p2="-mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089-System-System.RuntimeType" i:type="d3p2:RuntimeType" xmlns:d3p3="-mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089-System-System.UnitySerializationHolder" z:FactoryType="d3p3:UnitySerializationHolder" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
      <Data

      <Data xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">System.String</Data>
      <UnityType

      <UnityType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:int" xmlns="">4</UnityType>
      <AssemblyName

      <AssemblyName xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyName>
   

    </Type>
    <Value

    <Value xmlns:d3p1="http://www.w3.org/2001/XMLSchema" i:type="d3p1:string">1</Value>
   

    <Visible>true</Visible>
 

  </RptParameterReportPar>

  <RptParameterReportPar>

   

  <RptParameterReportPar>
    <Description>PARAM_TESTE</Description>
   

    <ParamName>PARAM_TESTE</ParamName>
    <Type

    <Type xmlns:d3p1="http://schemas.datacontract.org/2004/07/System" xmlns:d3p2="-mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089-System-System.RuntimeType" i:type="d3p2:RuntimeType" xmlns:d3p3="-mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089-System-System.UnitySerializationHolder" z:FactoryType="d3p3:UnitySerializationHolder" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
      <Data

      <Data xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">System.String</Data>
      <UnityType

      <UnityType xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:int" xmlns="">4</UnityType>
      <AssemblyName

      <AssemblyName xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyName>
   

    </Type>
    <Value

    <Value xmlns:d3p1="http://www.w3.org/2001/XMLSchema" i:type="d3p1:string">1</Value>
   

    <Visible>true</Visible>
 

  </RptParameterReportPar>

</ArrayOfRptParameterReportPar>]]><
/tot:parameters>        
/tot:parameters>
         <!--Optional:-->
        

         <tot:fileName>Report.pdf</tot:fileName>
     

		 <!--Optional:-->
         <tot:contexto>CodColigada=1;CodFilial=1</tot:contexto>
      </tot:GenerateReportAsynchronous>
  

   </soapenv:Body>
</soapenv
:Body>

</soapenv:Envelope>

 

Response:
:Envelope>
Card
labelResponse
Bloco de código
languagexml
titleResponse
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  

   <s:Body>
      <GenerateReportAsynchronousResponse

      <GenerateReportAsynchronousResponse xmlns="http://www.totvs.com/">
        

         <GenerateReportAsynchronousResult>ff3fe362-2433-42a1-bda6-44e6d811e578</GenerateReportAsynchronousResult>
     

      </GenerateReportAsynchronousResponse>
  

   </s:Body>

</s:Envelope>
label
Expandir
titleGetGeneratedReportStatus
GetGeneratedReportStatus:
Informações
iconfalse

Utilizado para checar o status da geração do relatório que foi demandado a partir do método GenerateReportAsynchronous.

O retorno é um código de status, seguido de um GUID a ser utilizado para fazer o download do relatório pelo método GetFileChunk. Ex:

  • 0;Wait – Indica que o relatório está sendo gerado
  • 1;xxxxxxxxxxxxxxxxxxxxxxxxxxxxx - Indica que foi gerado, seguido do GUID para download
  • 2;Erro xxxxxxx – Indica que ocorreu um erro, seguido da mensagem de erro
Deck of Cards
id.
Card
labelRequest
Bloco de código
languagexml
titleRequest
de erro

 

Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tot="http://www.totvs.com/">
  

   <soapenv:Header/>
  

   <soapenv:Body>
     

      <tot:GetGeneratedReportStatus>
        

         <!--Optional:-->
        

         <tot:id>ff3fe362-2433-42a1-bda6-44e6d811e578</tot:id>
     

      </tot:GetGeneratedReportStatus>
  

   </soapenv:Body>

</soapenv:Envelope>
 
Card
labelResponse
Bloco de código
languagexml
titleResponse
:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  

   <s:Body>
      <GetGeneratedReportStatusResponse

      <GetGeneratedReportStatusResponse xmlns="http://www.totvs.com/">

         <GetGeneratedReportStatusResult>1;24c5bc57-ffad-422e-8893-67a5c0256e76</GetGeneratedReportStatusResult>

      </GetGeneratedReportStatusResponse>

   </s:Body>

</s:Envelope>

         <GetGeneratedReportStatusResult>1;24c5bc57-ffad-422e-8893-67a5c0256e76</GetGeneratedReportStatusResult>
      </GetGeneratedReportStatusResponse>
   </s:Body>
</s:Envelope>

Aplicação de Teste:


        Para utilizar a aplicação de testes é necessário possuir o Microsoft Visual Studio.

  • Com o Visual Studio aberto: Clique nas opções FILE -> Open -> Web Site. Conforme exemplo abaixo:

             Image Added

  • Em seguida selecione a pasta descompactada e clique em "Open" conforme abaixo:

             Image Added


Informações
iconfalse
Informações
iconfalse

Produto: Framework

Informações
iconfalse

Versão: 12.011.XX12 ou superior

Informações
iconfalse

Processo: Web Services Reports

Informações
iconfalse
Informações
iconfalse

Status: Finalizado

Informações
iconfalse

Data: 15/05/2016

Informações
iconfalse

Autores:

Daniel Santos Campos

Douglas Maxwell de Oliveira

Fábio Augusto Amaral Melo Nunes

Karina Dos Santos Costa

Stella Gleyse Macedo Vilaca

Wesley Avelino De Carvalho

Daniel Santos Campos

Informações
iconfalse

Download do arquivodos arquivos: wsReport