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

BinaryWrite cause problem with browser Back button

P: n/a
I want to generate a report and display it as a pdf in a WebForm
(RptForm). To generate the report I need to pass some (sometimes a lot
of) parameters from a WebForm (WebForm1).

The report looks fine when I use Response.BinaryWrite to create it:

oStream = (MemoryStream)oRpt.ExportToStream(CrystalDecisions .Shared.ExportFormatType.PortableDocFormat);
Response.Clear();
Response.Buffer= true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(oStream.ToArray());
Response.End();

The problem I have is that once I have created the pdf with
BinaryWrite I want the back button in the browser to send me back to
WebForm1. But the back button will send me back to the page that
called WebForm1. If I view the report without creating a pdf the back
button works fine.

Since the parameter string is sometimes too long for a
Request.QueryString I use Server.Transfer() to pass the parameters to
the ReportForm:
//ReportForm
WebForm1 sourcePage = (WebForm1)Context.Handler;
string param = sourcePage.param;

It's OK to open the RptForm in a new browser window. But how can I get
my paramer string passed to that new window when I can't use
Request.QueryString?

/Magnus
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
One idea is to store the parameters in the ASP.NET data Cache (and give it
a timeout... say 1 minute) and index the Cache by a new Guid you create dynamically.
Then send a Response.Redirect to the new URL with the Guid QueryString where
it can look up the parameters form the cache based upon the QueryString,
then load whatever data it needs and then send back the response.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I want to generate a report and display it as a pdf in a WebForm
(RptForm). To generate the report I need to pass some (sometimes a lot
of) parameters from a WebForm (WebForm1).

The report looks fine when I use Response.BinaryWrite to create it:

oStream =
(MemoryStream)oRpt.ExportToStream(CrystalDecisions .Shared.ExportFormat
Type.PortableDocFormat);

Response.Clear();

Response.Buffer= true;

Response.ContentType = "application/pdf";

Response.BinaryWrite(oStream.ToArray());

Response.End();

The problem I have is that once I have created the pdf with
BinaryWrite I want the back button in the browser to send me back to
WebForm1. But the back button will send me back to the page that
called WebForm1. If I view the report without creating a pdf the back
button works fine.

Since the parameter string is sometimes too long for a
Request.QueryString I use Server.Transfer() to pass the parameters to
the ReportForm:
//ReportForm
WebForm1 sourcePage = (WebForm1)Context.Handler;
string param = sourcePage.param;
It's OK to open the RptForm in a new browser window. But how can I get
my paramer string passed to that new window when I can't use
Request.QueryString?

/Magnus


Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.