Solved

passing parameter from java script to crystal report

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now