Solved

passing parameter from java script to crystal report

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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 …
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

707 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

15 Experts available now in Live!

Get 1:1 Help Now