Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 6th, 2004, 10:41 AM
Authorized User
 
Join Date: Jan 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to print Web Report?

Hi,

  I have created a web report. when i am click print option it is asking me to save or open file in acrobat reader and from there it is asking me to give print option. Can anybody let me know how to print report directly from web.

Thanks,
Kosaraju

 
Old February 6th, 2004, 10:47 AM
Registered User
 
Join Date: Feb 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is the feature of the crystal report to incorporate and keep the formating.

If you wish just to print you can just set the report to be continuous and get the user to print from the printer button on the browser.

The problem with this is the clients machine may have 800x600 or 1024x768 so formatting goes out of the window.

Another solution i use is allow the user to load the report into adobe through the web browser which, keeps it all web based (but obviously they need adobe installed on the client), if you want to know how to do this just ask.



 
Old February 12th, 2004, 05:36 AM
Authorized User
 
Join Date: Feb 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Which version of Crystal are you using and what Viewer are you using to publish the report?

Thanks!
Srimahavishnu Vadlapatla
(Mahavishnu / Vishnu)
 
Old February 12th, 2004, 05:50 AM
Registered User
 
Join Date: Feb 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using crystal 9 in an ASP.NET environment.
I have the full version and prefer to build the reports independently of the application. Save the report and then use the code to load the report.

CrystalReportViewer in .Net creates a DHTML based page. As i explained before to print I always use Adobe Acrobat Reader (which is free and has a web plug in).

Here is a chunck of code that does the job in .net
The SetDatabase(myreport), SetParmaeters(myreport) & SetSelectionFourmula(myreport) are all procedures to configure the reports settings


If Not Session("ReportLoc") Is Nothing Then
            Dim FileName As String
            Dim ExportPath As String
            Dim dfdOptions As DiskFileDestinationOptions
            Dim ExportOpts As ExportOptions
            Dim myreport As New ReportDocument()
            If Not Session("ReportLoc") Is Nothing Then
                FileName = Session("ReportLoc")
                ' FileName = FileName.Replace("Crystal_Reports", "Adobe_Reports")
                If viewstate("ReportDoc") Is Nothing Then
                    viewstate.Add("ReportDoc", myreport)
                    myreport.Load(FileName)
                    SetDatabase(myreport)
                    SetParmaeters(myreport)
                    SetSelectionFourmula(myreport)
                    ExportPath = (Server.MapPath("AdobePrint.aspx").Replace("AdobeP rint.aspx", "")) & "temp\" & Session.SessionID.ToString & ".pdf"
                    dfdOptions = New DiskFileDestinationOptions()
                    dfdOptions.DiskFileName = ExportPath
                    ExportOpts = myreport.ExportOptions
                    With ExportOpts
                        .DestinationOptions = dfdOptions
                        .ExportDestinationType = .ExportDestinationType.DiskFile
                        .ExportFormatType = .ExportFormatType.PortableDocFormat
                    End With
                    myreport.Export()
                    With Response
                        .ClearContent()
                        .ClearHeaders()
                        .ContentType = "application/pdf"
                        .WriteFile(ExportPath)
                        .Flush()
                        .Close()
                    End With
                    System.IO.File.Delete(ExportPath)
                    Session.Remove("ReportLoc")
                End If
            End If
        End If
    End Sub

 
Old February 18th, 2004, 11:11 AM
Authorized User
 
Join Date: Jan 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using crystal reports 9. You might be knowing purpose of web reports. I don't want to load any particular s/w on user machine. i want to give option to print from browser itself.
If not in crystal reports can we do that in SQL reports?

Thanks,
Kosaraju.

Quote:
quote:Originally posted by Mahavishnu
 Which version of Crystal are you using and what Viewer are you using to publish the report?

Thanks!
Srimahavishnu Vadlapatla
(Mahavishnu / Vishnu)
 
Old February 18th, 2004, 11:14 AM
Authorized User
 
Join Date: Jan 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't want to load any particular software, eventhough its freely available on net. i want to give print option from browser itself.

