|
-
Feb 26th, 2006, 11:46 PM
#1
Thread Starter
Lively Member
Crystal Report Viewer in ASP.NET Problem
Dear friends,
I have made a report in .NET environment by crystal report. I have loaded it in a web form with a crystal report viewer.
It is working good. But when I print the report it prints Report Name and Page No on the top of the paper and the report url on the bottom of the paper. I don't want to view these things on my report print out.
Can anyone help me to do this.
Best Regards,
-Rajib
-
Feb 27th, 2006, 09:55 AM
#2
Re: Crystal Report Viewer in ASP.NET Problem
Printing directly from the web page?
-
Feb 28th, 2006, 03:57 AM
#3
Thread Starter
Lively Member
Re: Crystal Report Viewer in ASP.NET Problem
Thank u mendhak for ur response.
Yes. I am printing it directly from web page. But I don't want to print those unnecessary things that I have already mentioned.
-Rajib
-
Feb 28th, 2006, 04:44 AM
#4
Re: Crystal Report Viewer in ASP.NET Problem
When printing from a webpage, those details WILL show up. If you print using CR's features, it will be printed without those details as CR uses different formats (PDFS,XLS) or an ActiveX Control to do the printing.
-
Feb 28th, 2006, 11:43 PM
#5
Thread Starter
Lively Member
Re: Crystal Report Viewer in ASP.NET Problem
Ok, thats good. But I don't know how CR's features can be used to print.
Please Help me in this case. I never used CR. I have always printed from page.
Rajib
-
Mar 1st, 2006, 09:18 AM
#6
Re: Crystal Report Viewer in ASP.NET Problem
Does your CR report have any export functionality? Can it export to PDF/XLS etc?
-
Mar 2nd, 2006, 02:16 AM
#7
Thread Starter
Lively Member
Re: Crystal Report Viewer in ASP.NET Problem
Actually I don't know how Crystal report can be exported to PDF format.
--Rajib
-
Mar 13th, 2006, 05:45 AM
#8
Thread Starter
Lively Member
Re: Crystal Report Viewer in ASP.NET Problem
Please Response.
I am waiting for u..
-Rajib
-
Mar 13th, 2006, 03:57 PM
#9
Junior Member
Re: Crystal Report Viewer in ASP.NET Problem
I've done something like this before:
VB Code:
Dim rptFiveDay As New FiveDayNotice
SQL = "EXEC sp_rptFiveDayNotice " & Session("FormNo")
adapter = New SqlDataAdapter(SQL, Ado.DataConnection)
adapter.Fill(ds, "FiveDayNotice")
rptFiveDay.SetDataSource(ds)
ExportData(rptFiveDay) 'Pass report to PDF
VB Code:
Public Sub ExportData(ByRef oRpt As Object)
Dim fs As IO.FileStream
Dim FileSize As Long
Dim oDest As New CrystalDecisions.Shared.DiskFileDestinationOptions
Dim ExportFileName As String = System.IO.Path.GetTempPath & Environment.TickCount.ToString & ".pdf"
oRpt.ExportOptions.ExportDestinationType = CrystalDecisions.[Shared].ExportDestinationType.DiskFile
oRpt.ExportOptions.ExportFormatType = CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat
oDest.DiskFileName = ExportFileName
oRpt.ExportOptions.DestinationOptions = oDest
oRpt.Export()
Response.Clear()
Response.Buffer = True
Response.AddHeader("Content-Type", "application/pdf")
fs = New IO.FileStream(ExportFileName, IO.FileMode.Open)
FileSize = fs.Length
Dim bBuffer(CInt(FileSize)) As Byte
fs.Read(bBuffer, 0, CInt(FileSize))
fs.Close()
Response.BinaryWrite(bBuffer)
Response.Flush()
Response.Close()
End Sub
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
|