Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Call CrystalReport.rpt Post Reply Post New Topic
Author Message
thinaz
Newbie
Newbie


Joined: 19 Aug 2008
Online Status: Offline
Posts: 1
Quote thinaz Replybullet Topic: Call CrystalReport.rpt
    Posted: 19 Aug 2008 at 2:22am
I made a CrystalReport.rpt
I build an aspx file which consist of one button and one CrystalReportViewer.

how is the way to call the .rpt to the CrystalReportViewer???
and how is the connection to the database without wizard??
I've made this:

public partial class Default2 : System.Web.UI.Page
{
    private CrystalReport report = new CrystalReport();
    protected void Page_Load(object sender, EventArgs e)
    {
        CrystalReportViewer1.ReportSource = report;
        CrystalReportViewer1.Visible = true;
    }

    protected void  Button1_Click(object sender, EventArgs e)
    {
        MemoryStream oStream;
        oStream = (MemoryStream)report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
        Response.Clear();
        Response.Buffer = true;
        Response.ContentType="application/pdf";
        Response.BinaryWrite(oStream.ToArray());
        Response.End();
    }
}

but CrystalReport(bold) is not recognized..
mmm.. what is wrong woth my code??
is there any body can help me???
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 26 Aug 2008 at 2:13pm
There is no such class as "CrystalReport", unless it is a class in your application.  If it is, you need to check the namespace to make sure that the viewer and the report have the same namespace. 
 
-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.