Level 1 Complete Review & Mastery

Level 1 Summary (1.1 - 1.4), 10 Production Challenges & 35 Mega Quizzes

สรุปเนื้อหาระดับ Core Fundamentals พร้อมสนามประลองถอดรหัสภาพ 10 ข้อ และคลังข้อสอบ 35 ข้อ

1. สรุปภาพรวมเนื้อหา Level 1: Core Fundamentals (1.1 - 1.4)

⚙️ 1.1 Lifecycle & Compilation Context
• Pre-compilation vs Runtime: ห้ามเรียก JasperCompileManager.compileReport() ใน Request Loop เด็ดขาด เพื่อป้องกัน Metaspace OOM Crash จาก Dynamic Classloading
• Shared Context: JasperReportsContext ต้องเป็น Singleton Registry เพื่อแชร์ Configuration, Extensions และ Font Registry ส่วนกลาง
• JasperReport Blueprint: อ็อบเจกต์ .jasper คือแบบแปลนที่ถูกแคชบน Heap นำมาใช้ซ้ำข้ามเธรดได้อย่างปลอดภัย (Thread-safe)
📏 1.2 Band Architecture & Stretch Defense
• Sequential Band Flow: Title → Page Header → Column Header → Detail → Column Footer → Page Footer → Summary
• Pagination Boundaries: ผลรวมความสูงคงที่ของ Header และ Footer ต้องไม่เกินความสูงหน้ากระดาษ (pageHeight - margins)
• Stretch Mechanics: ควบคุมการตัดแถวด้วย splitType="Prevent" (ห้ามผ่าแถวกลางคัน) และดัน Element ด้านล่างด้วย positionType="Float"
🎯 1.3 Precision Layout & Unified Element Model
• Unified 7.0.x Schema: บังคับใช้ <element kind="..."> (เช่น kind="textField", kind="staticText") เลิกใช้แท็กโบราณเด็ดขาด
• Grid Coordinate System: พิกัด X, Y, Width, Height วัดเป็น Points (72 dpi) ต้องจัดแนวชิดเป๊ะระดับ Pixel ป้องกัน Spurious Merged Cells เมื่อส่งออก Excel
• Box & Border Pipeline: กำหนด Padding และ Border รอบกล่องเพื่อรักษาโครงสร้าง Grid ให้คงที่
⏱️ 1.4 Data Pipeline & Evaluation Time
• Three Constructs: Parameters ($P{} รับค่าภายนอก), Fields ($F{} แมปจากเคอร์เซอร์ข้อมูล), Variables ($V{} สะสมยอดคำนวณ)
• Evaluation Timing Engine: evaluationTime="Now" (อ่านค่าทันที ณ แถวนั้น) เทียบกับ evaluationTime="Report" (ชะลอการวาดจนประมวลผลจบเล่ม)
• Premature Zero Bug: การแสดงยอด Grand Total ใน Title หรือ Header โดยไม่ตั้ง evaluationTime="Report" จะได้ค่าเริ่มต้น (0 หรือ null) เสมอ
Sub-topic องค์ประกอบหลัก (JRXML Elements) จุดตายบน Production (Hazard) ทางแก้เชิงสถาปัตยกรรม (Architecture Defense)
1.1 Lifecycle JasperCompileManager, JasperReport, JasperPrint Compile JRXML ทุก HTTP Request → Metaspace OOM Crash Pre-compile เป็น .jasper หรือแคชแบบแปลน Singleton
1.2 Bands <band>, splitType, positionType="Float" ข้อความยาวดันขยาย → ตัวอักษรทับซ้อนหรือแถวถูกผ่ากลางตัวหนังสือ ตั้ง positionType="Float" และกำหนด splitType="Prevent"
1.3 Layout <element kind="textField">, <box> พิกัด X/Width เหลื่อมกัน 1pt → คอลัมน์ Excel แตกและ Merge เละ จัดแนวชิดเส้นกริด Snap-to-Grid และใช้ stretchType="ElementGroupHeight"
1.4 Pipeline $P{}, $F{}, $V{}, evaluationTime ยอด Grand Total แสดงเป็น 0.00 ในส่วนหัวเอกสาร ตั้งค่า evaluationTime="Report" บน TextField เพื่อรอรอบสุดท้าย

2. สนามประลองถอดรหัสภาพ 10 มหาโจทย์ (Level 1 The Colosseum)

เขียน JRXML 7.0.x ให้ตรงตามเป้าหมายของแต่ละข้อ ภายใต้ Allowed/Disallowed Constraints:

⚔️ Core Architecture Challenge Progress
PASSED: 0 / 10 (0%)

3. คลังข้อสอบวัดกึ๋นระดับสถาปัตยกรรม (35 Mega Quizzes)

ทดสอบความเข้าใจลึกระดับ JVM, Filler Engine, Band Lifecycle และ Evaluation State Machine (ข้อ 1 ถึง 35):

⚡ Real-time Mega Quiz Score Tracker
คะแนน: 0 / 35 (0%) | ตอบแล้ว: 0 / 35