0

I am new to Crystal reports. This is my code I already use to open crystal report in a new window

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);;

But I want to know how to open Crystal Report in a new tab within the same browser. How can I do that?

  • Possible duplicate of [Open the link in new window in crystal report](http://stackoverflow.com/questions/13636429/open-the-link-in-new-window-in-crystal-report) – Sun Mar 06 '17 at 19:38

2 Answers2

1

You need to convert it into 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);

}

This pops up a new window loading the crystal report at .pdf format.

If it didn't work you may look at the link below

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

Ahmed Abaza
  • 89
  • 1
  • 7
0

Nothing an author can do can choose to open in a new tab instead of a new window.
It depends on browser's settings

Emanuele Greco
  • 12,551
  • 7
  • 51
  • 70