Class: Aspose::Cloud::Cells::Worksheet

Inherits:
Object
  • Object
show all
Defined in:
lib/Cells/worksheet.rb

Instance Method Summary collapse

Constructor Details

#initialize(filename, worksheet_name) ⇒ Worksheet

Returns a new instance of Worksheet.



6
7
8
9
# File 'lib/Cells/worksheet.rb', line 6

def initialize(filename,worksheet_name)
  @filename = filename
  @worksheet_name = worksheet_name
end

Instance Method Details

#add_picture(picture_path, picture_location, upper_left_row, upper_left_column, lower_right_row, lower_right_column) ⇒ Object



784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
# File 'lib/Cells/worksheet.rb', line 784

def add_picture(picture_path,picture_location, upper_left_row, upper_left_column, lower_right_row, lower_right_column)
  begin
    if(@filename=='')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name=='')
      raise 'Worksheet Name is not specified'
    end
    if(picture_location == 'Server' || picture_location == 'server')
      str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/pictures?upperLeftRow=' +upper_left_row.to_s + '&upperLeftColumn=' + upper_left_column.to_s + '&lowerRightRow=' +lower_right_row.to_s + '&lowerRightColumn=' + lower_right_column.to_s + '&picturePath=' + picture_path
      signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
      response = RestClient.put(signed_uri, :accept=>'application/json')
    else
      if(!File.exist?(picture_path))
        raise "File doesn't exists"
      end
      str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/pictures?upperLeftRow=' +upper_left_row.to_s + '&upperLeftColumn=' + upper_left_column.to_s + '&lowerRightRow=' +lower_right_row.to_s + '&lowerRightColumn=' + lower_right_column.to_s 
      stream = File.new(picture_path,'rb')
      signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
      response = RestClient.put(signed_uri,stream, :accept=>'application/json')
    end
    json = JSON.parse(response)
    if(json['Code'] == 200)
      return true
    else
      return false
    end
  rescue Exception=>e
    print e
  end
      
end

#calculate_formula(formula = '') ⇒ Object



594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
# File 'lib/Cells/worksheet.rb', line 594

def calculate_formula(formula = '')
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/formulaResult?formula=' + formula.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Value']
              
  rescue Exception=>e
    print e
    return nil
  end
end

#delete_row(row_index) ⇒ Object



681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
# File 'lib/Cells/worksheet.rb', line 681

def delete_row(row_index)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/cells/rows/' + row_index.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.delete(signed_uri,:accept => 'application/json' )
    json = JSON.parse(response)
    if(json['Code']==200)
      return true
    else
      return false
    end
              
  rescue Exception=>e
    print e
    return false
  end
end

#get_auto_shapes_by_index(index) ⇒ Object



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/Cells/worksheet.rb', line 154

def get_auto_shapes_by_index(index)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/autoshapes/' + index.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['AutoShapes']
              
  rescue Exception=>e
    print e
    return nil
  end
end

#get_auto_shapes_countObject



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/Cells/worksheet.rb', line 133

def get_auto_shapes_count
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/autoshapes'

    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['AutoShapes']['AuotShapeList'].count
              
  rescue Exception=>e
    print e
    return -1
  end
end

#get_cell(cell_name) ⇒ Object



174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/Cells/worksheet.rb', line 174

def get_cell(cell_name)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/cells/' + cell_name
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Cell']
              
  rescue Exception=>e
    print e
    return nil
  end
end

#get_cell_style(cell_name) ⇒ Object



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/Cells/worksheet.rb', line 194

def get_cell_style(cell_name='')
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/cells/' + cell_name + '/style'
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Style']
              
  rescue Exception=>e
    print e
    return nil
  end
end

#get_cells_count(offset, count) ⇒ Object



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/Cells/worksheet.rb', line 112

def get_cells_count(offset,count)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name 
    str_uri += '/cells?offset=' + offset.to_s + '&count=' + count.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Cells']['CellCount']
              
  rescue Exception=>e
    print e
    return 0
  end
end

#get_cells_list(offset, count) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/Cells/worksheet.rb', line 11

def get_cells_list(offset,count)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name 
    str_uri += '/cells?offset=' + offset.to_s + '&count=' + count.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Cells']['CellList']
              
  rescue Exception=>e
    print e
  end
end

#get_chart_by_index(index) ⇒ Object



239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/Cells/worksheet.rb', line 239

