Solved

How to add a crystal report to a .net web site

Posted on 2008-09-29
8
245 Views
Last Modified: 2013-11-26
I have created a report in crystal reports XI. The report contains 8 subreports. The main report is not connected to a datasource, but the 8 subreports are each connected to different data sources. I need to be able to add this report to my .net web site. I have added a crystal report viewer to my aspx page and i can see my report in design, but when i go to view my web page i get nothing except a blank screen.  I attached my html code.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="TentativeBudget.aspx.vb" Inherits="TentativeBudget" %>
 
<%@ Register Assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
    Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
 
<!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>Tentative Budget</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <CR:CrystalReportViewer id="CrystalReportViewer1" runat="server" DisplayGroupTree="False" 
            ReportSourceID="CrystalReportSource2" Width="893px" DisplayToolbar="False" Height="757px" />
        <CR:CrystalReportSource ID="CrystalReportSource2" runat="server">
            <Report FileName="\\Scg-misdev\wwwroot\ApplicationReports\content\Depts\Budget\Tentative\BudgetTentative.rpt">
            </Report>
        </CR:CrystalReportSource>
 
</div>
    </form>
</body>
</html>

Open in new window

0
Comment
Question by:SullivanMIS
  • 5
  • 3
8 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 22605993
Is the data source in a different place for the web page than for your development environment?

mlmcc
0
 

Author Comment

by:SullivanMIS
ID: 22607063
Yes it is
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 22607352
You need to either change the data source through Crystal or through your web page.  It is trying to connect to the original data source.

I am not sure how to do it in HTML.

Here is a tutorial on VS2005 Crystal
I believe the part you need is on about page 131.  If not then check the table of contents.
http://www.businessobjects.com/global/pdf/dev_zone/VS2005_Walkthroughs.pdf

mlmcc
0
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 

Author Comment

by:SullivanMIS
ID: 22608524
I think this document may be helpful. I will try it and get back to you.
0
 

Author Comment

by:SullivanMIS
ID: 22625196
ok so i went thru adding a crystal report to my web form step by step. I even went thru the section with subreports (page 141) and i am getting the following error: Error in File C:\WINDOWS\TEMP\TentativeBudget {ECE49B1E-91F5-452B-B35D-5C4D82BEE7F1}.rpt:
Access to report file denied. Another program may be using it.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 22626351
What is the code that is causing the problem?

mlmcc
0
 

Author Comment

by:SullivanMIS
ID: 22627515
It stops at line 13 to load the report:

Line 11:         TentativeBudgetReport = New ReportDocument()
Line 12:         Dim reportPath As String = Server.MapPath("TentativeBudget.rpt")
Line 13:         TentativeBudgetReport.Load(reportPath)
Line 14:         Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
Line 15:         myConnectionInfo.DatabaseName = "SC_Budget"
0
 

Author Closing Comment

by:SullivanMIS
ID: 31501231
I found my solution in the VS2005 Walkthroughs.pdf. Not on page 131 but starting around page 9.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question