Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7966489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:26:28+00:00 2026-06-04T06:26:28+00:00

I am using crystal reports in a .NET 2.0 asp.net website to create a

  • 0

I am using crystal reports in a .NET 2.0 asp.net website to create a PDF from the report. I then want to stream the report to the browser, which I already know how to do. What I don’t know how to do is target the object tag the will hold the PDF. Does someone know how to do this within HTML with javascript or any other way?

Thanks in advance for any help that can be given.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:26:29+00:00Added an answer on June 4, 2026 at 6:26 am

    I wanted to come back and answer this after finding out what I had to do. I had to create a separate aspx page and called it PDFView.aspx. I then added the code to the PageLoad event:

    if (!IsPostBack)
         {
            ReportDocument rpt;
            rpt = (ReportDocument)Session["CrystalReport"];
            System.IO.Stream myStream;
    
            CrystalDecisions.Shared.ExportOptions myExportOptions;
            myExportOptions = myReport.ExportOptions;
            myExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
            myExportOptions.FormatOptions = new CrystalDecisions.Shared.PdfRtfWordFormatOptions();
    
            CrystalDecisions.Shared.ExportRequestContext myExportRequestContext = new CrystalDecisions.Shared.ExportRequestContext();
            myExportRequestContext.ExportInfo = myExportOptions;
            //SetReportParameter("pPrinterFriendly", true, (ReportClass)myReport);
    
            System.Web.HttpContext.Current.Response.ClearContent();
            System.Web.HttpContext.Current.Response.ClearHeaders();
            System.Web.HttpContext.Current.Response.ContentType = "application/pdf";
            myStream = myReport.FormatEngine.ExportToStream(myExportRequestContext);
            Byte[] myBuffer = new Byte[myStream.Length];
            myStream.Read(myBuffer, 0, (int)myStream.Length);
            System.Web.HttpContext.Current.Response.BinaryWrite(myBuffer);
            System.Web.HttpContext.Current.Response.Flush();
    
         }
    

    I created the report object setting all parameters and datasource in the calling aspx page and the wrote the report to a session variable for retrieval when the PDFView.aspx page is loaded. I then used the code above to retrieve, execute and stream the report as a binary stream “the binary PDF” to the browsers response stream.

    The PDFView.aspx page is referenced in the calling page with an object tag like this:

    <object id="pdfObj" type="application/pdf" style="width:60%;height:95%;position:relative;top:2%;left:0%;right:10%;bottom:10%;margin:0px;padding:0px;border:0px;" data="PDFView.aspx"></object>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a report, using either Crystal reports or RDLC, doesn't really
I have an ASP.NET website from which the users themselves will generate custom reports
I need to print PDF's generated in an asp.net application using crystal reports. Upon
I'm using Crystal Reports in my asp.net application. I need to pass string as
I am updating an existing reporting system in ASP.NET which uses crystal reports. In
I have Finished Designing my first Crystal Report using ASP.NET, I am Providing user
hi i am new to crystal reports and ASP.NET I have a crystal report
I am using the following code to output a Crystal Report to an ASP.NET
im using asp.net crystal report ........ sql query: CONVERT(NUMERIC(17,3), CASE WHEN CASE WHEN GLDD_DOC_AMOUNT
im using asp.net crystal report......i just upload the crystal in server and comiled i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.