def get_chart_by_index(index)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/charts/' + index.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Chart']
              
  rescue Exception=>e
    print e
    return nil
  end
end

#get_charts_countObject



458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
# File 'lib/Cells/worksheet.rb', line 458

def get_charts_count
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/charts'
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Charts']['ChartList'].count
              
  rescue Exception=>e
    print e
    return -1
  end
end

#get_column(column_index) ⇒ Object



730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
# File 'lib/Cells/worksheet.rb', line 730

def get_column(column_index)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/cells/columns/' + column_index.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri,:accept => 'application/json' )
    json = JSON.parse(response)
    return json['Column']                    
  rescue Exception=>e
    print e
    return false
  end
end

#get_columns_list(offset, count) ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/Cells/worksheet.rb', line 51

def get_columns_list(offset,count)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name 
    str_uri += '/cells/columns?offset=' + offset.to_s + '&count=' + count.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Columns']['ColumnsList']
              
  rescue Exception=>e
    print e
  end
end

#get_comment(cell_name = '') ⇒ Object



279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# File 'lib/Cells/worksheet.rb', line 279

def get_comment(cell_name='')
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/comments/' + cell_name.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Comment']
              
  rescue Exception=>e
    print e
    return nil
  end
end

#get_comments_countObject



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
# File 'lib/Cells/worksheet.rb', line 478

def get_comments_count
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/comments'
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Comments']['CommentList'].count
              
  rescue Exception=>e
    print e
    return -1
  end
end


259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/Cells/worksheet.rb', line 259

def get_hyperlink_by_index(index)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/hyperlinks/' + index.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Hyperlink']
              
  rescue Exception=>e
    print e
    return nil
  end
end


498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
# File 'lib/Cells/worksheet.rb', line 498

def get_hyperlinks_count
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/hyperlinks'
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Hyperlinks']['HyperlinkList'].count
              
  rescue Exception=>e
    print e
    return -1
  end
end

#get_max_columns(offset, count) ⇒ Object



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/Cells/worksheet.rb', line 71

def get_max_columns(offset,count)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name 
    str_uri += '/cells?offset=' + offset.to_s + '&count=' + count.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Cells']['MaxColumn']
              
  rescue Exception=>e
    print e
    return 0
  end
end

#get_max_row(offset, count) ⇒ Object



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/Cells/worksheet.rb', line 91

def get_max_row(offset,count)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name 
    str_uri += '/cells?offset=' + offset.to_s + '&count=' + count.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Cells']['MaxRow']
              
  rescue Exception=>e
    print e
    return 0
  end
end

#get_mergedcell_by_index(index) ⇒ Object



358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# File 'lib/Cells/worksheet.rb', line 358

def get_mergedcell_by_index(index)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/mergedCells/' + index.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['MergedCell']
              
  rescue Exception=>e
    print e
    return nil
  end
end

#get_mergedcells_countObject



378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/Cells/worksheet.rb', line 378

def get_mergedcells_count
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/mergedCells'
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['MergedCells']['Count']
              
  rescue Exception=>e
    print e
    return -1
  end
end

#get_oleobject_by_index(index) ⇒ Object



299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/Cells/worksheet.rb', line 299

def get_oleobject_by_index(index)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/oleobjects/' + index.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['OleObject']
              
  rescue Exception=>e
    print e
    return nil
  end
end

#get_oleobjects_countObject



438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
# File 'lib/Cells/worksheet.rb', line 438

def get_oleobjects_count
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/oleobjects'
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['OleObjects']['OleOjectList'].count
              
  rescue Exception=>e
    print e
    return -1
  end
end

#get_picture_by_index(index) ⇒ Object



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/Cells/worksheet.rb', line 318

def get_picture_by_index(index)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/pictures/' + index.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Picture']
              
  rescue Exception=>e
    print e
    return nil
  end
end

#get_pictures_countObject



418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
# File 'lib/Cells/worksheet.rb', line 418

def get_pictures_count
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/pictures'
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Pictures']['PictureList'].count
              
  rescue Exception=>e
    print e
    return -1
  end
end

#get_row_list(offset, count) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/Cells/worksheet.rb', line 31

def get_row_list(offset,count)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name 
    str_uri += '/cells/rows?offset=' + offset.to_s + '&count=' + count.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Rows']['RowsList']
              
  rescue Exception=>e
    print e
  end
end

#get_rows(row_index) ⇒ Object



660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
# File 'lib/Cells/worksheet.rb', line 660

