C++ ile Sayfa Sekmesi Çubuğunu Nasıl Kontrol Edilir
Contents
[
Hide
]
Olası Kullanım Senaryoları
Excel sayfa çubuğunun görüntüsünü ayarlamanız gerektiğinde, sayfa sekmesi çubuğunu nasıl kontrol edeceğinizi bilmeniz gerekir; örneğin, sayfa sekmesi çubuğunu gizleme veya gösterme, sayfa sekmesi genişliğini değiştirme, ilk görünür sekmeyi belirleme ve bunun gibi. Aspose.Cells bu özellikleri destekler. Aspose.Cells, hedeflerinize ulaşmanız için aşağıdaki özellikleri ve yöntemleri sağlar.
- WorkbookSettings.GetShowTabs()
- WorkbookSettings.GetSheetTabBarWidth()
- WorkbookSettings.GetFirstVisibleTab()
Aspose.Cells for C++ kullanarak Sayfa Sekmesi Çubuğunu Nasıl Kontrol Edilir
Bu örnek aşağıdakileri göstermektedir:
- Bir çalışma kitabı oluşturma.
- İlk çalışma sayfasındaki hücrelere veri ekleme.
- Sayfa sekmesini görüntüleyin ve sekme çubuğunun genişliğini ayarlayın.
#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
int main()
{
Aspose::Cells::Startup();
// Create a Workbook object
Workbook workbook;
// Obtain the reference to the newly added worksheet
Worksheet ws = workbook.GetWorksheets().Get(0);
Cells cells = ws.GetCells();
// Setting the value to the cells
Cell cell = cells.Get(u"A1");
cell.PutValue(u"Fruit");
cell = cells.Get(u"B1");
cell.PutValue(u"Count");
cell = cells.Get(u"C1");
cell.PutValue(u"Price");
cell = cells.Get(u"A2");
cell.PutValue(u"Apple");
cell = cells.Get(u"A3");
cell.PutValue(u"Mango");
cell = cells.Get(u"A4");
cell.PutValue(u"Blackberry");
cell = cells.Get(u"A5");
cell.PutValue(u"Cherry");
// Display the sheet tab and set the width of the tab bar
workbook.GetSettings().SetShowTabs(true);
workbook.GetSettings().SetSheetTabBarWidth(150);
// Save the workbook
workbook.Save(u"out.xlsx");
std::cout << "Workbook saved successfully!" << std::endl;
Aspose::Cells::Cleanup();
}
Sonuç dosyası önizlemesi: