Solved

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

Posted on 2008-09-29
8
242 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
 

Author Comment

by:SullivanMIS
ID: 22608524
I think this document may be helpful. I will try it and get back to you.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now