Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web Reports 2

Status
Not open for further replies.

durug

Technical User
Joined
Mar 22, 2002
Messages
335
Location
CA
Did somebody worked with Crystal reports on IIS?
I'm calling the report from an asp page like this:
and a messagebox is opening up asking for the Parameter Name.
But I provided Name with the value Test in the URL.

Does anybody have a solution for this?
Thanks a lot.

Durug
 
I use ASP to deploy my reports, but do not call the report through the URL. I use session variables to set the Report objects properties. This works very well and I have no problems. You can set the report to run, the selection criteria, parameters, sort order..... I then use the SmartViewerActiveX.asp to run the report.
 
Can you post an example with passing parameter, please.

Thanks a lot,
Durug
 
Session("oRpt").RecordSelectionFormula = "{Report.FieldName}=Value"

Use this before you call the SmartViewerActiveX.asp.
 
I know it's stupid but please can you post the whole page where you call the report. I never worked with Crystal Reports on the web...

Thanks,
Durug
 
To post all of that would be time consuming and may reveal some propriatary code. You can get the files you need to set up reporting via ASP from the Crystal web site. the file you are looking for is aspxmps85.zip for version 8.5, aspxmps8.zip for version 8. There are some inconsistancies in these code examples, but I will be more than willing to help you as you go.
 
Hi bjrollet!

Can you check the following thread where I posted my whole problem, after testing with the code that you suggested.

<a href=&quot;thread149-252342 a lot!
Durug
 
Hi DuRug...I have found it better to avoid Seagate's examples of using asp since the ActiveX object is a single-threaded process and, if it fails, can lock up IIS...

We use Seagate's web components on IIS and, except for mysterious stoppages of the pageserver component on occassion, it works ok - Then you can use 'standard' Forms to set the parameters and call the report..
The following is opinion only, so [peace]
We are moving to a product called CrystalClear which is a Java-based servlet that can run Crystal Reports on the web with little or no redesign - This product runs under Tomcat or as an EJB ( or standalone ) and, since it is running under Unix, is inherently more stable than services running on a Wintel box.
 
Finally I managed to run the report. But don't ask me how come it's working (and didn't worked before). The only difference is the name of the parameters. You don't have to supply PO_Number. Instead you use prompt0. Next parameter will be prompt1, etc...

I'm just calling the report like this:
Where the value of prompt0 and prompt1 are the values of the two paramters that I need in my CR8

What do you mean by:&quot;We use Seagate's web components on IIS and, except for mysterious stoppages of the pageserver component on occassion, it works ok - Then you can use 'standard' Forms to set the parameters and call the report..&quot;

Calling the report in the URL? I heard something about username and password???

Thanks,
Durug
 
Here's an example of a page to call a report after
allowing the user to select 2 parameters ( with multiple values if needed )
-as you can see, it passes them by setting the form properties to the values expected by Crystal..
Code:
<HTML>                                                                                          
<HEAD>                                                         
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>                                                                                            
                                                                                                                            
function GetData(form) {                                                                                             
 var dpt = form.dept                                                                                                        
 var clss = form.cl                                                                                                         
                                                                                         
 var chcdpt = &quot;[&quot;                                                                                                           
for (var i = 0; i < dpt.length; i++ ){                                                                                      
    if (dpt.options[i].selected == true) {                                                                                  
        chcdpt += &quot;'&quot;                                                                                                       
        chcdpt += dpt.options[i].value                                                                                      
        chcdpt += &quot;',&quot;                                                                                                      
         }                                                                                                                  
       }                                                                                                                    
      chcdpt += &quot;]&quot;                                                                                                         
      regepdpt = &quot;,]&quot;                                                                                                       
      newstrdpt = &quot;]&quot;                                                                                                       
      str1 = chcdpt.replace(regepdpt,newstrdpt)  
 // Get Next Parameter list                                                                                                 
 var chccl = &quot;[&quot;                                                                                                            
   for (var i = 0; i < clss.length; i++ ){                                                                                     
    if (clss.options[i].selected == true) {                                                                                 
        chccl += &quot;'&quot;                                                                                                        
        chccl += clss.options[i].value                                                                                      
        chccl += &quot;',&quot;                                                                                                       
         }                                                                                                                  
       }                                                                                                                    
      chccl += &quot;]&quot;                                                                                                          
      regepcl = &quot;,]&quot;                                                                                                        
      newstrcl = &quot;]&quot;                                                                                                        
    str2 = chccl.replace(regepcl,newstrcl)                                                                                                                                                       
      form.prompt0.value = str2                                                                           
      form.prompt1.value = str1                                                                           
      form.action=&quot;Unit_NumberMulti.rpt&quot;                                                                                                                           
      form.submit()                                                                                                               
     }                                                                                                                           
