1

こんにちは、みんな !1つのasp.netアプリケーションを開発していますが、要件は次のとおりです。ユーザーは複数のレポートを表示できます(私はCrystalレポートを使用しました)。各レポートには[レポートの編集]ボタンがあります。ユーザーが[編集]ボタンをクリックすると、レポートが別のWebページのExcelシートで開きます。次に、ユーザーは並べ替えなどの適切な変更を行い、このレポートを保存して更新された印刷を行います。

4

1 に答える 1

0
  • CristalReportsViewer表示するレポートごとに 1 つずつ、ページ内で多数のドラッグ アンド ドロップを行う
  • CristalReportsSource表示するレポートごとに 1 つずつ、ページ内で多数のドラッグ アンド ドロップを行う
  • それぞれにリンクCristalReportsSourceするCristalReportsViewer
  • CristalReportsSource相対ソースごとに設定myreport.rpt
  • このサンプルコードを使用して、レポートをエクスポートする多くのボタンを配置します

    protected void btnExport_Click(object sender, EventArgs e)    
    {
    // Stop buffering the response
    Response.Buffer = false;
    // Clear the response content and headers
    Response.ClearContent();
    Response.ClearHeaders();
    
    ExportFormatType format = ExportFormatType.Excel;
    try
    {
       reportDocument.ExportToHttpResponse(format, Response, true, "report.xls");
    
    }
    catch (System.Threading.ThreadAbortException)
    {
        //happens; no matter
    }
    catch (Exception ex)
    {
       Response.Write(ex.StackTrace);
    }
    }
    

このサンプル コードを使用すると、単一のレポートを表示し、ユーザーがドロップダウンを使用せずに目的のレポートを選択できるようにすることができます

    reportDocument = new ReportDocument();
    string reportName = "myreport.rpt";
    reportDocument.Load(Server.MapPath(string.Format("~/{0}/{1}", "MyReportsFolder", reportName)));
    CrystalReportViewer1.ReportSource = reportDocument;
    reportDocument.ReadRecords();
于 2012-08-27T13:30:37.817 に答える