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.Shared.ExportFormatType.Wor
dForWindows)
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 helpsLi - Try setting the ContentType property to "application/pdf" and set the
ExportFormatType property to "PortableDocFormat."
"Li Pang" <LiPang@.discussions.microsoft.com> wrote in message
news:A2557D45-B661-42F2-AE9A-8DCF34B24DFF@.microsoft.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.Shared.ExportFormatType.W
ordForWindows)
> 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
>
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 adob
e
> reader by using the below codes:
> Dim oStream As New MemoryStream
> oStream =
> crReportDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.W
ordForWindows)
> 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 th
e
> 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 i
n
> adobe reader?
> I appreciate for any helps
>
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:
>
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 adob
e
> reader by using the below codes:
> Dim oStream As New MemoryStream
> oStream =
> crReportDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.W
ordForWindows)
> 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 th
e
> 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 i
n
> adobe reader?
> I appreciate for any helps
>
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 adob
e
> reader by using the below codes:
> Dim oStream As New MemoryStream
> oStream =
> crReportDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.W
ordForWindows)
> 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 th
e
> 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 i
n
> adobe reader?
> I appreciate for any helps
>
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" <LiPang@.discussions.microsoft.com> wrote in message
news:373EDE03-AD9E-4E96-BF4F-220BD17D780B@.microsoft.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.
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:
>
0 comments:
Post a Comment