function OpenWindowPrompt() {                                                                                               
      pwin = window.open(&quot;&quot;,&quot;&quot;,&quot;status,height=300,width=600, top=200 ,left=200&quot;)                                            
      pwin.document.write(&quot;<HEAD>&quot;)                                                                                         
      pwin.document.write(&quot;<TITLE> Wait  </TITLE>&quot;)                                                                         
      var pcontent = &quot;</HEAD>&quot;                                                                                              
          pcontent += &quot;<BODY bgcolor='#FFFFFF'  >&quot;                                                                          
          pcontent += &quot;<font color='#FF0000'>&quot;                                                                              
          pcontent += &quot;<H2> Please Wait For Data To Load into Form </H2></font>&quot;                                               
	  pcontent += &quot;</BODY>&quot;                                                                                             
      pwin.document.write(pcontent)                                                                                         
           }                                                                                                                
function CloseWindowPrompt() {                                                                                              
pwin.document.write(&quot;<H3  Thanks for Your Patience  </H3>&quot;)                                       
for (var i= 0; i < 900000; i++) {                                                                                           
tnothing = i                                                                                                                
}                                                                                                                           
pwin.close()                                                                                                                
}                                                                                                                           
</SCRIPT>                                                                                                                   
</HEAD>                                                                                                                     
<BODY bgcolor=&quot;#CCFFFF&quot; OnLoad=&quot;CloseWindowPrompt()&quot;>                                                                       
                                                                                                                            
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>                                                                                              
OpenWindowPrompt()                                                                                                          
</SCRIPT>                                                                                                                   
                                                                                                                            
                                                                                                                            
                                                                                                                            
                                                                                                                            
                                                                                                                            
	                                                                                                                    
	 	<FORM NAME=&quot;First&quot; METHOD=&quot;POST&quot; ACTION=&quot;&quot;>                                                                 
	                                                                                                                    
	<BR>                                                                                                                
	<p><b>Choose 1 or More Departments - <u>Cntl-Click with Mouse Button to Select more than one</u><b></p>                                       
	<SELECT NAME=&quot;dept&quot; MULTIPLE SIZE=&quot;5&quot;>                                                                              
	   <OPTION SELECTED VALUE=&quot;ALL&quot;>ALL</OPTION>                                            
<OPTION VALUE=&quot;1A9102&quot;>1A9102</OPTION>
<OPTION VALUE=&quot;1B9106&quot;>1B9106</OPTION>
<OPTION VALUE=&quot;2X9200&quot;>2X9200</OPTION>
<OPTION VALUE=&quot;3A9307&quot;>3A9307</OPTION>
<OPTION VALUE=&quot;3B9305&quot;>3B9305</OPTION>
<OPTION VALUE=&quot;3BFUNI&quot;>3BFUNI</OPTION>
<OPTION VALUE=&quot;3X9307&quot;>3X9307</OPTION>
<OPTION VALUE=&quot;4X9400&quot;>4X9400</OPTION>
<OPTION VALUE=&quot;6A9610&quot;>6A9610</OPTION>
<OPTION VALUE=&quot;6B9640&quot;>6B9640</OPTION>
<OPTION VALUE=&quot;7A9731&quot;>7A9731</OPTION>
<OPTION VALUE=&quot;7B9732&quot;>7B9732</OPTION>
<OPTION VALUE=&quot;8X9810&quot;>8X9810</OPTION>
<OPTION VALUE=&quot;CS2801&quot;>CS2801</OPTION>
<OPTION VALUE=&quot;CS3051&quot;>CS3051</OPTION>
<OPTION VALUE=&quot;CS6501&quot;>CS6501</OPTION>
<OPTION VALUE=&quot;CS8100&quot;>CS8100</OPTION>
<OPTION VALUE=&quot;CS8323&quot;>CS8323</OPTION>
<OPTION VALUE=&quot;CS8328&quot;>CS8328</OPTION>
<OPTION VALUE=&quot;CS8504&quot;>CS8504</OPTION>
<OPTION VALUE=&quot;CS8571&quot;>CS8571</OPTION>
<OPTION VALUE=&quot;ME7300&quot;>ME7300</OPTION>                                                                                          
                                                                                                                                                                                                                                                                                                                                                                               