thanks,
Kosaraju.
Quote:
quote:Originally posted by Namshub
 I am using crystal 9 in an ASP.NET environment.
I have the full version and prefer to build the reports independently of the application. Save the report and then use the code to load the report.

CrystalReportViewer in .Net creates a DHTML based page. As i explained before to print I always use Adobe Acrobat Reader (which is free and has a web plug in).

Here is a chunck of code that does the job in .net
The SetDatabase(myreport), SetParmaeters(myreport) & SetSelectionFourmula(myreport) are all procedures to configure the reports settings


If Not Session("ReportLoc") Is Nothing Then
            Dim FileName As String
            Dim ExportPath As String
            Dim dfdOptions As DiskFileDestinationOptions
            Dim ExportOpts As ExportOptions
            Dim myreport As New ReportDocument()
            If Not Session("ReportLoc") Is Nothing Then
                FileName = Session("ReportLoc")
                ' FileName = FileName.Replace("Crystal_Reports", "Adobe_Reports")
                If viewstate("ReportDoc") Is Nothing Then
                    viewstate.Add("ReportDoc", myreport)
                    myreport.Load(FileName)
                    SetDatabase(myreport)
                    SetParmaeters(myreport)
                    SetSelectionFourmula(myreport)
                    ExportPath = (Server.MapPath("AdobePrint.aspx").Replace("AdobeP rint.aspx", "")) & "temp\" & Session.SessionID.ToString & ".pdf"
                    dfdOptions = New DiskFileDestinationOptions()
                    dfdOptions.DiskFileName = ExportPath
                    ExportOpts = myreport.ExportOptions
                    With ExportOpts
                        .DestinationOptions = dfdOptions
                        .ExportDestinationType = .ExportDestinationType.DiskFile
                        .ExportFormatType = .ExportFormatType.PortableDocFormat
                    End With
                    myreport.Export()
                    With Response
                        .ClearContent()
                        .ClearHeaders()
                        .ContentType = "application/pdf"
                        .WriteFile(ExportPath)
                        .Flush()
                        .Close()
                    End With
                    System.IO.File.Delete(ExportPath)
                    Session.Remove("ReportLoc")
                End If
            End If
        End If
    End Sub

 
Old February 19th, 2004, 03:37 AM
Registered User
 
Join Date: Feb 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Unfortunately i don't really know of any other way. Their is an axtivex viewer but that also requires a small based install.

You could try putting a print button associated with some javascript to call the ie/netscape/whataver's print. You would first have to hide the crystal toolbar and also make the page print in one continuous web generated page.

Thats all the help i can give.

Have you looked at version 10 of crystal? It is supposed to have a much more improved DHTML Viewer, i'm awaiting my copy to see if it is worth upgrading to.

 
Old June 10th, 2004, 05:45 AM
Registered User
 
Join Date: Jun 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to kittydotnet
Default

Quote:
quote:Originally posted by Namshub
 Unfortunately i don't really know of any other way. Their is an axtivex viewer but that also requires a small based install.

You could try putting a print button associated with some javascript to call the ie/netscape/whataver's print. You would first have to hide the crystal toolbar and also make the page print in one continuous web generated page.

Thats all the help i can give.

Have you looked at version 10 of crystal? It is supposed to have a much more improved DHTML Viewer, i'm awaiting my copy to see if it is worth upgrading to.

Hi,Namshub,
It is several months gone, do you upgrade your copy to version 10 of crystal reports? It is said this copy can print web report directly, do you know the simple way to implement directly printing?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Report print set-up lryckman Access 4 February 25th, 2008 09:04 AM
how to print sub report NagarajuK Crystal Reports 0 December 3rd, 2007 10:05 AM
Access NO PRINT in Report sbergeron Access 14 March 25th, 2006 01:35 AM
Crystal Report Print sepidehsalek Crystal Reports 2 February 12th, 2005 04:58 AM
print report lazio Crystal Reports 0 November 1st, 2004 08:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.