- A4 page size with proper margins (1.5cm top/bottom, 1cm sides)
- Black and white optimized for physical printing
- Proper page breaks to avoid content splitting
- Table headers repeat on each page
- All decorative elements hidden for clean output
- Automatically expands all accordion sections before printing
- Shows complete invoice details and line items
- 100ms delay ensures DOM updates before print dialog
- Hero Section: Compact header with report title, date range, and KPIs
- Filters: Shows active filters (date range, cashier, payment method, status)
- Tables: Bordered tables with proper spacing, 8pt font for readability
- Accordions: All expanded to show full invoice details
- Buttons/UI Elements: Hidden (toolbar, tabs, action buttons)
- Go to
http://localhost:5173/reports - Wait for data to load (you should see invoices from the last 7 days)
- Click the Print button in the toolbar
- Expected Result:
- Print dialog opens
- Preview shows:
- Clean header with "Operational Reports" title
- Date range displayed
- KPI metrics (Invoices, Gross Total, Average Ticket)
- All day sections expanded
- All invoice rows expanded with line items
- Clean black borders on tables
- No buttons or colored backgrounds
- On the Reports page, set filters:
- Change date range to "This Week"
- Select a specific cashier
- Choose payment method (e.g., "Cash")
- Click Print
- Expected Result:
- Print preview shows filtered data only
- Active filters are visible in the filters section
- Only matching invoices appear
- Switch to Product Sales tab
- Click Print
- Expected Result:
- Product sales table prints with:
- Product name, quantity sold, revenue, orders count
- Totals row at bottom
- Clean table formatting
- Product sales table prints with:
- Set date range to a future date (e.g., tomorrow)
- Click Print
- Expected Result:
- Shows "No invoices for this range" message
- Still prints header and filters section
- Set date range to "Last 30 Days" (if you have many orders)
- Click Print
- Expected Result:
- Content spans multiple pages
- Table headers repeat on each page
- No content is cut off mid-row
- Page numbers appear (if supported by browser)
Use this checklist when testing the print functionality:
- All text is black (no gray or colored text)
- Tables have clear borders
- No overlapping content
- Proper spacing between sections
- Font sizes are readable (8-10pt for tables, 11-18pt for headers)
- Report title and date range visible
- KPI metrics displayed
- All accordion sections expanded
- All invoice line items visible
- Totals and subtotals included
- Active filters shown
Hidden Elements
- No toolbar buttons visible
- No tab navigation visible
- No "Refresh" or "Export" buttons
- No hover effects or shadows
- No quick range selector pills
- Content fits within page margins
- No horizontal scrolling needed
- Tables don't overflow page width
- Page breaks occur at logical points
- Headers repeat on multi-page tables
- Press
Ctrl+P(Windows/Linux) orCmd+P(Mac) - In print dialog:
- Destination: Save as PDF (for testing) or select printer
- Layout: Portrait
- Margins: Default
- Scale: 100%
- Background graphics: OFF (for clean print)
- Press
Ctrl+PorCmd+P - Similar settings as Chrome
- Firefox may show page numbers differently
- Press
Cmd+P - Check "Print backgrounds" is OFF
- Scale should be 100%
Problem: Tables or text are cut off at page edges Solution:
- Check that scale is set to 100% in print dialog
- Verify margins are set to "Default" or "Normal"
- If still cut off, the CSS may need adjustment for narrower margins
Problem: Some accordion sections are still collapsed Solution:
- This should be automatic, but if it fails:
- Manually click to expand all sections before printing
- Check browser console for JavaScript errors
Problem: Backgrounds or colored text visible in print Solution:
- Ensure "Background graphics" is turned OFF in print settings
- The CSS uses
!importantflags to force black text
Problem: Action buttons appear in print preview Solution:
- This indicates the print CSS isn't loading
- Hard refresh the page:
Ctrl+Shift+RorCmd+Shift+R - Check browser console for CSS errors
Your database currently has:
- 68 orders total
- Latest order: November 7, 2025
- Default view: Last 7 days (Nov 2-8, 2025)
To test with more data:
- Create orders using the POS page (
/pos) - Or use the online shop to place test orders
- Vary payment methods, cashiers, and dates for comprehensive testing
When you click Print, the system automatically:
- Expands all day accordion sections
- Expands all invoice detail rows
- Waits 100ms for DOM updates
- Opens print dialog with complete data
Multi-page prints automatically repeat table headers on each page for easy reading.
The CSS prevents awkward page breaks:
- Hero section stays together
- Filter section stays together
- Invoice rows don't split across pages
- Subtables stay with parent rows
The print functionality is working correctly if:
- ✅ Print preview opens within 1 second of clicking Print
- ✅ All accordion sections are expanded automatically
- ✅ Content is black and white with clear borders
- ✅ No UI buttons or decorative elements visible
- ✅ Tables fit within page width without horizontal scroll
- ✅ Multi-page prints have proper page breaks
- ✅ Printed/PDF output matches the preview
- ✅ Report is readable and professional-looking
If you encounter issues:
- Check browser console for errors (F12 → Console tab)
- Try a different browser (Chrome recommended)
- Verify you're on the latest version of the code
- Test with a smaller date range first (e.g., "Today" or "Yesterday")
# Ensure frontend is running
cd /home/naji/Desktop/mern-pos/frontend
npm run dev
# Ensure backend is running
cd /home/naji/Desktop/mern-pos/backend
npm run dev
# Open in browser
# Navigate to: http://localhost:5173/reports
# Click Print button
# Verify output matches this guideLast Updated: November 8, 2025
Version: 1.0
Status: ✅ Ready for Testing