I am getting a little further, but still having issues...

B

Brent White

If you need more information, I'd be glad to give it, but I am
developing an ASPX page so that the user can select multiple values for
a specific field, then pass them on (using Crystal Reports 10 on a
separate ASP page). Here is the code behind the button that will
launch the report (is in a file called StateSelect.aspx.vb:

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button2.Click
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
End Sub


When I launch the ASP page and hit the submit button, I get the
following error in the IE window:

Server Error in '/NEWCrystalReports' Application.
--------------------------------------------------------------------------------

Error executing child request for /NewCrystalReports/genericreport.asp.

Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Error executing child
request for /NewCrystalReports/genericreport.asp.

Source Error:


Line 40:
Line 41: Protected Sub Button2_Click(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Button2.Click
Line 42:
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
Line 43: End Sub
Line 44: End Class


Source File: c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.aspx.vb
Line: 42

Stack Trace:


[HttpException (0x80004005): Error executing child request for
/NewCrystalReports/genericreport.asp.]
System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler,
TextWriter writer, Boolean preserveForm, String path, String filePath,
String physPath, Exception error, String queryStringOverride) +3137343
System.Web.HttpServerUtility.Execute(String path, TextWriter writer,
Boolean preserveForm) +722
System.Web.HttpServerUtility.Transfer(String path, Boolean
preserveForm) +55
_Default.Button2_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.aspx.vb:42
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) +78

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+5670




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50215.44;
ASP.NET Version:2.0.50215.44





There is this line in the ASPX file itself:

<form method="post" id="form1" runat="server"
action="GenericReport.asp">





The server is running ASP.NET v2 (Windows 2003 Server with IIS 6) and I
am developing in VS .NET 2005.
 
S

S. Justin Gengo

Brent,

I'm pretty certain that you can't server.transfer from a new ASP.NET
application back to an old ASP application. Server.Transfer will try to make
your ASP.NET application load the .asp page into it's runtime. That of
course can't happen since the code is foreign to it.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
Brent White said:
If you need more information, I'd be glad to give it, but I am
developing an ASPX page so that the user can select multiple values for
a specific field, then pass them on (using Crystal Reports 10 on a
separate ASP page). Here is the code behind the button that will
launch the report (is in a file called StateSelect.aspx.vb:

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button2.Click
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
End Sub


When I launch the ASP page and hit the submit button, I get the
following error in the IE window:

Server Error in '/NEWCrystalReports' Application.
--------------------------------------------------------------------------------

Error executing child request for /NewCrystalReports/genericreport.asp.

Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Error executing child
request for /NewCrystalReports/genericreport.asp.

Source Error:


Line 40:
Line 41: Protected Sub Button2_Click(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Button2.Click
Line 42:
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
Line 43: End Sub
Line 44: End Class


Source File: c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.aspx.vb
Line: 42

Stack Trace:


[HttpException (0x80004005): Error executing child request for
/NewCrystalReports/genericreport.asp.]
System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler,
TextWriter writer, Boolean preserveForm, String path, String filePath,
String physPath, Exception error, String queryStringOverride) +3137343
System.Web.HttpServerUtility.Execute(String path, TextWriter writer,
Boolean preserveForm) +722
System.Web.HttpServerUtility.Transfer(String path, Boolean
preserveForm) +55
_Default.Button2_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.aspx.vb:42
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) +78

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+5670




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50215.44;
ASP.NET Version:2.0.50215.44





There is this line in the ASPX file itself:

<form method="post" id="form1" runat="server"
action="GenericReport.asp">





The server is running ASP.NET v2 (Windows 2003 Server with IIS 6) and I
am developing in VS .NET 2005.
 
B

Brent

How do I post to the existing ASP page from the ASP.NET page then?

S. Justin Gengo said:
Brent,

