شروع سریع
ایجاد یک کتابکار در 5 دقیقه
پس از نصب وابستگی Maven، یک کتابکار ایجاد کنید،
مقادیر سلولها را تنظیم کنید، قالببندی پایهای را اعمال کنید و در .xlsx ذخیره کنید:
import com.aspose.cells_foss.Cell;
import com.aspose.cells_foss.Style;
import com.aspose.cells_foss.Workbook;
import com.aspose.cells_foss.Worksheet;
public class QuickStart {
public static void main(String[] args) {
try (Workbook workbook = new Workbook()) {
Worksheet sheet = workbook.getWorksheets().get(0);
sheet.setName("Report");
sheet.getCells().get("A1").putValue("Revenue");
Cell b1 = sheet.getCells().get("B1");
b1.putValue(12500.75);
Style style = b1.getStyle();
style.getFont().setBold(true);
style.setCustom("#,##0.00");
b1.setStyle(style);
sheet.getCells().getRows().get(0).setHeight(22.0);
sheet.getCells().getColumns().get(1).setWidth(14.5);
workbook.save("report.xlsx");
System.out.println("report.xlsx created.");
}
}
}مراحل بعدی
- راهنمای توسعهدهنده — کاوش در تمام ویژگیها
- مرجع API — مرور کامل API