Solved

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

Posted on 2008-09-29
8
247 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

752 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