Qrp File Viewer | Tested & Working |

def extract_report_data(self, content): """Extract structured data from QRP content""" self.report_data = [] # Look for common patterns in QRP files lines = content.split('\n') # Try to find tabular data data_started = False headers = [] for line in lines: if '|' in line or '\t' in line: # Parse delimited data if '|' in line: parts = line.split('|') else: parts = line.split('\t') parts = [p.strip() for p in parts if p.strip()] if parts: if not headers and all(p.isalpha() or ' ' in p for p in parts): headers = parts else: if headers: row_data = dict(zip(headers[:len(parts)], parts)) self.report_data.append(row_data) else: self.report_data.append(f"Column_i": p for i, p in enumerate(parts)) if not self.report_data and lines: # If no structured data found, treat each line as a record for i, line in enumerate(lines[:100]): # Limit to first 100 lines if line.strip(): self.report_data.append(f"Line_i+1": line.strip())

messagebox.showinfo("About", about_text) def main(): root = tk.Tk() app = QRPViewer(root) root.mainloop() qrp file viewer

def export_html(self): """Export report to HTML""" if not self.current_file: messagebox.showwarning("Warning", "No file loaded") return filename = filedialog.asksaveasfilename( defaultextension=".html", filetypes=[("HTML files", "*.html")] ) if filename: try: with open(filename, 'w', encoding='utf-8') as f: f.write("""<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>QRP Report</title> <style> body font-family: Arial, sans-serif; margin: 20px; background-color: #f5f5f5; .container max-width: 1200px; margin: 0 auto; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); h1 color: #003366; border-bottom: 2px solid #003366; padding-bottom: 10px; .info color: #666; margin-bottom: 20px; table width: 100%; border-collapse: collapse; margin-top: 20px; th background-color: #003366; color: white; padding: 12px; text-align: left; td padding: 8px; border-bottom: 1px solid #ddd; tr:hover background-color: #f5f5f5; .footer margin-top: 20px; text-align: center; color: #666; font-size: 12px; </style> </head> <body> <div class="container"> """) f.write(f"<h1>QRP Report: os.path.basename(self.current_file)</h1>") f.write(f"<div class='info'>Generated: datetime.now().strftime('%Y-%m-%d %H:%M:%S')</div>") if self.report_data: # Get all keys all_keys = set() for row in self.report_data: all_keys.update(row.keys()) headers = list(all_keys) f.write("<table>") f.write("<tr>" + "".join(f"<th>h</th>" for h in headers) + "</tr>") for row in self.report_data: f.write("<tr>") for h in headers: f.write(f"<td>row.get(h, '')</td>") f.write("</tr>") f.write("</table>") f.write(f"<div class='footer'>Total records: len(self.report_data)</div>") else: f.write("<p>No structured data found in the QRP file.</p>") f.write(""" </div> </body> </html> """) messagebox.showinfo("Success", f"HTML exported to filename") except Exception as e: messagebox.showerror("Error", f"Failed to export HTML: str(e)") encoding='utf-8') as f: f.write("""&lt

Python-based QRP Viewer import struct import tkinter as tk from tkinter import ttk, filedialog, messagebox from tkinter.scrolledtext import ScrolledText import os from datetime import datetime import xml.etree.ElementTree as ET from reportlab.lib import colors from reportlab.lib.pagesizes import letter, A4 from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import inch class QRPViewer: def init (self, root): self.root = root self.root.title("QRP File Viewer & Report Generator") self.root.geometry("1200x800") body font-family: Arial

def sort_column(self, col, reverse): """Sort treeview by column""" data_list = [(self.tree.set(child, col), child) for child in self.tree.get_children('')] data_list.sort(reverse=reverse) for index, (val, child) in enumerate(data_list): self.tree.move(child, '', index) self.tree.heading(col, command=lambda: self.sort_column(col, not reverse))

© 2026 Kulturdelen. All Rights Reserved. Logga in - Designed, developed and maintained by TypeTree