User Guide - Import/Export Functionality
Last Updated: November 23, 2025 at 10:47 PMImport/Export Functionality Guide
Overview
The application now supports:
- Import Projects from Excel files for bulk project creation
- Export BOQ (Bill of Quantities) in XLSX and PDF formats with complete pricing
📥 IMPORT FUNCTIONALITY
How to Import a Project
- Navigate to Projects Page
- Go to
/projects/ - Click "Import Project" button
- Download Template (Optional but Recommended)
- Click "Download Template" button
- This downloads an Excel file with the correct structure
- Fill in the Template
- Open the downloaded template
- Fill in your project data following the structure:
- Project Sheet: Project name, card wire, sensor wire, info
- Floors Sheet: List of floor names
- Zones Sheet: Zone names with corresponding floor names
- Systems Sheet: System names (must exist in database) with zone names
- Sub Systems Sheet: Sub system names (must exist in database) with quantities
- Upload the File
- Click "Import Project" button
- Select your filled Excel file
- Click "Import Project"
- You'll be redirected to the project builder if successful
Excel Template Structure
The template contains 5 sheets:
Sheet 1: Project
| Field | Value |
|---|---|
| Project Name | My Project |
| Card Wire (meters) | 3 |
| Sensor Wire (meters) | 15 |
| Info | Project description |
Sheet 2: Floors
| Floor Name |
|---|
| Ground Floor |
| First Floor |
Sheet 3: Zones
| Floor Name | Zone Name |
|---|---|
| Ground Floor | Zone A |
| Ground Floor | Zone B |
Sheet 4: Systems
| Zone Name | System Name |
|---|---|
| Zone A | Fire Alarm System |
Sheet 5: Sub Systems
| System Name | Sub System Name | Quantity |
|---|---|---|
| Fire Alarm System | Smoke Detector | 5 |
Import Requirements
- File format:
.xlsxor.xls - Maximum file size: 10MB
- System and Sub System names must exist in the database
- All sheets must be present (even if empty)
Import Process
- Validates file format and size
- Reads each sheet in order
- Creates project with floors, zones, systems, and sub-systems
- Shows success message with counts of created items
- Redirects to project builder for further configuration
📤 EXPORT FUNCTIONALITY
How to Export BOQ
- Navigate to Project Dashboard
- Go to a project's dashboard:
/dashboard// - You'll see export buttons at the top
- Choose Export Format
- Export BOQ (XLSX): For Excel format with full formatting
- Export BOQ (PDF): For PDF format suitable for printing/sharing
- Download the File
- Click the desired export button
- File downloads automatically
- File name format:
BOQ_or_ .xlsx .pdf
Export Contents
The exported BOQ includes:
1. Project Information
- Project name
- Card wire length
- Sensor wire length
2. Cards and Enclosures
- Floor, Zone, System details
- Sub Systems list
- AI, DI, AO, DO counts
- Point totals (Single Unit, Soft Points, Total)
- Item descriptions (cards and enclosures)
- Unit costs, quantities, and total costs
- Subtotal for Cards & Enclosures
3. Sensors
- Sensor descriptions with brand
- Quantities
- Unit costs
- Total costs
- Subtotal for Sensors
4. Cables
- Cable types
- Quantities
- Unit costs
- Total costs
- Subtotal for Cables
5. Soft Integration Points
- Descriptions
- Point quantities
- Unit costs
- Total costs
- Subtotal for Soft Integration
6. Grand Total
- Sum of all subtotals
XLSX Format Features
- Professional formatting with colors
- Headers with blue background
- Borders and alignment
- Auto-sized columns
- Currency formatting
- Multiple sheets if needed (future enhancement)
PDF Format Features
- Professional layout
- Table formatting
- Page breaks for long content
- Headers and footers
- Suitable for printing
🔧 Technical Details
Files Created/Modified
projects/export_import.py- Main export/import logic
- Functions:
export_boq_xlsx(),export_boq_pdf(),import_project_from_excel()
projects/views.py- View functions:
export_boq_xlsx_view(),export_boq_pdf_view(),import_project_view(),download_import_template()
automation_cards_selection/urls.py- URL routes for export/import
- Templates
templates/projects/import_project.html- Import formtemplates/dashboard/dashboard.html- Export buttons addedtemplates/projects/projects.html- Import button added
Dependencies Added
openpyxl==3.1.2- For Excel file handlingreportlab==4.0.7- For PDF generation
URL Routes
/projects/- Export BOQ as XLSX/export/xlsx/ /projects/- Export BOQ as PDF/export/pdf/ /projects/import/- Import project form/projects/import/template/- Download import template
🚀 Usage Examples
Example 1: Import a New Project
- Create Excel file with project structure
- Go to Projects page
- Click "Import Project"
- Upload Excel file
- Project is created and you're redirected to builder
Example 2: Export BOQ for Client
- Complete project configuration
- Go to project dashboard
- Click "Export BOQ (PDF)"
- Share PDF with client
- Or export as XLSX for further editing
Example 3: Bulk Project Creation
- Prepare multiple Excel files
- Import each one
- All projects created automatically
- Saves time on repetitive data entry
⚠️ Important Notes
- System/Sub System Names: Must match exactly with database entries (case-sensitive)
- File Size: Maximum 10MB for import files
- File Format: Only
.xlsxand.xlsfiles supported - Data Validation: Import validates data but may show warnings for missing systems
- Export Data: Export uses current project state - ensure project is finalized before exporting
🐛 Troubleshooting
Import Issues
Problem: "System 'X' not found in database"- Solution: Check system name spelling, or create the system in admin panel first
- Solution: Ensure all 5 sheets exist in your Excel file
- Solution: Reduce data or split into multiple files
Export Issues
Problem: Export shows empty data- Solution: Ensure project has systems configured and card selection is done
- Solution: Use XLSX format for better compatibility, or check reportlab version
📝 Future Enhancements
Potential improvements:
- Import/export for master data (Systems, Cards, Sensors)
- Bulk import of multiple projects
- Custom export templates
- Email export directly from dashboard
- Export with images/diagrams
- Import validation with preview before import
📞 Support
For issues or questions:
- Check this guide first
- Review error messages carefully
- Ensure data matches template structure
- Verify system/sub-system names exist in database