473,499 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

web crystal report in pdf format

Hi,

I built a web form to display a crystal report in web, every thing work
properly. I added then a button to display the report in the embedded adobe
reader by using the below codes:

Dim oStream As New MemoryStream
oStream =
crReportDocument.ExportToStream(CrystalDecisions.S hared.ExportFormatType.WordForWindows)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/msword"
Response.BinaryWrite(oStream.ToArray())
Response.End()

It works as well. Then I supressed the button and called above codes at the
last time of form load, but the browser returned me some strange codes
instead of the pdf report. Is there a way to display the report directly in
adobe reader?

I appreciate for any helps

Dec 14 '05 #1
7 4159
Li - Try setting the ContentType property to "application/pdf" and set the
ExportFormatType property to "PortableDocFormat."

"Li Pang" <Li****@discussions.microsoft.com> wrote in message
news:A2**********************************@microsof t.com...
Hi,

I built a web form to display a crystal report in web, every thing work
properly. I added then a button to display the report in the embedded
adobe
reader by using the below codes:

Dim oStream As New MemoryStream
oStream =
crReportDocument.ExportToStream(CrystalDecisions.S hared.ExportFormatType.WordForWindows)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/msword"
Response.BinaryWrite(oStream.ToArray())
Response.End()

It works as well. Then I supressed the button and called above codes at
the
last time of form load, but the browser returned me some strange codes
instead of the pdf report. Is there a way to display the report directly
in
adobe reader?

I appreciate for any helps

Dec 14 '05 #2
hi,

I try to do the same thing as you mentionned but I ma one step backwards
I am not able to display report data on a web form

How do you do this, do you have a sample ?

Do you use the embeded Crystal file to framework or did you installed the
full developper version ?

thanks for your hlep
regards

"Li Pang" wrote:
Hi,

I built a web form to display a crystal report in web, every thing work
properly. I added then a button to display the report in the embedded adobe
reader by using the below codes:

Dim oStream As New MemoryStream
oStream =
crReportDocument.ExportToStream(CrystalDecisions.S hared.ExportFormatType.WordForWindows)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/msword"
Response.BinaryWrite(oStream.ToArray())
Response.End()

It works as well. Then I supressed the button and called above codes at the
last time of form load, but the browser returned me some strange codes
instead of the pdf report. Is there a way to display the report directly in
adobe reader?

I appreciate for any helps

Dec 14 '05 #3
Hi
It looks like you are using MS word export format and not pdf

Response.ContentType = "application/pdf"
ExportFormatType.PortableDocFormat


"serge calderara" wrote:
hi,

I try to do the same thing as you mentionned but I ma one step backwards
I am not able to display report data on a web form

How do you do this, do you have a sample ?

Do you use the embeded Crystal file to framework or did you installed the
full developper version ?

thanks for your hlep
regards

"Li Pang" wrote:
Hi,

I built a web form to display a crystal report in web, every thing work
properly. I added then a button to display the report in the embedded adobe
reader by using the below codes:

Dim oStream As New MemoryStream
oStream =
crReportDocument.ExportToStream(CrystalDecisions.S hared.ExportFormatType.WordForWindows)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/msword"
Response.BinaryWrite(oStream.ToArray())
Response.End()

It works as well. Then I supressed the button and called above codes at the
last time of form load, but the browser returned me some strange codes
instead of the pdf report. Is there a way to display the report directly in
adobe reader?

I appreciate for any helps

Dec 14 '05 #4
If you still want to show word file, use following code:

Response.ContentType = "octet/stream";
Response.AddHeader("Content-Disposition", "attachment;filename=filename");

HTH

"Li Pang" wrote:
Hi,

I built a web form to display a crystal report in web, every thing work
properly. I added then a button to display the report in the embedded adobe
reader by using the below codes:

Dim oStream As New MemoryStream
oStream =
crReportDocument.ExportToStream(CrystalDecisions.S hared.ExportFormatType.WordForWindows)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/msword"
Response.BinaryWrite(oStream.ToArray())
Response.End()

It works as well. Then I supressed the button and called above codes at the
last time of form load, but the browser returned me some strange codes
instead of the pdf report. Is there a way to display the report directly in
adobe reader?

I appreciate for any helps

Dec 14 '05 #5
Hi,

Thanks for all. I'm sorry that there is a mistake in my codes, I did use
Response.ContentType = "application/pdf"
and not
Response.ContentType = "application/msword"

