By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,354 Members | 1,042 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,354 IT Pros & Developers. It's quick & easy.

web crystal report in pdf format

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.