1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- using System;
- using System.Web.Services.Protocols;
- using SamplesCommon;
- using cognosdotnet_10_2;
- namespace Move
- {
-
-
-
- class Move
- {
-
-
-
-
- public Move(){}
-
- static void Main(string[] args)
- {
- string cBIUrl = "";
- MoveDlg moveDlgObject = new MoveDlg();
- contentManagerService1 cmService = null;
- SamplesConnect connectDlg = new SamplesConnect();
-
- if (args.GetLength(0) == 0 )
- {
-
- connectDlg.ShowDialog();
- if (connectDlg.IsConnectedToCBI() == true)
- {
- cmService = connectDlg.CBICMS;
- cBIUrl = connectDlg.CBIURL;
- moveDlgObject.setConnection(cmService, cBIUrl);
- moveDlgObject.setReportList(BaseClassWrapper.buildReportQueryList(cmService));
- moveDlgObject.setSelectedReportIndex(0);
- moveDlgObject.ShowDialog();
- }
- }
- }
- public bool doMove(contentManagerService1 cBICMS, string reportPath, string targetPath, ref string resultMessage)
- {
- if (cBICMS == null)
- {
- resultMessage = "...the connection is invalid.\n";
- }
- report rReport = new report();
-
- stringProp reportToMove = new stringProp();
- reportToMove.value = reportPath;
- rReport.searchPath = reportToMove;
- baseClass[] bcaMove = {rReport};
- moveOptions cpOptions = new moveOptions();
- searchPathSingleObject cmTargetPath = new searchPathSingleObject();
- cmTargetPath.Value = targetPath;
-
- baseClass[] bcaMoveResults = cBICMS.move(bcaMove, cmTargetPath, cpOptions);
-
- if (bcaMoveResults.GetLength(0) > 0)
- {
-
- resultMessage = "...the report has been successfully moved to the target location \"" + targetPath + "\".";
- return true;
- }
-
- else
- {
- resultMessage = "...moving the report to the target location : \"" + targetPath + "\" failed.";
- return false;
- }
- }
- }
- }
|