【仅供内部供应商使用,不提供对外解答和培训】

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

下面详细介绍下服务器返回的目录树结构数组reportsArray:
reportsArray数组里的元素类型都是IFEntryNode;
IFEntryNode可以是文件夹,也可以是具体报表,可以通过方法[node isFolder]来判断;
如果node是文件夹,可以通过[node children]方法来获取文件夹下的子元素数组,仍然为IFEntryNode的数组对象;
如果node是报表类型,可以通过[[IFEntryViewController alloc] initWithEntry:node]的方式创建出报表视图控制器,并展示报表。    

5. 如何获取决策系统里已经收藏的报表?

 


Code Block
//第一步,登录服务器
[IFIntegrationUtils logInto:DEFAULT_SERVERNAME serverUrl:url withUsername:username andPassword:password success:^{
    //第二步,登录成功,获取收藏夹报表数组
    [IFIntegrationUtils favorites:^(NSMutableArray *favorites) {
    	//第三步,根据收藏夹报表自定义展示页面
    } failure:^(NSString *message) {
    }];
} failure:^(NSString *msg) {
}];

...

获取的收藏夹报表数组,一样全是IFEntryNode对象,可以采取一样的方式展示报表。

...

可参考微信开放平台中的iOS接入指南

7. 怎么登出服务器?

 


Code Block
[IFIntegrationUtils logout];

8. OEM定制的App,都支持定制哪些内容?

a. 因为OEM是一个新的工程,可以设置App的图标和名称,因此不需要调用额外的接口就能达到修改App图标和名称的目的;

b. 第一次打开App时,默认服务器列表的定制:

1.	删除FR的默认服务器:

		
Code Block
[IFOEMUtils removeDemoServer];
		
2.	增加一个默认服务器:

		
Code Block
[IFOEMUtils addServerWithName:(NSString *)serverName andURL:(NSString *)serverURL addUsername:(NSString *)username addPassword:(NSString *)password userEditable:(BOOL)userEditable];

...

		serverName:服务器名称;			

		serverURL:服务器地址;

		username:默认用户名(可为空);

		password:默认密码(可为空);

		userEditable:用户名,密码,以及服务器名称地址是否允许用户修改。

c. 关于页面的定制:

1.	去除FR默认的关于页面:

		
Code Block
[IFOEMUtils removeAbout];

...

2.	自定义关于页面上的信息:

		
Code Block
[IFOEMUtils setAppVersion:(NSString *) version];//设置版本号
		[IFOEMUtils setCopyright:(NSString *) copyRight];//设置版权信息
		[IFOEMUtils setAppIconName:(NSString *) iconName];//设置关于页面里的图标。

d. App内默认消息提醒样式的定制:FR内默认消息提醒采用顶部出现会自动消失的蓝色(正常提示消息)或红色(错误/警告消息)提醒消息。如果想使用符合自己App风格的提示消息,可以使用:

...

Code Block
[IFOEMUtils setMessageHandler:(void (^) (NSString *message, BOOL isSuccess)) handler];

...

	message:消息内容;
	handler:消息处理函数(isSuccess:表示消息是否只是提醒消息。YES:只是提示;NO:错误/警告)。

e. App右上角为设置按钮,支持放置自定义按钮:

Code Block

...

[IFOEMUtils setAppSettingBarButtonItem:(UIBarButtonItem *) settingItem];

...

 settingItem:设置按钮。

9. 集成时如何支持报表离线预览

首先,在AppDelegate中的didFinishLaunchingWithOptions方法创建离线所需要的数据库表:

Code Block
[IFIntegrationUtils createTable];

然后,使用第8个问题中,自定义右上角设置按钮的方式,创建自定义的设置按钮,点击事件打开FR内置的设置界面

Code Block
IFFrameAppSettingViewController *settingViewController = [[IFFrameAppSettingViewController alloc] initWithCustomItems:customItems];

...

customItems:是个二维数组,设置界面中除了离线相关的按钮外,还可以自己添加按钮,元素类型为一组关联的设置按钮组,按钮类型为:IFFrameAppSettingItem。

...

