cancel
Showing results for 
Search instead for 
Did you mean: 

Error while importing crystal report

former_member319241
Participant
0 Kudos

Hi,

I am trying to import crystal report using SDK.

I am getting following error.

System.Runtime.InteropServices.SEHException was caught
  HResult=-2147467259
  Message=External component has thrown an exception.

Code is below.

ReportLayoutsService oLayoutService = (ReportLayoutsService)oCompany.GetCompanyService().GetBusinessService(SAPbobsCOM.ServiceTypes.ReportLayoutsService);
ReportLayout oReport = (ReportLayout)oLayoutService.GetDataInterface(ReportLayoutsServiceDataInterfaces.rlsdiReportLayout);

            oReport.Name = ReportName;
            oReport.TypeCode = "RCRI";
            oReport.Author = oCompany.UserName;
            oReport.Category = ReportLayoutCategoryEnum.rlcCrystal;

            string newReportCode;
            try
            {
                ReportLayoutParams oNewReportParams = oLayoutService.AddReportLayoutToMenu(oReport,MenuID);  //Error is on this line

                newReportCode = oNewReportParams.LayoutCode;
            }

Awaiting for your reply.

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

jmrl
Discoverer
0 Kudos

Hola!.

A mi también me esta sucediendo lo mismo, lo curioso es que es a partir de la versión 9.2 PL 08. Esta mismo proceso lo venia ejecutando en la versión 9.2 PL07 y no presentaba problemas.

Que versión utilizas tu?.

Saludos,

former_member319241
Participant
0 Kudos

Hi Jorge,

I am using SAP B1 9.3 PL00.

It was working when I was using 9.2 version but after upgrading to 9.3 PL00 same code is giving error.

jmrl
Discoverer

Hi saurabh.

I wanted to tell you that I solved the problem.

What I did was incorporate an initial function in which I consulted first if the report was already registered in the database. If it exists, I delete it first before uploading the report again.

In my case, I want the current format to be the one I upload, so I have no problem removing it and uploading it again.

Tell me if this solution works for you.

regards