def get_rows(row_index)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/cells/rows/' + row_index.to_s

    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri,:accept => 'application/json' )
    json = JSON.parse(response)
    return json['Row']
              
  rescue Exception=>e
    print e
    return nil
  end
end

#get_rows_count(offset, count) ⇒ Object



639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
# File 'lib/Cells/worksheet.rb', line 639

def get_rows_count(offset,count)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name 
    str_uri += '/cells/rows?offset=' + offset.to_s + '&count=' + count.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri,:accept => 'application/json' )
    json = JSON.parse(response)
    return json['Rows']['RowsCount']
              
  rescue Exception=>e
    print e
    return -1
  end
end

#get_validation_by_index(index) ⇒ Object



338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
# File 'lib/Cells/worksheet.rb', line 338

def get_validation_by_index(index)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/validations/' + index.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Validation']
              
  rescue Exception=>e
    print e
    return nil
  end
end

#get_validations_countObject



398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'lib/Cells/worksheet.rb', line 398

def get_validations_count
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/validations'
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.get(signed_uri, :accept => 'application/json' )
    json = JSON.parse(response)
    return json['Validations']['Count']
              
  rescue Exception=>e
    print e
    return -1
  end
end

#hide_worksheetObject



518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
# File 'lib/Cells/worksheet.rb', line 518

def hide_worksheet
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/visible?isVisible=false'
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.put(signed_uri, '',:accept => 'application/json' )
    json = JSON.parse(response)
    if(json['Code']==200)
      return true
    else
      return false
    end
              
  rescue Exception=>e
    print e
    return false
  end
end

#move_worksheet(worksheet_name = '', position) ⇒ Object



566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
# File 'lib/Cells/worksheet.rb', line 566

def move_worksheet(worksheet_name = '',position)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    field_array = Hash.new
    field_array['DestinationWorsheet'] = worksheet_name.to_s
    field_array['Position'] = position.to_s
    json_data = field_array.to_json
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/position'
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.post(signed_uri, json_data,:accept => 'application/json' )
    json = JSON.parse(response)
    if(json['Code']==200)
      return true
    else
      return false
    end
              
  rescue Exception=>e
    print e
    return false
  end
end

#set_cell_style(cell_name = '', style) ⇒ Object



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/Cells/worksheet.rb', line 214

def set_cell_style(cell_name='',style)
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    json_data = style.to_json
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/cells/' + cell_name + '/style'
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.post(signed_uri,json_data, :accept => 'application/json' )
    json = JSON.parse(response)
    if(json['Code'] == 200)
      return true
    else
      return false
    end
              
  rescue Exception=>e
    print e
    return false
  end
end

#set_cell_value(cell_name = '', value_type = '', value = '') ⇒ Object



614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
# File 'lib/Cells/worksheet.rb', line 614

def set_cell_value(cell_name='',value_type='',value='')
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name 
    str_uri += '/cells/' + cell_name.to_s + '?value=' + value.to_s + '&type=' + value_type.to_s
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.post(signed_uri,'' ,:accept => 'application/json' )
    json = JSON.parse(response)
    if(json['Code']==200)
      return true
    else 
      return false
    end
              
  rescue Exception=>e
    print e
    return false
  end
end

#sort_data(data_sort, cell_area = '') ⇒ Object



705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
# File 'lib/Cells/worksheet.rb', line 705

def sort_data(data_sort,cell_area = '')
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/sort?' + cell_area.to_s
    json_data = data_sort.to_json
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.post(signed_uri,json_data,:accept => 'application/json' )
    json = JSON.parse(response)
    if(json['Code']==200)
      return true
    else
      return false
    end
              
  rescue Exception=>e
    print e
    return false
  end
end

#unhide_worksheetObject



542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
# File 'lib/Cells/worksheet.rb', line 542

def unhide_worksheet
  begin
    if(@filename == '')
      raise 'Base File Name is not specified'
    end
    if(@worksheet_name == '')
      raise 'Worksheet Name is not specified'
    end
    str_uri = $product_uri + '/cells/' + @filename + '/worksheets/' + @worksheet_name + '/visible?isVisible=true'
    signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)
    response = RestClient.put(signed_uri, '',:accept => 'application/json' )
    json = JSON.parse(response)
    if(json['Code']==200)
      return true
    else
      return false
    end
              
  rescue Exception=>e
    print e
    return false
  end
end