How to send POST variables in my case?

L

Lars Netzel

Hello!

I have a button, in the click event I have this code:

----------------------------------------------------------------------------
----------------------------
Response.Write("<script
language=javascript>window.open('CrystalReports.aspx?FromDate=" &
txtFromDate.Text & "&ToDate=" & txtToDate.Text & "&File=" &
drpReports.SelectedValue & "');</script>")
----------------------------------------------------------------------------
----------------------------

Due to a problem with Crystal reports.. I cannot send the Variables in the
string and I need to Post them instead
(here's why if you need to know:
http://support.businessobjects.com/library/kbase/articles/c2011964.asp)

How do I POST variables to a page that needs top be opened as a new window
from the VB code?

Best regards/
Lars
 
G

Guest

Dim sScript As String = ""
Dim StrBaseQueryString As String
StrBaseQueryString = "frmRptForm.aspx?RptName=aReport&Paramid=" &
cbXXX.SelectedItem.Value & "&OUTPUT=SCREEN"
sScript &= "<script language=javascript>"
sScript &= "window.open('" & StrBaseQueryString
"','Report','directories=no,titlebar=yes,location=no,scrollbars=yes,resizable=yes,top=0,left=0,outerHeight='
+ screen.availHeight + ',outerWidth=' + screen.availWidth );"
sScript &= "</script>"
Response.Write(sScript)


pls go through the above code, we had tried this more than 100 places and
everywhere it is working smoothly. we are calling our report from out ASP.Net
application and Based of the last parameter i.e OUTPUT can be either SCREEN,
PDF, DOC we have tested all these and working well.. pls let me know the
status

thank you
 
C

Cirrosi

You can create a page to whom you can pass parameters on querystring.
In that page you can dinamically create a field for each parameter of
querystring an than you can Response.Transfer to your report page.
 
B

bruce barker

you add a html from with a target to the new window.

<form name=report action="'CrystalReports.aspx" method="post"
target="_blank">
<input type=hidden name=FromDate value="<%=txtFromDate.Text%>">
<input type=hidden name=ToDate value="<%=txtToDate.Text%">
<input type=hidden name=File value="<%=drpReports.SelectedValue%">
</form>

<script>
document.report.submit();
</script>

note: because there is valid viewstate, the IsPostback will not be set.

-- bruce (sqlwork.com)
 

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,765
Messages
2,569,568
Members
45,042
Latest member
icassiem

Latest Threads

Top