I've gotten a lot of valuable time saving info from this site... thanks! Now a question I couldn't find an answer to:
When passing a session variable that is a number (session("year"), the Crystal Report recognizes it as a parameter, but when passing a session variable that's alphanumeric (session("company"), I get an error message that says 'AI' is Undefined. (AI is the session("company" variable value). Here's my code, any ideas? It's probably something simple, but....
<script language = "JavaScript">
function ProcessForm4(prompta, promptb, promptc, promptd){
//This line generates a 3 digit random number and assign to 'HitCount' parameter in the report
HitCount = Math.round(Math.random() * 1000);
form4.prompt3.value = HitCount;
littlewin = window.open('CostCenterSummary.rpt?init=html_page&prompt0=' + prompta + '&prompt1=' + promptb + '&prompt2=' + promptc + '&prompt3=' + promptd , 'reportwin','width=950,height=500,top=10,left=10,screenX=10,screenY=10,scrollbars=yes,location=yes, toolbar=yes'
);
}
</script>
<html>
<Form method="GET" id="form4" name="form4">
<input type="hidden" name="prompt0" value="<%=session("BudgetYear"%>" size="5">
<input type="hidden" name="prompt1" value="<%=rtrim(session("Company")%>" size="5">
<input type="hidden" name="prompt2" value="<%=rtrim(session("UserID")%>" size="5">
<input type="hidden" name="prompt3" value="0" size="5">
<input type="Submit" id="Submit4" name="Submit4" value="Display Report" onClick="ProcessForm4(<%=session("BudgetYear"%>,<%=rtrim(session("Company")%>,<%=rtrim(session("UserID")%>,Math.round(Math.random() * 1000))">
</form>
</html>
When passing a session variable that is a number (session("year"), the Crystal Report recognizes it as a parameter, but when passing a session variable that's alphanumeric (session("company"), I get an error message that says 'AI' is Undefined. (AI is the session("company" variable value). Here's my code, any ideas? It's probably something simple, but....
<script language = "JavaScript">
function ProcessForm4(prompta, promptb, promptc, promptd){
//This line generates a 3 digit random number and assign to 'HitCount' parameter in the report
HitCount = Math.round(Math.random() * 1000);
form4.prompt3.value = HitCount;
littlewin = window.open('CostCenterSummary.rpt?init=html_page&prompt0=' + prompta + '&prompt1=' + promptb + '&prompt2=' + promptc + '&prompt3=' + promptd , 'reportwin','width=950,height=500,top=10,left=10,screenX=10,screenY=10,scrollbars=yes,location=yes, toolbar=yes'
);
}
</script>
<html>
<Form method="GET" id="form4" name="form4">
<input type="hidden" name="prompt0" value="<%=session("BudgetYear"%>" size="5">
<input type="hidden" name="prompt1" value="<%=rtrim(session("Company")%>" size="5">
<input type="hidden" name="prompt2" value="<%=rtrim(session("UserID")%>" size="5">
<input type="hidden" name="prompt3" value="0" size="5">
<input type="Submit" id="Submit4" name="Submit4" value="Display Report" onClick="ProcessForm4(<%=session("BudgetYear"%>,<%=rtrim(session("Company")%>,<%=rtrim(session("UserID")%>,Math.round(Math.random() * 1000))">
</form>
</html>