@@ -1021,6 +1021,71 @@ Set a raw query to execute.
10211021 */
10221022- (void )exec : (void (^) (BuiltResponseType type, BuiltQueryResult * BUILT_NULLABLE_P result, NSError * BUILT_NULLABLE_P error))completionBlock ;
10231023
1024+ // MARK: - Export Excel
1025+ /* *---------------------------------------------------------------------------------------
1026+ * @name Export Excel
1027+ * ---------------------------------------------------------------------------------------
1028+ */
1029+ /* *
1030+ exports excel file asyncronously from Built.io Backend server to app
1031+
1032+ //Obj-C
1033+ BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
1034+ BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
1035+ BuiltQuery *query = [projectClass query];
1036+ [query exportToExcel:^(BuiltResponseType responseType, NSString * _Nonnull filePath, NSError * _Nonnull error) {
1037+
1038+ }
1039+
1040+ //Swift
1041+ var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
1042+ var projectClass:BuiltClass = builtApplication.classWithUID("project")
1043+ let query:BuiltQuery = builtApplication.userQuery()
1044+ query.export { (responseType, filePath, error) in
1045+
1046+ }
1047+ }
1048+
1049+ @param completionBlock Completion block with params (BuiltResponseType responseType, NSString * BUILT_NULLABLE_P filePath, NSError * BUILT_NULLABLE_P error)
1050+
1051+ */
1052+ - (void )exportToExcel : (void (^) (BuiltResponseType responseType, NSString * BUILT_NULLABLE_P filePath, NSError * BUILT_NULLABLE_P error))completionBlock ;
1053+
1054+ /* *
1055+ exports excel file asyncronously from Built.io Backend server to app
1056+
1057+ //Obj-C
1058+ BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
1059+ BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
1060+ BuiltQuery *query = [projectClass query];
1061+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
1062+ NSString *documentsDirectory = [paths objectAtIndex:0];
1063+ NSString *folderPath = [documentsDirectory stringByAppendingPathComponent:@"/UserFolder"];
1064+ [query exportToExcelAtPath:folderPath completion:^(BuiltResponseType responseType, NSString * _Nonnull filePath, NSError * _Nonnull error) {
1065+
1066+ }
1067+
1068+ //Swift
1069+ var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
1070+ var projectClass:BuiltClass = builtApplication.classWithUID("project")
1071+ let query:BuiltQuery = projectClass.userQuery()
1072+ let fileManager = FileManager.default
1073+ if let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask).first {
1074+ let folderPath = documentsDirectory.appendingPathComponent("/UserFolder").path
1075+ query.exportToExcel(atPath: folderPath) { (responseType, filePath, error) in
1076+
1077+ }
1078+ }
1079+
1080+ @param folderPath should be valid path with read and write permission where we wish to export to.
1081+ @param completionBlock Completion block with params (BuiltResponseType responseType, NSString * BUILT_NULLABLE_P filePath, NSError * BUILT_NULLABLE_P error)
1082+
1083+ @note folderPath should have read/write permission.
1084+
1085+ */
1086+ - (void )exportToExcelAtPath : (NSString *)folderPath completion : (void (^) (BuiltResponseType responseType, NSString * BUILT_NULLABLE_P filePath, NSError * BUILT_NULLABLE_P error))completionBlock ;
1087+
1088+
10241089// MARK: Cancel execution -
10251090/* *---------------------------------------------------------------------------------------
10261091 * @name Cancel execution
0 commit comments