例如:添加一个注销按钮:
Code Block
IFFrameAppSettingItem *logoutItem = [[IFFrameAppSettingItem alloc] initWithTitle:@"注销" andAction:^(UITableViewCell *selectedCell) {
    [IFIntegrationUtils logOut];
    [self dismissViewControllerAnimated:YES completion:nil];
}];
NSArray *logOutSection = [[NSArray alloc] initWithObjects:logoutItem, nil];
NSArray *customItems = [[NSArray alloc] initWithObjects:logOutSection, nil];
IFFrameAppSettingViewController *settingViewController = [[IFFrameAppSettingViewController alloc] initWithCustomItems:customItems];

10. 如何让App支持修改密码

说明:如果用户是管理员,则任何时候可修改密码;如果服务器是同步数据集或者开启了http认证/ldap认证,则是不支持修改密码的。符合条件后,可以通过如下方式修改密码:

Code Block
//首先登录
[IFIntegrationUtils logInto:DEFAULT_SERVERNAME serverUrl:url withUsername:username andPassword:password success:^{
	//登录成功后通过此方法获知服务器是否支持修改密码
    if([IFIntegrationUtils canChangePassword]) {
    	//这时候,需要2个参数,原始密码和新密码;这边可以写自己的修改密码让用户输入,比对2次输入是否相同等。假如这边已经拿到原始密码originalPassword和新密码newPassword,则调用
    	[IFIntegrationUtils changePassword:originalPassword newPassword:newPassword success:^{
    		//修改成功
		} failure:^(NSString *message) {
			//修改失败,旧密码有误
		}];
    } else {
    	//服务器不支持修改密码
    }
} failure:^(NSString *msg) {
	//登录失败
}];

11. 如何在集成的App里支持信鸽推送?

首先需要到信鸽开发中心上注册自己的App,关于证书和程序绑定,上面都会有详细的教程。

...

客户端需要调用接口来注册程序的ACCESSID和ACESSKEY

Code Block
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
	[IFOEMUtils setXinGeAppId:123456788];	//access id
	[IFOEMUtils setXinGeAppKey:@"ISHGJ5A7342D"];//accesskey
	//do somethigs
	return YES;
}

如果是OEM集成,客户端做这些就可以了。如果是一般集成,在AppDelegate中还需要做如下注册信鸽的设置:

Code Block
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { 
	NSString * deviceTokenStr = [XGPush registerDevice:deviceToken];
	[XGPush registerDevice:deviceToken];
	[IFIntegrationUtils setDeviceToken:deviceTokenStr];//必须,在程序里记录设备。
}
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
{
	[application registerForRemoteNotifications];
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{
	// 处理推送消息
}

服务器端也需要借助信鸽推送插件来做相应的设置,设置好scretKey和accessId。

...

在通过IFIntegrationUtils loadReportTree方法获取到IFEntryNode数组后,对每一个entryNode,使用

Code Block
[IFIntegrationUtils readEntryImage:entryNode.entryId coverId:entryNode.coverId sucess:^(UIImage *image) {
        //image就是服务器端配置的缩略图,这个方法是做过缓存处理的,不用担心每次都会向服务器发请求。
}];

...

13. 如何展示非全屏的报表 说明:目前不支持填报报表的非全屏展现,只支持单页分页/表单的展现

Code Block
IFEntryView *entryView = [[IFEntryView alloc] initWithPath:@"app/DetailedDrillA-phone.cpt" serverUrl:@"http://www.finereporthelp.com:8889/app/ReportServer" viewType:IFEntryViewTypePage parameters:nil];
[entryView setFrame:CGRectMake(0, 64, 800, 600)];
entryView.entryViewDelegate = self;
[self.view addSubview:entryView];
[entryView doLoad];	//加载报表

使用报表视图的对象,需要实现IFEntryViewDelegate中的方法,让报表正常展示

Code Block
-(void)pushHyperLink:(UIViewController *)viewController withAnimate:(BOOL)animate {

...


//处理报表View超级链接产生的视图控制器。

...


}

14. 如何支持国际化

1.打开工程,supporting files目录下新建Localizable.strings国际化基础文件,(demo里面的目前仅支持中文简体,中文繁体及英文语言环境(chinese simple,chinese traditional,english))。 详细教程见:http://blog.sina.com.cn/s/blog_7b9d64af0101jncz.html或者网上搜索ios如何国际化.

...