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

Posted on 2011-10-12
Last Modified: 2012-05-12


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:

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?



<%@ 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" "">

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
    <asp:Button ID="btnShow" runat="server" Text="Show" /><br />
    <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server"  />

    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")

    End Sub

Open in new window

Question by:brasso_42
    LVL 83

    Accepted Solution

    Try the following approach

    Dim report As New ReportDocument()

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

    report.SetParameterValue("@Userid", userid)

    CrystalReportViewer1.ReportSource = report
    LVL 100

    Expert Comment

    WHat code works to run a report?

    LVL 1

    Author Closing Comment

    AH ur a star

    LVL 83

    Expert Comment

    Glad to help :-)
    LVL 1

    Author Comment

    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.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    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…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    759 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