12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- using System;
- using SamplesCommon;
- using cognosdotnet_10_2;
- namespace Copy
- {
-
-
-
- class Copy
- {
-
-
-
-
- public Copy(){}
-
- static void Main(string[] args)
- {
- string cBIUrl = "";
- contentManagerService1 cBICMS = null;
- CopyDlg copyDlgObject = new CopyDlg();
- SamplesConnect connectDlg = new SamplesConnect();
-
- if (args.GetLength(0) == 0 )
- {
-
- connectDlg.ShowDialog();
- if (connectDlg.IsConnectedToCBI() == true)
- {
- cBICMS = connectDlg.CBICMS;
- cBIUrl = connectDlg.CBIURL;
- copyDlgObject.setConnection(cBICMS, cBIUrl);
- copyDlgObject.setReportList(BaseClassWrapper.buildReportQueryList(cBICMS));
- copyDlgObject.setSelectedReportIndex(0);
- copyDlgObject.ShowDialog();
- }
- }
- }
- public bool doCopy(contentManagerService1 cBICMS, string reportPath, string targetPath, ref string resultMessage)
- {
- if (cBICMS == null)
- {
- resultMessage = "...the Server connection is invalid.\n";
- return false;
- }
- report rReport = new report();
-
- stringProp reportToCopy = new stringProp();
- reportToCopy.value = reportPath;
- rReport.searchPath = reportToCopy;
- baseClass[] bcaCopy = {rReport};
- copyOptions cpOptions = new copyOptions();
- searchPathSingleObject targetPathSO = new searchPathSingleObject();
- targetPathSO.Value = targetPath;
-
- baseClass[] bcaCopyResults = cBICMS.copy(bcaCopy, targetPathSO, cpOptions);
- if (bcaCopyResults.GetLength(0) > 0)
- {
-
- resultMessage = "...the report has been successfully copied to : " + targetPath + ".\n";
- return true;
- }
-
- else
- {
- resultMessage = "...copying the report to : \"" + targetPath + "\" failed.\n";
- return false;
- }
- }
- }
- }
|