4

私はクライアント用にasp.netネットアプリを作成しています。彼は自分のページにレポートを作成するのが好きなので、ページにrdlcファイルがあり、デフォルトのasp.netレポートビューアーコントロールを使用してこのファイルをページに表示しています...すべてがクライアントがファイルをpdfとして保存したい場合を除き、ページの構造が変更され、同じように見えません。また、フィールドの値の一部が空であることに気付きましたが、それらはページに表示され、同じレポートを保存すると表示されますWord(* .doc)形式でも、Wordファイルは本来あるべきものです...問題はpdfのみです。どんな提案でも大歓迎です

4

2 に答える 2

5

マージン設定 (左、右、上、下) を 0in に設定しても同じ問題が発生する場合、レポート プロパティのマージン設定が原因でした。そして、あなたの問題は解決しました。

于 2012-06-28T13:53:30.380 に答える
0

このコードを試してみてください.... urデータをpdf形式で表示するのに役立ちます

    protected void submit_Click(object sender, EventArgs e)
    {
        bindReportData();  
        try
        {
            // Export the Report to Response stream in PDF format and file name Customers

            abc_reportDocument.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, true, "ABC");
            // There are other format options available such as Word, Excel, CVS, and HTML in the ExportFormatType Enum given by crystal reports
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
            ex = null;
        }
    }



    private void bindReportData()
    {
        abc_reportDocument = new ReportDocument();
        dsReport = new DataSet();
        dsReport = getAccumulationData();
        if (dsReport.Tables[0].Rows.Count > 0)
        {
            abc_reportDocument.Load(this.MapPath("report1.rpt"));
            abc_reportDocument.Database.Tables[0].SetDataSource(dsReport.Tables[0]);
            rptviewerAccumulation.ReportSource = abc_reportDocument;
            rptviewerAccumulation.DataBind();


        }

}
于 2012-06-25T07:48:01.647 に答える