?
Solved

Visual Studio 2010 ASP.Net Crystal Report Problem Setting anything via VB.

Posted on 2011-10-12
5
Medium Priority
?
265 Views
Last Modified: 2012-05-12

Hi

I’ve created a crystal report in my ASP.NET project.  The report works fine if I just put a CrystalReportSource and a CrystalReportViewer on the page.  However I need to pass parameters to the report.

To be honest this looks quite easy to achieve, but when I try to set the ReportSource
Via VB I get the below:

Error
Failed to open the connection. Failed to open the connection. Quote_Text {5EDAAF2C-0D75-4621-A159-AA930E2C0888}.rpt

The report name is Quote_Text.rpt.  I have no idea where this extra string is coming from.

Can any one help?

Thanks

Brasso

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Printquote.aspx.vb" Inherits="BIS.Printquote" %>

<%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.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></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
 
    <asp:Button ID="btnShow" runat="server" Text="Show" /><br />
    <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server"  />
            
    </div>
    </form>
</body>
</html>



    Protected Sub btnShow_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnShow.Click

        Me.CrystalReportViewer1.ReportSource = Server.MapPath("/SalesProcess/Quote_Text.rpt")
        Me.CrystalReportViewer1.RefreshReport()

    End Sub

Open in new window

0
Comment
Question by:brasso_42
  • 2
  • 2
5 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 36955943
Try the following approach

Dim report As New ReportDocument()

report.Load(Server.MapPath("/SalesProcess/Quote_Text.rpt"))
report.FileName = Server.MapPath("/SalesProcess/Quote_Text.rpt")

report.SetParameterValue("@Userid", userid)

CrystalReportViewer1.ReportSource = report
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 36956056
WHat code works to run a report?

mlmcc
0
 
LVL 1

Author Closing Comment

by:brasso_42
ID: 36956287
AH ur a star

Thanks!!!!!!
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 36965397
Glad to help :-)
0
 
LVL 1

Author Comment

by:brasso_42
ID: 36967145
I had another problem when I pubished the report.

I found I had to create the ODBC link on there server to.

Hope this helps some one else in the future.

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Integration Management Part 2
Suggested Courses
Course of the Month14 days, 6 hours left to enroll

807 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