Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > BOOK: Professional Crystal Reports for VS.NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Crystal Reports for VS.NET
This is the forum to discuss the Wrox book Professional Crystal Reports for Visual Studio .NET by David McAmis; ISBN: 9780764544033
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Crystal Reports for VS.NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 26th, 2006, 04:52 AM
Registered User
 
Join Date: Apr 2006
Location: Ahmedabad, Gujrat, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to bhaveshsanghani
Default how to view crystal report in asp.net

how to view crystal report without database password prompting in asp .net 2.0

Bhavesh Sanghani
Reply With Quote
  #2 (permalink)  
Old October 26th, 2014, 12:10 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2013
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Smile how to view crystal report in asp.net vb

Try:

Code:
 
Imports CrystalDecisions
Imports CrystalDecisions.CrystalReports
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System.IO

Public Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
       
    End Sub

    Protected Sub LinkButton1_Click(sender As Object, e As EventArgs) Handles LinkButton1.Click

        OpenPDF(Request.ApplicationPath + "/Reports/Report.pdf")

    End Sub


    Private Sub OpenPDF(downloadAsFilename As String)
        Dim RptDoc As New ReportDocument()
        RptDoc.Load(Server.MapPath(Request.ApplicationPath + "/Reports/myreport.rpt"))
        RptDoc.SetDatabaseLogon("user", "password", "server", "database")

        Dim stream As New BinaryReader(RptDoc.ExportToStream(CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat))
        Response.ClearContent()
        Response.ClearHeaders()
        Response.ContentType = "application/pdf"
        Response.AddHeader("content-disposition", Convert.ToString("attachment; filename=") & downloadAsFilename)
        Response.AddHeader("content-length", stream.BaseStream.Length.ToString())
        Response.BinaryWrite(stream.ReadBytes(Convert.ToInt32(stream.BaseStream.Length)))
        Response.Flush()
        Response.Close()
    End Sub
End Class
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
using crystal report with asp.net ehc2082 Crystal Reports 0 January 6th, 2005 09:33 PM
crystal report in asp.net wynn ASP.NET 1.x and 2.0 Application Design 1 June 14th, 2004 10:16 AM
crystal report in asp.net wynn BOOK: Professional Crystal Reports for VS.NET 1 June 12th, 2004 05:29 AM
asp.net Crystal Report chinhow Crystal Reports 0 February 19th, 2004 09:13 PM
I want to view a report on Webform ASP.NET/ kid1981 Crystal Reports 14 November 3rd, 2003 10:22 AM



All times are GMT -4. The time now is 08:25 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.