Report Generator

作者 claude-office-skills9c4c7d5cd281MIT499 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫8 個月前更新

Generate professional data reports with charts, tables, and visualizations

AI 產生的概覽

依據提供的資料產生附圖表、表格與 KPI 摘要的格式化資料報告。

功能
此技能引導代理產生專業資料報告,例如儀表板、KPI 摘要與分析報告。內容說明報告結構、以 Python 為基礎的圖表與指標計算範例,以及 HTML 報告範本。產出為包含視覺化、表格與洞察的格式化報告。
適用情境
當你擁有 CSV、Excel 或 JSON 格式的資料,並希望取得格式化報告、儀表板或高階摘要時使用。適合銷售報告、每月 KPI 儀表板以及資料分析報告。
執行需求
僅為說明內容,技能未附帶指令碼。範例涉及 Python 與 pandas、matplotlib、reportlab,中繼資料另列出 office-mcp 伺服器及 create_docx、create_xlsx、create_chart、create_pptx 工具。

Report Generator Skill

Overview

This skill enables automatic generation of professional data reports. Create dashboards, KPI summaries, and analytical reports with charts, tables, and insights from your data.

How to Use

  1. Provide data (CSV, Excel, JSON, or describe it)
  2. Specify the type of report needed
  3. I'll generate a formatted report with visualizations

Example prompts:

  • "Generate a sales report from this data"
  • "Create a monthly KPI dashboard"
  • "Build an executive summary with charts"
  • "Produce a data analysis report"

Domain Knowledge

Report Components

python
# Report structurereport = {    'title': 'Monthly Sales Report',    'period': 'January 2024',    'sections': [        'executive_summary',        'kpi_dashboard',        'detailed_analysis',        'charts',        'recommendations'    ]}

Using Python for Reports

python
import pandas as pdimport matplotlib.pyplot as pltfrom reportlab.lib.pagesizes import letterfrom reportlab.pdfgen import canvas
def generate_report(data, output_path):    # Load data    df = pd.read_csv(data)        # Calculate KPIs    total_revenue = df['revenue'].sum()    avg_order = df['revenue'].mean()    growth = df['revenue'].pct_change().mean()        # Create charts    fig, axes = plt.subplots(2, 2, figsize=(12, 10))    df.plot(kind='bar', ax=axes[0,0], title='Revenue by Month')    df.plot(kind='line', ax=axes[0,1], title='Trend')    plt.savefig('charts.png')        # Generate PDF    # ... PDF generation code        return output_path

HTML Report Template

python
def generate_html_report(data, title):    html = f'''    <!DOCTYPE html>    <html>    <head>        <title>{title}</title>        <style>            body {{ font-family: Arial; margin: 40px; }}            .kpi {{ display: flex; gap: 20px; }}            .kpi-card {{ background: #f5f5f5; padding: 20px; border-radius: 8px; }}            .metric {{ font-size: 2em; font-weight: bold; color: #2563eb; }}            table {{ border-collapse: collapse; width: 100%; }}            th, td {{ border: 1px solid #ddd; padding: 12px; text-align: left; }}        </style>    </head>    <body>        <h1>{title}</h1>        <div class="kpi">            <div class="kpi-card">                <div class="metric">${data['revenue']:,.0f}</div>                <div>Total Revenue</div>            </div>            <div class="kpi-card">                <div class="metric">{data['growth']:.1%}</div>                <div>Growth Rate</div>            </div>        </div>        <!-- More content -->    </body>    </html>    '''    return html

Example: Sales Report

python
import pandas as pdimport matplotlib.pyplot as plt
def create_sales_report(csv_path, output_path):    # Read data    df = pd.read_csv(csv_path)        # Calculate metrics    metrics = {        'total_revenue': df['amount'].sum(),        'total_orders': len(df),        'avg_order': df['amount'].mean(),        'top_product': df.groupby('product')['amount'].sum().idxmax()    }        # Create visualizations    fig, axes = plt.subplots(2, 2, figsize=(14, 10))        # Revenue by product    df.groupby('product')['amount'].sum().plot(        kind='bar', ax=axes[0,0], title='Revenue by Product'    )        # Monthly trend    df.groupby('month')['amount'].sum().plot(        kind='line', ax=axes[0,1], title='Monthly Revenue'    )        plt.tight_layout()    plt.savefig(output_path.replace('.html', '_charts.png'))        # Generate HTML report    html = generate_html_report(metrics, 'Sales Report')        with open(output_path, 'w') as f:        f.write(html)        return output_path
create_sales_report('sales_data.csv', 'sales_report.html')

Resources

來源與署名

來源:claude-office-skills/skills位於report-generator提交9c4c7d5

授權條款: MIT

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架