otherwise I could get Adobe working. My issue is to display the report in
adobe directly but not by clicking a button with a codes given.

serge calderara,
please refer to the book
"Professional Crystal Reports for Visual Studio .NET"


"Li Pang" wrote:
Hi,

I built a web form to display a crystal report in web, every thing work
properly. I added then a button to display the report in the embedded adobe
reader by using the below codes:

Dim oStream As New MemoryStream
oStream =
crReportDocument.ExportToStream(CrystalDecisions.S hared.ExportFormatType.WordForWindows)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/msword"
Response.BinaryWrite(oStream.ToArray())
Response.End()

It works as well. Then I supressed the button and called above codes at the
last time of form load, but the browser returned me some strange codes
instead of the pdf report. Is there a way to display the report directly in
adobe reader?

I appreciate for any helps

Dec 15 '05 #6
I'm not sure if you can do this in the Page_Load. Try putting your code in
the Page_Render method instead.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"Li Pang" <Li****@discussions.microsoft.com> wrote in message
news:37**********************************@microsof t.com...
Hi,

Thanks for all. I'm sorry that there is a mistake in my codes, I did use
Response.ContentType = "application/pdf"
and not
Response.ContentType = "application/msword"

otherwise I could get Adobe working. My issue is to display the report in
adobe directly but not by clicking a button with a codes given.

Dec 15 '05 #7
Since you export CR to word format, you can’t open it by adobe
Reader, even if you use
Response.ContentType = "application/pdf".
adobe Reader will recognize it is not pdf file.

HTH

Elton

"Li Pang" wrote:
Hi,

Thanks for all. I'm sorry that there is a mistake in my codes, I did use
Response.ContentType = "application/pdf"
and not
Response.ContentType = "application/msword"

otherwise I could get Adobe working. My issue is to display the report in
adobe directly but not by clicking a button with a codes given.

serge calderara,
please refer to the book
"Professional Crystal Reports for Visual Studio .NET"


"Li Pang" wrote:
Hi,

I built a web form to display a crystal report in web, every thing work
properly. I added then a button to display the report in the embedded adobe
reader by using the below codes:

Dim oStream As New MemoryStream
oStream =
crReportDocument.ExportToStream(CrystalDecisions.S hared.ExportFormatType.WordForWindows)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/msword"
Response.BinaryWrite(oStream.ToArray())
Response.End()

It works as well. Then I supressed the button and called above codes at the
last time of form load, but the browser returned me some strange codes
instead of the pdf report. Is there a way to display the report directly in
adobe reader?

I appreciate for any helps

Dec 16 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3699
by: Raghu | last post by:
Hi, In my ASP.NET web application project we need to design crystal reports with Crystal Reports version 8.5 enterpraise edition(Please Note:It is not the Crystal Reports that comes with...
1
2000
by: Stephanie Stowe | last post by:
I am doing a support rotation for our massive ASP app. We use Crystal Reports / Enterprise. By some magic which I am unfamiliar with Crystal Enterprise allows the creation of a report on the...
3
5982
by: Colin Graham | last post by:
I have recently created a report in crystal(10) linking to a dataset as the datasource. I notice however that the fields available in the report all have STRING format and therefore i cannot change...
1
5806
by: Ron Holmes | last post by:
I posted this question on the Crystal Reports Support site and I am still waiting for an answer. Using Crystal Reports 9.0 Developer Full edition: My Crystal report .RPT file has a Picture box...
0
1578
by: Zoury | last post by:
Hi there ! :O) I'm having a two strange behaviors with Crystal Report which seems to have the same cause.. All the fields used in the reports comes from some SQL Server views. *** 1st...
6
13098
by: Robin Cushman | last post by:
Hi all, I need some help -- I'm working with an A2K database, using DAO, and am trying to read records into a Crystal Report and then export it to a folder on our network as an Excel...
19
3844
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set...
1
3256
by: CBKowitz | last post by:
I have an intermittent problem, when viewing a crystal report. This problem only happens to some users and some report formats. When they try to view the report in Microsoft Word format the...
4
12157
by: jaYPee | last post by:
I have a report created in crystal report. My problem is on how can I remove the decimal point without converting the value. say for example if I have this data: Unit 2 1.5 2 3
2
11876
Pittaman
by: Pittaman | last post by:
Hello I am creating some crystal reports (for visual studio 2005) based on the content of certain .NET objects. I'm doing this in .NET 2.0. For one of them I'm using a Cross-table to summarize...
0
7131
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5470
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
297
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.