</SELECT>                                                                                                                   
		                                                                                                            
                                                                                                                            
	 	<p><b>Choose 1 or more Classes - <u>Cntl-Click with Mouse Button to Select more than one</u><b></p>                                                      
	       <SELECT NAME=&quot;cl&quot; MULTIPLE SIZE=&quot;5&quot;>                                                                         
	       <OPTION SELECTED VALUE=&quot;ALL&quot;>ALL</OPTION>
	                                                     
<OPTION VALUE=&quot;080&quot;>080</OPTION>                                                
<OPTION VALUE=&quot;090&quot;>090</OPTION>                                                
<OPTION VALUE=&quot;130&quot;>130</OPTION>                                                
<OPTION VALUE=&quot;140&quot;>140</OPTION>                                                
<OPTION VALUE=&quot;150&quot;>150</OPTION>                                                
<OPTION VALUE=&quot;910&quot;>910</OPTION>                                                
<OPTION VALUE=&quot;925&quot;>925</OPTION>                                                
<OPTION VALUE=&quot;940&quot;>940</OPTION>                                                
<OPTION VALUE=&quot;950&quot;>950</OPTION>                                                
<OPTION VALUE=&quot;960&quot;>960</OPTION>                                                
<OPTION VALUE=&quot;962&quot;>962</OPTION>                                                
<OPTION VALUE=&quot;964&quot;>964</OPTION>                                                
<OPTION VALUE=&quot;970&quot;>970</OPTION>                                                
<OPTION VALUE=&quot;980&quot;>980</OPTION>                                                
<OPTION VALUE=&quot;982&quot;>982</OPTION>                                                
<OPTION VALUE=&quot;983&quot;>983</OPTION>                                                
<OPTION VALUE=&quot;990&quot;>990</OPTION>    
                                                                                                        
</SELECT>                                                                                                                   
                                                                                                                            
                                                                      
	                                                                                                                    
	                                                                                                                    
	                                                                                                                    
	 <INPUT type=&quot;hidden&quot; name=&quot;prompt0&quot; value=&quot;&quot;>                                                                      
	<INPUT type=&quot;hidden&quot; name=&quot;prompt1&quot; value=&quot;&quot; >                                                                      
	<input type=&quot;hidden&quot; name=&quot;user0&quot; value=&quot;username&quot;>                                                                 
        <input type=&quot;hidden&quot; name=&quot;password0&quot; value=&quot;password&quot;>                                                             
        <BR><BR><BR>                                                                                                                                
	<INPUT type=&quot;button&quot; value=&quot;Run The Unit Number Report&quot; onClick=&quot;GetData(this.form)&quot;>                                                                     
	</FORM>                                                                                                          </BODY>
</HTML>
Note: In the report the 2 record selection formulas are
of the form
{field_name} IN {parameter passed as prompt )

hth
[profile]
 
[bold]
IMPORTANT [/bold]- Last post of mine was truncated...Please ignore..it looks like the
Code:
block was misinterpreted
I'll try again later...
 
