Crystal Reports XI .NET Print Window Not Found

K

Kbalz

Having a really hard time finding solid examples on deploying a
CR .NET applcation on my intranet. I'll explain what I've done so far,
and toward the bottom is where I can't print using the report viewer's
gui button.

I have a Windows XP sp2 Client machine used for development, it has
Visual Studio 2005 sp1 and CR XI R2 Developer Version.
My webserver is running Windows Server 2003 sp1, IIS 6.0, has CR XI R2
developer. I have a working report that uses a simple stored procedure
created.

I created the website in IIS on the server, and mapped the viewer
controls to a virtual directory

Website is: crystal
Alias is: crystalreportviewers115
Local Path is: C:\Program Files\Business Objects\Common
\3.5\crystalreportviewers115\

I created a solution from the client for the website, and moved my
report on the root, and created a default.aspx on the root (just for
testing and to keep it simple).. In VS, I dropped the Pre-canned
control "CrystalReportViewer".. this updated my webconfig file to
include the nessicary dlls and such.

Here is my ASPX.cs file:

protected void Page_Load(object sender, EventArgs e)
{
ConfigureCrystalReports();
}

private void ConfigureCrystalReports()
{
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.ServerName = "<>"; //edited these out so all of
google groups doesn't see our conn info.
connectionInfo.DatabaseName = "<>";//edited these out so all
of google groups doesn't see our conn info.
connectionInfo.UserID = "<>";//edited these out so all of
google groups doesn't see our conn info.
connectionInfo.Password = "<>";//edited these out so all of
google groups doesn't see our conn info.

string reportPath = Server.MapPath("ageing.rpt");
CrystalReportViewer1.ReportSource = reportPath;

CrystalReportViewer1.CssFilename = "/crystalreportviewers115/
css/default.css";
CrystalReportViewer1.ToolbarImagesFolderUrl = "../
crystalreportviewers115/images/toolbar";
CrystalReportViewer1.GroupTreeImagesFolderUrl = "../
crystalreportviewers115/images/tree";

SetDBLogonForReport(connectionInfo);
}

private void SetDBLogonForReport(ConnectionInfo connectionInfo)
{
TableLogOnInfos tableLogOnInfos =
CrystalReportViewer1.LogOnInfo;
foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos)
{
tableLogOnInfo.ConnectionInfo = connectionInfo;
}
}

First off, you notice I had to do CrystalReportViewer1.cssfilename and
the other two properties.. my report data was showing perfectly, but
there were no images or CSS formatting.. I figured out I need to set
these properties on the report for them to work.

Now my report looks good with all the images, but when I try to use
the print button on the report - I get a JavaScript error. This is
with the PrintMode property on the report set to PDF.

The error is:

Line: 3641
Char: 1
Error: Object doesn't support this action
COde: 0
URL: http://crystal/default.aspx

So I switched the PrintMode to ActiveX.. now when I try to print my
report, I get a popup window, but it says "page could not be found"
error..

Here's my main questions:
Am I setting up IIS correctly so my reports know where to reference
files like printing, css, images..? It seems I have override this
because I haven't set it up properly..

If I have set it up properly.. how am I supposed to figure out
printing?


Here is my aspx page code if that helps any

<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="CrystalDecisions.Web, Version=11.5.3700.0,
Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div><CR:CrystalReportViewer ID="CrystalReportViewer1"
runat="server" AutoDataBind="true" ShowAllPageIds="True"/>
</div>
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
</form>
</body>
</html>
 
K

Kbalz

Having a really hard time finding solid examples on deploying a
CR .NET applcation on my intranet. I'll explain what I've done so far,
and toward the bottom is where I can't print using the report viewer's
gui button.

I have a Windows XP sp2 Client machine used for development, it has
Visual Studio 2005 sp1 and CR XI R2 Developer Version.
My webserver is running Windows Server 2003 sp1, IIS 6.0, has CR XI R2
developer. I have a working report that uses a simple stored procedure
created.

I created the website in IIS on the server, and mapped the viewer
controls to a virtual directory

Website is: crystal
Alias is: crystalreportviewers115
Local Path is: C:\Program Files\Business Objects\Common
\3.5\crystalreportviewers115\

I created a solution from the client for the website, and moved my
report on the root, and created a default.aspx on the root (just for
testing and to keep it simple).. In VS, I dropped the Pre-canned
control "CrystalReportViewer".. this updated my webconfig file to
include the nessicary dlls and such.

Here is my ASPX.cs file:

protected void Page_Load(object sender, EventArgs e)
{
ConfigureCrystalReports();
}

private void ConfigureCrystalReports()
{
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.ServerName = "<>"; //edited these out so all of
google groups doesn't see our conn info.
connectionInfo.DatabaseName = "<>";//edited these out so all
of google groups doesn't see our conn info.
connectionInfo.UserID = "<>";//edited these out so all of
google groups doesn't see our conn info.
connectionInfo.Password = "<>";//edited these out so all of
google groups doesn't see our conn info.

string reportPath = Server.MapPath("ageing.rpt");
CrystalReportViewer1.ReportSource = reportPath;

CrystalReportViewer1.CssFilename = "/crystalreportviewers115/
css/default.css";
CrystalReportViewer1.ToolbarImagesFolderUrl = "../
crystalreportviewers115/images/toolbar";
CrystalReportViewer1.GroupTreeImagesFolderUrl = "../
crystalreportviewers115/images/tree";

SetDBLogonForReport(connectionInfo);
}

private void SetDBLogonForReport(ConnectionInfo connectionInfo)
{
TableLogOnInfos tableLogOnInfos =
CrystalReportViewer1.LogOnInfo;
foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos)
{
tableLogOnInfo.ConnectionInfo = connectionInfo;
}
}

First off, you notice I had to do CrystalReportViewer1.cssfilename and
the other two properties.. my report data was showing perfectly, but
there were no images or CSS formatting.. I figured out I need to set
these properties on the report for them to work.

Now my report looks good with all the images, but when I try to use
the print button on the report - I get a JavaScript error. This is
with the PrintMode property on the report set to PDF.

The error is:

Line: 3641
Char: 1
Error: Object doesn't support this action
COde: 0
URL:http://crystal/default.aspx

So I switched the PrintMode to ActiveX.. now when I try to print my
report, I get a popup window, but it says "page could not be found"
error..

Here's my main questions:
Am I setting up IIS correctly so my reports know where to reference
files like printing, css, images..? It seems I have override this
because I haven't set it up properly..

If I have set it up properly.. how am I supposed to figure out
printing?

Here is my aspx page code if that helps any

<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="CrystalDecisions.Web, Version=11.5.3700.0,
Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div><CR:CrystalReportViewer ID="CrystalReportViewer1"
runat="server" AutoDataBind="true" ShowAllPageIds="True"/>
</div>
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
</form>
</body>
</html>

Crystal Reports is the biggest waste of time and money on the market
today, with little support or great out of the box solutions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top