Solved

passing parameter from java script to crystal report

Posted on 2004-10-07
3
835 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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

777 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