|
-
Mar 1st, 2004, 10:17 AM
#1
Thread Starter
Fanatic Member
using Crystal Report 8.5 reports in ASP
Can someone point me to a good link or article that would explain how to use Crystal Report 8.5 reports in a web page.
I also need to know how to export these reports to PDF and show these in a web page.
Thanks
Last edited by indydavid32; Mar 4th, 2004 at 01:46 PM.
David Wilhelm
-
Mar 2nd, 2004, 11:27 AM
#2
PowerPoster
I think I am using 9.0, so I don't know if this applies for you. Here is what I started with, and it worked well.
Code:
'Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' If Not Page.IsPostBack Then
' 'Put user code to initialize the page here
' Dim dsTemp As New ApplicationDS
' Dim myReport As New CrystalReport1
' SqlDataAdapter1.Fill(dsTemp)
' myReport.SetDataSource(dsTemp)
' CrystalReportViewer1.ReportSource = myReport
' End If
'End Sub
'Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' Dim myExportOptions As CrystalDecisions.Shared.ExportOptions
' Dim myDiskFileDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions
' Dim strExportFile As String
' Dim myReport As New CrystalReport1
' Dim dsTemp As New ApplicationDS
' SqlDataAdapter1.Fill(dsTemp)
' myReport.SetDataSource(dsTemp)
' strExportFile = "C:\Reports\" & Session.SessionID.ToString() & ".pdf"
' myDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions
' myDiskFileDestinationOptions.DiskFileName = strExportFile
' myExportOptions = myReport.ExportOptions
' With myExportOptions
' .DestinationOptions = myDiskFileDestinationOptions
' .ExportDestinationType = .ExportDestinationType.DiskFile
' .ExportFormatType = .ExportFormatType.PortableDocFormat
' End With
' myReport.Export()
' ' myReport.ExportToDisk(CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat, strExportFile)
' Response.ClearContent()
' Response.ClearHeaders()
' Response.ContentType = "application/pdf"
' Response.WriteFile(strExportFile)
' Response.Flush()
' Response.Close()
' System.IO.File.Delete(strExportFile)
'End Sub
-
Mar 4th, 2004, 01:38 PM
#3
Thread Starter
Fanatic Member
Hellswraith, I can't seem to get it to work.
When I load one of my crystal rports in my VB .Net, then double click it, it takes me to the stand alone version of Cyrstal Reports.
Is there a way to bring my version of Crystal into VB .Net so am able to create a new Crystal report from inside VB .Net?
If so, could you tell me the steps I need to take to accomplish this?
Thanks
-
Mar 4th, 2004, 03:28 PM
#4
PowerPoster
Right click your project in Solution Explorer. Select Add->Add New Item...
Scroll down to find a crystal report.
When you select it, set then name and hit ok, you will get the report wizard. You can go from there.
The bigest thing with my code, is I am basing the report on a Strongly Typed Dataset. This is important that you have this in order for my code to work. You will need to create the Dataset before you create the report, otherwise you can't do it.
When you have a dataset in your project that is strongly typed, (which is basically a xsd file), you can select Project for the Report source in the report wizard, and find your dataset.
-
Mar 5th, 2004, 07:58 AM
#5
Thread Starter
Fanatic Member
We are using VB .Net. After I select Add New item from my project, there is no Crystal Report type to select.
Can you tell me how to make it so it is there to select?
Thanks
-
Mar 5th, 2004, 04:15 PM
#6
PowerPoster
Then either your version of VS.Net doesn't include the basic Crystal Report stuff that is in the Enterprise Architect version, or your version of Crystal Reports doesn't support .Net.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|