Can you post the whole page when the server will run better?
Thanks!
Durug
 
Hi durug, lets try again:

<HTML>
<HEAD>
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
function GetData(form) {
var dpt = form.dept
var clss = form.cl
var chcdpt = &quot;[&quot;
for (var i = 0; i < dpt.length; i++ ){
if (dpt.options.selected == true) {
chcdpt += &quot;'&quot;
chcdpt += dpt.options.value
chcdpt += &quot;',&quot;
}
}
chcdpt += &quot;]&quot;
regepdpt = &quot;,]&quot;
newstrdpt = &quot;]&quot;
str1 = chcdpt.replace(regepdpt,newstrdpt)
// Get Next Parameter list
var chccl = &quot;[&quot;
for (var i = 0; i < clss.length; i++ ){
if (clss.options.selected == true) {
chccl += &quot;'&quot;
chccl += clss.options.value
chccl += &quot;',&quot;
}
}
chccl += &quot;]&quot;
regepcl = &quot;,]&quot;
newstrcl = &quot;]&quot;
str2 = chccl.replace(regepcl,newstrcl)
form.prompt0.value = str2
form.prompt1.value = str1
form.action=&quot;Unit_NumberMulti.rpt&quot;
form.submit()
}
function OpenWindowPrompt() {
pwin = window.open(&quot;&quot;,&quot;&quot;,&quot;status,height=300,width=600, top=200 ,left=200&quot;)
pwin.document.write(&quot;<HEAD>&quot;)
pwin.document.write(&quot;<TITLE> Wait </TITLE>&quot;)
var pcontent = &quot;</HEAD>&quot;
pcontent += &quot;<BODY bgcolor='#FFFFFF' >&quot;
pcontent += &quot;<font color='#FF0000'>&quot;
pcontent += &quot;<H2> Please Wait For Data To Load into Form </H2></font>&quot;
pcontent += &quot;</BODY>&quot;
pwin.document.write(pcontent)
}
function CloseWindowPrompt() {
pwin.document.write(&quot;<H3 Thanks for Your Patience </H3>&quot;)
for (var i= 0; i < 900000; i++) {
tnothing = i
}
pwin.close()
}
</SCRIPT>
</HEAD>
<BODY bgcolor=&quot;#CCFFFF&quot; OnLoad=&quot;CloseWindowPrompt()&quot;>

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
OpenWindowPrompt()
</SCRIPT>
<FORM NAME=&quot;First&quot; METHOD=&quot;POST&quot; ACTION=&quot;&quot;>
<BR>
<p><b>Choose 1 or More Departments - <u>Cntl-Click with Mouse Button to Select more than one</u><b></p>
<SELECT NAME=&quot;dept&quot; MULTIPLE SIZE=&quot;5&quot;>
<OPTION SELECTED VALUE=&quot;ALL&quot;>ALL</OPTION>
<OPTION VALUE=&quot;1A9102&quot;>1A9102</OPTION>
<OPTION VALUE=&quot;1B9106&quot;>1B9106</OPTION>
<OPTION VALUE=&quot;2X9200&quot;>2X9200</OPTION>
<OPTION VALUE=&quot;3A9307&quot;>3A9307</OPTION>
<OPTION VALUE=&quot;3B9305&quot;>3B9305</OPTION>
<OPTION VALUE=&quot;3BFUNI&quot;>3BFUNI</OPTION>
<OPTION VALUE=&quot;3X9307&quot;>3X9307</OPTION>
<OPTION VALUE=&quot;4X9400&quot;>4X9400</OPTION>
<OPTION VALUE=&quot;6A9610&quot;>6A9610</OPTION>
<OPTION VALUE=&quot;6B9640&quot;>6B9640</OPTION>
<OPTION VALUE=&quot;7A9731&quot;>7A9731</OPTION>
<OPTION VALUE=&quot;7B9732&quot;>7B9732</OPTION>
<OPTION VALUE=&quot;8X9810&quot;>8X9810</OPTION>
<OPTION VALUE=&quot;CS2801&quot;>CS2801</OPTION>
<OPTION VALUE=&quot;CS3051&quot;>CS3051</OPTION>
<OPTION VALUE=&quot;CS6501&quot;>CS6501</OPTION>
<OPTION VALUE=&quot;CS8100&quot;>CS8100</OPTION>
<OPTION VALUE=&quot;CS8323&quot;>CS8323</OPTION>
<OPTION VALUE=&quot;CS8328&quot;>CS8328</OPTION>
<OPTION VALUE=&quot;CS8504&quot;>CS8504</OPTION>
<OPTION VALUE=&quot;CS8571&quot;>CS8571</OPTION>
<OPTION VALUE=&quot;ME7300&quot;>ME7300</OPTION>
</SELECT>


