cancel
Showing results for 
Search instead for 
Did you mean: 

Help!

former_member184566
Active Contributor
0 Kudos

Hi

Im trying to set a pld layout as a default layout in SBO 2005. In the ReportLayoutService object there is a method called "SetDefaultReport"...will this do it for me?

I've tried using it and with no success. keep getting an error. So can someone tell me if i'm on the right track and how to use it. Any answer is great. Some sample code please.

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

former_member184566
Active Contributor
0 Kudos

Hi Adele

I've tried your code, your works better. Mine was always given an error. Did something silly. But it didn't change it at all. I've also noticed that if you do it through the front end it doesn't always change over Through SDK does absolutly NOTHING!!!

Anyone out there who knows how to solve this?

Any answer from SAP would be great!

rasmuswulff_jensen
Active Contributor
0 Kudos

The following code works for me... (SBO2005A PL05)


CompanyService cps = SboCompany.GetCompanyService();
innerReportLayoutService = (ReportLayoutsService)cps.GetBusinessService(ServiceTypes.ReportLayoutsService);
DefaultReportParams ppIDefaultReportParams = (DefaultReportParams)innerReportLayoutService.GetDataInterface(ReportLayoutsServiceDataInterfaces.rlsdiDefaultReportParams);
ppIDefaultReportParams.CardCode = "CardCode"; //The cardcode
ppIDefaultReportParams.LayoutCode = "INV20004"; //The specific UID of the report
ppIDefaultReportParams.ReportCode = "INV2"; //The general report type
ppIDefaultReportParams.UserID = 1; //Login user
innerReportLayoutService.SetDefaultReport(ppIDefaultReportParams);

Answers (2)

Answers (2)

former_member184566
Active Contributor
0 Kudos

Hi Rasmus

That does work. Thanks a lot But what bothers me is that if i don't stipulate a user and bp it doesn't work. It should change it for everyone then. Also i've noticed that when you do it from the front end the layouts won't change if you say just for this user and for all the BP's. It shows that it has changed, but you'll close the window and then press the pencil again and it will be on the old layout and not on the new one you specified.

Anyone have the same problem?

Thanks Rasmus

Former Member
0 Kudos

Hi Louis,

Set the userid to negative 1. I tested and it worked here. Try it:

oReportParam.UserID = -1

Hope it helps,

Adele

rasmuswulff_jensen
Active Contributor
0 Kudos

What you can do instead of cloase and open., You can change the top combobox to an other value an back again.. This works great as an update, an you can't see it happening

rasmuswulff_jensen
Active Contributor
0 Kudos

Adele: Have you tried sending an empty Cardcode ("") along also... Perhaps that works...

former_member184566
Active Contributor
0 Kudos

Thanks guys, that is great Don't know why i didn't think of that. I've put up another thread about the new object in sap 2005 sdk....the grid, only John replied, ill post something to move it to the top of the list. Please look. the grid works great. But when you collapse it, it does not show the totals on the columns where it is numeric. Basicaly when it is expanded you have

ItemCode

> WH01 1

> WH02 2

but when you callapse it shows just the itemcode and no totals like warehouse total 3.Id like it to work similar to "Transaction report by projects" in SBO. I get the feeling this new object does not support it. Can anyone else confirm this?

Thanks again.

Former Member
0 Kudos

Hi Louis,

I have tried the following code and I don't get an error, problem is the codes seems not to work either, but maybe it could spark an idea somewhere

        Try
            Dim oCmpSrv As SAPbobsCOM.CompanyService
            Dim oReportLayoutService As SAPbobsCOM.ReportLayoutsService
            Dim oReportParam As SAPbobsCOM.DefaultReportParams
            oCmpSrv = oCompany.GetCompanyService
            oReportLayoutService = oCmpSrv.GetBusinessService(SAPbobsCOM.ServiceTypes.ReportLayoutsService)
            oReportParam = oReportLayoutService.GetDataInterface(SAPbobsCOM.ReportLayoutsServiceDataInterfaces.rlsdiDefaultReportParams)
            oReportParam.ReportCode = "POR2"
            oReportParam.LayoutCode = "POR20002"
            oReportLayoutService.SetDefaultReport(oReportParam)
            MessageBox.Show("Done")
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try

The "Done" message box pops up, so no exception. Maybe you can switch on SQL profiler on your PC and see if it is actually trying to execute something. I haven't worked much with the services and it also doesn't look like there is an update method. I see some of the other services has oService.UpdateWhateverService(oWhateverService), but the report one doesn't seem to work like that... maybe I'm wrong. Anyone else any idea?

Hope it helps,

Adele