Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Options for using CR 8.5

Status
Not open for further replies.

mmemon

Programmer
Nov 21, 2002
46
US
Hello,

I have Crystal Reports 8.5 developer edition along with the enterprise server. I have many reports that I publish for the staff to access view eportfolio. This is the only way I have done this for our users.

We have a new application being built in VB.net. In this application. Here is what they want:

1) A user will enter the app, press a button for a report to be generated in read-only format and placed in a directory on the server.
2) This report will then be picked up my other employees via HTTP from other company sites via url that has a query parameter in it that would be passed to the crystal report.
3) Report will be displayed to the user.

First all, I heard that you need version to be able to embed into Vb.net if that is what I need to do to accomplish the above. However, I read that you can still use old versions of the Active X control in the Vb.net and just point the app to an external control which would be the crystal reports executable.

Anyway, what I guess I am trying to figure out is do I need to worry that I have an old version of Crystal and would I even need to add anything into the VB.net project to accomplish this. Can I build a report and have it saved as pdf and place it on the server for pickup on the outside?

I am trying to think of differrent approaches that I can handle this.

Thanks
 
>Can I build a report and have it saved as pdf and place it on the server for pickup on the outside?

This is where my thoughts were going before I read this line. If the report is being read in a web browser, my feeling is that it should be a pdf file. Almost anyone comfortable using a web browsert is comfortable getting a pdf file in his browser.

This is a code snippet copied from a program that creates a report as a pdf file, sends it to the user and deletes the report (pdf) file. You can use any globally unique filename you like:
Code:
Dim crReportDocument As New CrReport
Dim crExportOptions As New CrystalDecisions.Shared.ExportOptions
Dim crDiskFileDestinationOptions As New CrystalDecisions.Shared.DiskFileDestinationOptions
Dim fName As String
crReportDocument = New CrReport
fName = "C:\" & Session.SessionID.ToString & ".pdf"
crDiskFileDestinationOptions.DiskFileName = fName
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
  .DestinationOptions = crDiskFileDestinationOptions
  .ExportDestinationType = CrystalDecisions.[Shared].ExportDestinationType.DiskFile
  .ExportFormatType = CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat
End With
crReportDocument.SetDataSource(myDS)
[green]'Print the pdf file[/green]
crReportDocument.Export()

[green]'Send the pdf file as a HTML page[/green]
Response.ContentType = "application/pdf"
Response.AppendHeader("title", "Title of report here")
Response.WriteFile(fName)
Response.Flush()
Response.Close()

[green]'Delete the file - the user can save or print a copy[/green]
System.IO.File.Delete(fName)

There's no need to have it 'picked up'. The browser (assuming that the user has the Adobe Reader installed) will display the report as an Adobe Acrobat file. I include a 'Get Adobe Acrobat Reader' link on the page from which the user can request my report.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top