2006 Jan 17 5:23 AM - edited 2024 Feb 04 2:07 AM
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
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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);
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
104 | |
10 | |
8 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.