Skip to Content
avatar image
Former Member

Help with the path of .rpt layouts

We have a trouble, we are automating the PDF creation but.... how SAP knows which layout have to use and where are the native RPT.

Someone know the path from this files ?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jun 04, 2015 at 05:25 PM

    Hi,

    I believe it is stored in SAP DB not a external file in SAP server folder. When you editing the layout in SAP, after you click save button I guess SAP stores it in DB. If you want you can do full file search in SAP program folder and see if you can find any .rpt file.

    Lan

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 05, 2015 at 02:02 AM

    Hi,

    It is stored as Hex stream in RDOC table, Field 'Template'.

    What you can do is download the required CR Template into a temp file

    And call the CR object to open this file.

    You can use below code to download the CR file from the table

        Public Sub GetCrystalReportFile(ByVal RDOCCode As String, ByVal outFileName As String)
            Try
                Dim oBlobParams As SAPbobsCOM.BlobParams = oCompany.GetCompanyService().GetDataInterface(SAPbobsCOM.CompanyServiceDataInterfaces.csdiBlobParams)
                oBlobParams.Table = "RDOC"
                oBlobParams.Field = "Template"
                Dim oKeySegment As SAPbobsCOM.BlobTableKeySegment = oBlobParams.BlobTableKeySegments.Add()
                oKeySegment.Name = "DocCode"
                oKeySegment.Value = RDOCCode '"INV20004" '
    
    
                Dim oBlob As SAPbobsCOM.Blob = oCompany.GetCompanyService().GetBlob(oBlobParams)
                Dim sContent As String = oBlob.Content
    
    
                Dim buf() As Byte = Convert.FromBase64String(sContent)
                Using oFile As New System.IO.FileStream(outFileName, System.IO.FileMode.Create)
                    oFile.Write(buf, 0, buf.Length)
                    oFile.Close()
                End Using
            Catch ex As Exception
                Throw ex
            End Try
    
    
        End Sub
    

    Regards
    Edy

    Add comment
    10|10000 characters needed characters exceeded