【问题标题】:Open Crystal Report In a New Tab在新选项卡中打开水晶报表
【发布时间】:2014-05-20 09:45:58
【问题描述】:

我是 Crystal 报表的新手。 这是我已经用来在新窗口中打开水晶报表的代码

string url = " ./Reports/ReportQuotationDetails.aspx?ID=" + IndexID.ToString();
ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "NewWindow", "window.open('" + url + "','_blank','height=600,width=900,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,titlebar=no' );", true);;

但我想知道如何在同一浏览器的新选项卡中打开 Crystal Report。 我该怎么做?

【问题讨论】:

标签: c# asp.net crystal-reports


【解决方案1】:

你需要把它转换成PDF

 ReportDocument Rpt = new ReportDocument();
//report path in application

string reportPath = Server.MapPath("Reports\\14DaysReport.rpt");
Rpt.Load(reportPath);

CRConnectionInfo connectionInfo = new CRConnectionInfo();
CRConnectionInfo.SetDBLogonForReport(connectionInfo, Rpt);

Rpt.ExportToDisk(ExportFormatType.PortableDocFormat, Server.MapPath("Files/BiWeeklyReport.pdf"));
ClientScript.RegisterStartupScript(this.Page.GetType(), "popupOpener", "var popup=window.open('Files/BiWeeklyReport.pdf');popup.focus();", true);

}

这会弹出一个新窗口,以 .pdf 格式加载水晶报告。

如果没有用,可以查看下面的链接

http://forums.asp.net/t/1425056.aspx?Export+Crystal+Report+into+pdf+format+and+open+a+popup+window

【讨论】:

    【解决方案2】:

    作者无法选择在新选项卡而不是新窗口中打开。
    这取决于浏览器的设置

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-05
      • 1970-01-01
      相关资源
      最近更新 更多