<p><b>Choose 1 or more Classes - <u>Cntl-Click with Mouse Button to Select more than one</u><b></p>
<SELECT NAME=&quot;cl&quot; MULTIPLE SIZE=&quot;5&quot;>
<OPTION SELECTED VALUE=&quot;ALL&quot;>ALL</OPTION>

<OPTION VALUE=&quot;080&quot;>080</OPTION>
<OPTION VALUE=&quot;090&quot;>090</OPTION>
<OPTION VALUE=&quot;130&quot;>130</OPTION>
<OPTION VALUE=&quot;140&quot;>140</OPTION>
<OPTION VALUE=&quot;150&quot;>150</OPTION>
<OPTION VALUE=&quot;910&quot;>910</OPTION>
<OPTION VALUE=&quot;925&quot;>925</OPTION>
<OPTION VALUE=&quot;940&quot;>940</OPTION>
<OPTION VALUE=&quot;950&quot;>950</OPTION>
<OPTION VALUE=&quot;960&quot;>960</OPTION>
<OPTION VALUE=&quot;962&quot;>962</OPTION>
<OPTION VALUE=&quot;964&quot;>964</OPTION>
<OPTION VALUE=&quot;970&quot;>970</OPTION>
<OPTION VALUE=&quot;980&quot;>980</OPTION>
<OPTION VALUE=&quot;982&quot;>982</OPTION>
<OPTION VALUE=&quot;983&quot;>983</OPTION>
<OPTION VALUE=&quot;990&quot;>990</OPTION>

</SELECT>
<INPUT type=&quot;hidden&quot; name=&quot;prompt0&quot; value=&quot;&quot;>
<INPUT type=&quot;hidden&quot; name=&quot;prompt1&quot; value=&quot;&quot; >
<input type=&quot;hidden&quot; name=&quot;user0&quot; value=&quot;username&quot;>
<input type=&quot;hidden&quot; name=&quot;password0&quot; value=&quot;password&quot;>
<BR><BR><BR>
<INPUT type=&quot;button&quot; value=&quot;Run The Unit Number Report&quot; onClick=&quot;GetData(this.form)&quot;>
</FORM>
</BODY>
</HTML>









































































































































































































































 
Can you send me the file attached if the server can't upload the page?

Thanks
duruguru@canada.com
 
OK, so it won't post it all - where did that &nbs come from?
Here's the last part of the page:
</SELECT>
<INPUT type=&quot;hidden&quot; name=&quot;prompt0&quot; value=&quot;&quot;>
<INPUT type=&quot;hidden&quot; name=&quot;prompt1&quot; value=&quot;&quot; >
<input type=&quot;hidden&quot; name=&quot;user0&quot; value=&quot;username&quot;>
<input type=&quot;hidden&quot; name=&quot;password0&quot; value=&quot;password&quot;>
<BR><BR><BR>
<INPUT type=&quot;button&quot; value=&quot;Run The Unit Number Report&quot; onClick=&quot;GetData(this.form)&quot;>
</FORM>
</BODY>
</HTML>

hth,
[profile]
 
Hi again,durug,
thanks for the star and I hope you got the emailed page...
[bigsmile]
 
I thank you! I can't check from work my email, so I will let you know this evening, but for sure everything will be OK.

Thanks one more time!
Durug
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top