搜尋此網誌

顯示具有 CrystalReports 標籤的文章。 顯示所有文章
顯示具有 CrystalReports 標籤的文章。 顯示所有文章

2011-12-13

CrystalReportViewer匯出失敗

0 意見
無法使用指定的選項來匯出。請檢查您的選項,然後再試一次。
Failed to export using the options you specified. Please check your options and try again.

因為按下匯出時,會postback,需要再做一次資料繫結.
protected void Button_Click(object sender, EventArgs e)
        {
            DataSet ds = LoadData();
            
            ReportDocument Report2 = new ReportDocument();
            string reportPath = Server.MapPath(@".\App_Data\CrystalReport2.rpt");

            Report2.Load(reportPath);
            Report2.SetDataSource(ds);

            CrystalReportViewer1.ReportSource = Report2;
            Session.Add("report", Report2);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            //處理Viewer匯出
            if (Page.IsPostBack && Session["report"] != null)
            {
                CrystalReportViewer1.ReportSource = Session["report"];
            }   
        }

參考
Report dissapear on postback
How to use "Print" and " Export" option from CrystalRep

CrystalReportViewer切換其他語系

0 意見
參考MSDN
Web.config
標記內,輸入下列巢狀標記以將 UseBrowserLocale 屬性設為 True。
Web.config 檔只能有一個 configSections 區塊,而且該區塊必須是 configuration 標記的第一個子系。
如果您的 Web.config 檔已包含 configSections 區塊,則編輯該區段以納入 sectionGroup 和 section 標記,如以下所示。