I'm pretty certain that you can't server.transfer from a new ASP.NET
application back to an old ASP application. Server.Transfer will try to make
your ASP.NET application load the .asp page into it's runtime. That of
course can't happen since the code is foreign to it.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
Brent White said:
If you need more information, I'd be glad to give it, but I am
developing an ASPX page so that the user can select multiple values for
a specific field, then pass them on (using Crystal Reports 10 on a
separate ASP page). Here is the code behind the button that will
launch the report (is in a file called StateSelect.aspx.vb:

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button2.Click
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
End Sub


When I launch the ASP page and hit the submit button, I get the
following error in the IE window:

Server Error in '/NEWCrystalReports' Application.
------------------------------------------------------------------------
--------
Error executing child request for /NewCrystalReports/genericreport.asp.

Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Error executing child
request for /NewCrystalReports/genericreport.asp.

Source Error:


Line 40:
Line 41: Protected Sub Button2_Click(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Button2.Click
Line 42:
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
Line 43: End Sub
Line 44: End Class


Source File: c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.aspx.vb
Line: 42

Stack Trace:


[HttpException (0x80004005): Error executing child request for
/NewCrystalReports/genericreport.asp.]
System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler,
TextWriter writer, Boolean preserveForm, String path, String filePath,
String physPath, Exception error, String queryStringOverride) +3137343
System.Web.HttpServerUtility.Execute(String path, TextWriter writer,
Boolean preserveForm) +722
System.Web.HttpServerUtility.Transfer(String path, Boolean
preserveForm) +55
_Default.Button2_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.aspx.vb:42
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) +78
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.Rai
sePostBackEvent(String
eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+5670
------------------------------------------------------------------------
--------
Version Information: Microsoft .NET Framework Version:2.0.50215.44;
ASP.NET Version:2.0.50215.44





There is this line in the ASPX file itself:

<form method="post" id="form1" runat="server"
action="GenericReport.asp">





The server is running ASP.NET v2 (Windows 2003 Server with IIS 6) and I
am developing in VS .NET 2005.
 
G

Guest

Response.Redirect

Brent said:
How do I post to the existing ASP page from the ASP.NET page then?

S. Justin Gengo said:
Brent,

I'm pretty certain that you can't server.transfer from a new ASP.NET
application back to an old ASP application. Server.Transfer will try to make
your ASP.NET application load the .asp page into it's runtime. That of
course can't happen since the code is foreign to it.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
Brent White said:
If you need more information, I'd be glad to give it, but I am
developing an ASPX page so that the user can select multiple values for
a specific field, then pass them on (using Crystal Reports 10 on a
separate ASP page). Here is the code behind the button that will
launch the report (is in a file called StateSelect.aspx.vb:

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button2.Click
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
End Sub


When I launch the ASP page and hit the submit button, I get the
following error in the IE window:

Server Error in '/NEWCrystalReports' Application.
------------------------------------------------------------------------
--------
Error executing child request for /NewCrystalReports/genericreport.asp.

Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Error executing child
request for /NewCrystalReports/genericreport.asp.

Source Error:


Line 40:
Line 41: Protected Sub Button2_Click(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Button2.Click
Line 42:
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
Line 43: End Sub
Line 44: End Class


Source File: c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.aspx.vb
Line: 42

Stack Trace:


[HttpException (0x80004005): Error executing child request for
/NewCrystalReports/genericreport.asp.]
System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler,
TextWriter writer, Boolean preserveForm, String path, String filePath,
String physPath, Exception error, String queryStringOverride) +3137343
System.Web.HttpServerUtility.Execute(String path, TextWriter writer,
Boolean preserveForm) +722
System.Web.HttpServerUtility.Transfer(String path, Boolean
preserveForm) +55
_Default.Button2_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.aspx.vb:42
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) +78
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.Rai
sePostBackEvent(String
eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+5670
------------------------------------------------------------------------
--------
Version Information: Microsoft .NET Framework Version:2.0.50215.44;
ASP.NET Version:2.0.50215.44





There is this line in the ASPX file itself:

<form method="post" id="form1" runat="server"
action="GenericReport.asp">





The server is running ASP.NET v2 (Windows 2003 Server with IIS 6) and I
am developing in VS .NET 2005.
 
S

S. Justin Gengo

Brent,

Yes, Sreejith is correct you need to use a Response.Redirect. And then
include the values you need to pass to the ASP page in the querystring.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
Sreejith Ram said:
Response.Redirect

Brent said:
How do I post to the existing ASP page from the ASP.NET page then?

S. Justin Gengo said:
Brent,

I'm pretty certain that you can't server.transfer from a new ASP.NET
application back to an old ASP application. Server.Transfer will try to make
your ASP.NET application load the .asp page into it's runtime. That of
course can't happen since the code is foreign to it.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
If you need more information, I'd be glad to give it, but I am
developing an ASPX page so that the user can select multiple values for
a specific field, then pass them on (using Crystal Reports 10 on a
separate ASP page). Here is the code behind the button that will
launch the report (is in a file called StateSelect.aspx.vb:

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button2.Click
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
End Sub


When I launch the ASP page and hit the submit button, I get the
following error in the IE window:

Server Error in '/NEWCrystalReports' Application.
------------------------------------------------------------------------
--------

Error executing child request for /NewCrystalReports/genericreport.asp.

Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Error executing child
request for /NewCrystalReports/genericreport.asp.

Source Error:


Line 40:
Line 41: Protected Sub Button2_Click(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Button2.Click
Line 42:
Server.Transfer("/NewCrystalReports/genericreport.asp", True)
Line 43: End Sub
Line 44: End Class


Source File: c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.aspx.vb
Line: 42

Stack Trace:


[HttpException (0x80004005): Error executing child request for
/NewCrystalReports/genericreport.asp.]
System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler,
TextWriter writer, Boolean preserveForm, String path, String filePath,
String physPath, Exception error, String queryStringOverride) +3137343
System.Web.HttpServerUtility.Execute(String path, TextWriter writer,
Boolean preserveForm) +722
System.Web.HttpServerUtility.Transfer(String path, Boolean
preserveForm) +55
_Default.Button2_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\NEWCrystalReports\StateSelect.aspx.vb:42
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) +78

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.Rai
sePostBackEvent(String
eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+5670




------------------------------------------------------------------------
--------
Version Information: Microsoft .NET Framework Version:2.0.50215.44;
ASP.NET Version:2.0.50215.44





There is this line in the ASPX file itself:

<form method="post" id="form1" runat="server"
action="GenericReport.asp">





The server is running ASP.NET v2 (Windows 2003 Server with IIS 6) and I
am developing in VS .NET 2005.
 
B

Brent

I don't suppose there's a way to pass the request parameters through
code instead of appending it to the URL, is there?

I ask because what I am passing is a filter selection for a Crystal 10
report that contains the States the report should be viewed for and the
report name itself (to lessen the number of ASP files I have to maintain
in the virtual directory), and that URL may be quite long and contain
some illegal characters.
 
S

S. Justin Gengo

Brent,

The only other thing I can think of is a bit lengthy, but you could put a
literal control onto a page and then use the HttpWebRequest object to post
to the page with the included parameters and then render the results to the
literal.

That would look something like this:

***Also a word of warning. It took me a while to get this working (sorry it
took so long to post back) because I kept getting 405 Method not allowed
errors from the site I was testing this code against. It turned out that the
server was refusing the posted data because I was using fake parameters. You
have to post with each and every paramter named exactly as the page is
expecting and go directly to the page or you'll get that error.

'---Create the request
Dim WebRequest As System.Net.WebRequest
WebRequest = System.Net.WebRequest.Create(New
Uri(http://www.mysite.com/mypage.asp))

'---Optionally set the timeout (if you don't the default timeout will be
used)
WebRequest.Timeout = 2000

'---Create the post data
Dim PostData As String = "id=" & HttpUtility.UrlEncode("1234") & "&state=" &
HttpUtility.UrlEncode("WI")
WebRequest.Method = "POST"

Dim PostBuffer() As Byte =
System.Text.Encoding.GetEncoding(1252).GetBytes(PostData)

WebRequest.ContentLength = PostBuffer.Length
WebRequest.ContentType = "application/x-www-form-urlencoded"

Dim PostDataStream As System.IO.Stream = WebRequest.GetRequestStream()
PostDataStream.Write(PostBuffer, 0, PostBuffer.Length)
PostDataStream.Close()

'---Get the response produced by the request
Dim Response As System.Net.WebResponse = WebRequest.GetResponse

'---Download the page content into a stream
Dim Stream As System.IO.Stream = Response.GetResponseStream

'---Place the stream into a stream reader
Dim StreamReader As New System.IO.StreamReader(Stream)

'---Read the stream into a string object
Dim Html As String = StreamReader.ReadToEnd

'---Cleanup for the next request
Stream.Close()
StreamReader.Close()

'---Place the page found into the literal control
Literal1.Text = Html

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
G

Guest

Another approach would be to create a table to hold the transaction data for
the report..

steps would be like this...

create a key value from asp.net page
save params for the report in the transaction table with the key , from
asp.net page
redirect to the asp page & pass the key using query string
read the parameters from asp page
delete the record in the transaction table for the key, from asp page..

What Justin suggested may be a better solution than this. if the crystal
report is being opened in the same window as asp page , would assigning the
response to literal work ? the Request.ContentType will need to be changed i
suppose. not sure..

S. Justin Gengo said:
Brent,

The only other thing I can think of is a bit lengthy, but you could put a
literal control onto a page and then use the HttpWebRequest object to post
to the page with the included parameters and then render the results to the
literal.

That would look something like this:

***Also a word of warning. It took me a while to get this working (sorry it
took so long to post back) because I kept getting 405 Method not allowed
errors from the site I was testing this code against. It turned out that the
server was refusing the posted data because I was using fake parameters. You
have to post with each and every paramter named exactly as the page is
expecting and go directly to the page or you'll get that error.

'---Create the request
Dim WebRequest As System.Net.WebRequest
WebRequest = System.Net.WebRequest.Create(New
Uri(http://www.mysite.com/mypage.asp))

'---Optionally set the timeout (if you don't the default timeout will be
used)
WebRequest.Timeout = 2000

'---Create the post data
Dim PostData As String = "id=" & HttpUtility.UrlEncode("1234") & "&state=" &
HttpUtility.UrlEncode("WI")
WebRequest.Method = "POST"

Dim PostBuffer() As Byte =
System.Text.Encoding.GetEncoding(1252).GetBytes(PostData)

WebRequest.ContentLength = PostBuffer.Length
WebRequest.ContentType = "application/x-www-form-urlencoded"

Dim PostDataStream As System.IO.Stream = WebRequest.GetRequestStream()
PostDataStream.Write(PostBuffer, 0, PostBuffer.Length)
PostDataStream.Close()

'---Get the response produced by the request
Dim Response As System.Net.WebResponse = WebRequest.GetResponse

'---Download the page content into a stream
Dim Stream As System.IO.Stream = Response.GetResponseStream

'---Place the stream into a stream reader
Dim StreamReader As New System.IO.StreamReader(Stream)

'---Read the stream into a string object
Dim Html As String = StreamReader.ReadToEnd

'---Cleanup for the next request
Stream.Close()
StreamReader.Close()

'---Place the page found into the literal control
Literal1.Text = Html

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
S

S. Justin Gengo

Sreejith,

Good point. I was assuming that it's a web report. If it isn't then a
response.type coud be set to deliver the stream as a file.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
Sreejith Ram said:
Another approach would be to create a table to hold the transaction data
for
the report..

steps would be like this...

create a key value from asp.net page
save params for the report in the transaction table with the key , from
asp.net page
redirect to the asp page & pass the key using query string
read the parameters from asp page
delete the record in the transaction table for the key, from asp page..

What Justin suggested may be a better solution than this. if the crystal
report is being opened in the same window as asp page , would assigning
the
response to literal work ? the Request.ContentType will need to be changed
i
suppose. not sure..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top