Solved

passing parameter from java script to crystal report

Posted on 2004-10-07
3
836 Views
Last Modified: 2008-03-17
hello
    i want pass a parameter from java script to crystal report.   pls c the codeing where i have underlined.plshelp me
         the codeing is as follows:

  <?php

 
   $code = "<html>";    
                  $code .= "\n\t<head>";
                  $code .= "\n\t<script language='javascript'>";
               
            $code .= "\n\tfunction BtnClick(par) {";
            $code .= "\n\tswitch (par) {";
            
                  
            $code .= "\n\tcase 'Report' :";
                                $code .= "\n\tlocation.href = './hcfa.rpt';";
                                     ----------------------------------------       
                     $code .= "\n\tbreak;";                   
            $code .= "\n\tdefault:";
            $code .= "\n\talert(par); }";  
            $code .= "\n\t}";
            $code .= "\n\t</script>";
            $code .= "\n\t</head>";
       
           
             
         $code .= "</table></td></tr></table><table border=0  cellpadding=0 cellspacing=0 width=100%><tr><td width=100%><table  width=100%><tr><td width=50%>&nbsp;</td><td align=center>";
             $code .= "<td align=center><img src=./img/report.png name= Export alt='Export HCFA' onclick='BtnClick(\"Report\")'></td>";
         $code .= "</td></tr></table></td></tr></table></center>";
     
      $code .="</html>\n";
 echo $code;
 
0
Comment
Question by:cyrilvictor
  • 2
3 Comments
 
LVL 42

Expert Comment

by:frodoman
ID: 12247944
Looks like you're calling an unmanaged report?  You should be able to just append to the URL:

$code.= "\n\tlocation.href = './hcfa.rpt?promptex0=paramvalue';";
0
 
LVL 42

Accepted Solution

by:
frodoman earned 50 total points
ID: 12262037
cyrilvictor - Sorry for the delay in response, but you posted in my feedback area so I didn't see it 'til now...

For everyone's reference the posting from asker was as follows:
-----------------------------------------------------------------------------
thanks for ur response but it is not working.
  i used the code as follows:
     $code .= "\n\tlocation.href = './hcfa.rpt?&visitid=2';";
  but it is not working, pls help me
-----------------------------------------------------------------------------

In this code you must replace "visitid" with "promptex0".  This is crystal-specific syntax - Crystal will look for the value assigned to promptex0 to fill the first report parameter.  If there's a second report parameter Crystal will look for the value assigned to promptex1, etc.

frodoman
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question