cancel
Showing results for 
Search instead for 
Did you mean: 

Help with the path of .rpt layouts

Former Member
0 Kudos

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 ?

Accepted Solutions (0)

Answers (2)

Answers (2)

edy_simon
Active Contributor
0 Kudos

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

former_member244307
Participant
0 Kudos

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