cognosxiaoyang
作者cognosxiaoyang·2013-01-14 17:24
软件开发工程师·新致

控制台命令及其它常见问题整理(转载)

字数 4439阅读 2822评论 0赞 1
文件来源:(http://blog.csdn.net/jwisdom/article/details/1922357
 
1. 问:初次使用cognos构建立方体,但不知如何使用模型自动生成cube,是用命令……?
答:trnsfrmr -n2 -s -kdatabase=user/password *.pyh
               *.mdl
2.
VisualC++6 中调用CognosOLE对象示例(还有精彩的flash
hihi,
各位cognos同盟,好久没来论坛了。今天为喜爱用vc的朋友提供一篇示例。cognos文档中没有提供vc开发的源码,无奈。用我这篇试试,不要说看不懂English啊!
Create an Automation Project
1. With Microsoft Developer Studio, start a new "MFC AppWizard
(exe)" project named "AutoPP."
2. In step 1 of the MFC AppWizard, choose "Dialog Based"
for the application type and then click Finish.
The New Project Information dialog box appears and indicates that
the Classes to be created include:
3. Application: CAutoPPApp in AutoPP.h and AutoPP.cpp
4. Dialog: CAutoPPDlg in AutoPP.h and AutoPPDlg.cpp
Click OK to create the project.
5. The Dialog box "IDD_AUTOPP_DIALOG" opens in the Visual Studio
design/edit area. Modify it according to the instructions in
the next two steps.
6. Remove the Label control (IDC_STATIC) and
the Cancel button (IDCANCEL).
7. Change the name of the OK button to "IDRUN" and the caption
to "Run." Close the AutoPP.rc dialog box design form.
8. Click ClassWizard on the View menu (or press CTRL+W).
9. Select the Message Maps tab. Select IDRUN in the Object Ids
list box and select "BN_CLICKED" in the Messages list box.
Click Add Function and accept the function name "OnRun".
Click OK to close the ClassWizard.
NOTE: This step adds a declaration for the function member "OnRun();"
to the header file named AutoPPDLG.h. This step also adds an empty
skeleton message handler function named CAutoPPDlg::OnRun() to the file
named AutoPPDLG.cpp.
10. Click ClassWizard on the View menu (or press CTRL+W).
11. Select the Automation tab. Click Add Class and choose
"From a type library." Navigate to select the object library for
the application you wish to automate (for this example,
if you are automating CognosPowerPlay, choose the CognosPowerPlay Object
Library; the default location is
C:/Program Files/ Cognos/cer1/bin/ pwrplay.tlb).
Once you have selected the appropriate object library, click Open.
Select all classes in the Confirm Classes list, and then click OK.
Click OK to close the MFC ClassWizard dialog box.
12. Add the following code to the
CAutoPPApp::InitInstance() function, which loads and enables
the COM services library:
13. BOOL CAutoPPApp::InitInstance()
14. {
15. if(!AfxOleInit()) // Your addition starts here
16. {
17. AfxMessageBox("Could not initialize COM dll");
18. return FALSE;
19. } // End of your addition
20.
21. AfxEnableControlContainer();
22. .
23. .
24. .
25.
26. }
27. Add the following line to the #include statements at the top
of the AutoPP.cpp program file:
28. #include
29. Add the include statement for excel8.h after the include
statement for stdafx.h at the top of the AutoPPDlg.cpp program
file:
30. #include "stdafx.h"
31. #include "pwrplay.h" // pwrplay.h in the case of
CognosPowerPlay6.6
32. Add automation code to the CAutoPPDlg::OnRun() so that it
appears as shown below:
33. void CAutoPPDlg::OnRun()
34. {
35. _DPowerPlayApp app; // app is the CognosPowerPlay
_Application object
36.
37. // Start CognosPowerPlay and get Application object...
38. if(!app.CreateDispatch("CognosPowerPlay.Application "))
39. {
40. AfxMessageBox("Couldn't start CognosPowerPlay.");
41. }
42. else
43. {
44. //Make CognosPowerPlay Visible and display a message
45. app.SetVisible(TRUE);
46. AfxMessageBox ("CognosPowerPlay is Running!");
47. }
48. }
49. Build and run the project. RESULTS: When you click the Run
button in the dialog box, CognosPowerPlay will be launched.
试成功的朋友一定要回贴哦!不过com编程的时代很快又要过去了,看看cognos web service 好牛的东东啊。最后让大家看一个Balanced Scorecard flash,CognosCPM战略中的又一个大手笔! CognosMetricsManager
如何实现自动登陆Windows Common Logon Server?
现在Cognos服务器要移交用户了,但是有一个问题无法解决。就是自动抽取Cube的时候(用脚本实现),如果机器最近重启过,就会弹出一个窗口,需要登陆。有没有那位弟兄用脚本实现了自动登陆的?就是登陆那个窗口右下角的小钥匙的!希望能够告诉我一声!
多谢!
引用:
用脚本不需要 设定了用户类,就可以了
3.
我们是设置了相应的用户类和用户,但是每次机器重启后,需要再次登陆一下,如果没有登陆的话,我们的那个调用程序就停在那里,等待登陆,要命的是抽取总是半夜执行的!
我不清楚,大家要发一份的东西,是脚本吗?
如果是,可以在这里贴阿?干吗要发到邮箱?
我们是用批处理做的。
调用Transfre的脚本是这样的:(需要将COGNOS的安装目录bin加到系统路径中)
trnsfrmr.exe -n -s -k
数据库名称=用户名/密码 path/模型文件名(.mdl.pyi
启动和停止PPES的脚本是:
net stop powerplayserver
net start powerplayserver
至于复制文件的脚本我想就不用多说了。
更新教本要这样写,不能停服务,而是停cube:
ppadmtool connect powerplayserver user "administrator" password "" disable cubename
trnsfrmr.exe -n -s -k
数据库名称=用户名/密码 path/模型文件名(.mdl.pyi
ppadmtool connect powerplayserver user "administrator" password "" enable cubename

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

1

添加新评论0 条评论

Ctrl+Enter 发表

作者其他文章

相关文章

相关问题

相关资料

X社区推广