_Canidae_
asked on
Passing SQL to Crystal Reports
How do I pass an SQL statement to my report, and how is the report set up to handle this?
I'm not sure if answering this question will take a lot of typing or what, so I'll increase the points if necessary.
Bear in mind that I'm relatively new to ASP. This is the 2nd time I'm asking this question, the first time nobody even commented. Please help.
I'm not sure if answering this question will take a lot of typing or what, so I'll increase the points if necessary.
Bear in mind that I'm relatively new to ASP. This is the 2nd time I'm asking this question, the first time nobody even commented. Please help.
ASKER
Thanks. I've read lots of documentation and not found any way to do it (passing SQL), but there's another way which I'm busy with right now and it seems to be working.
Here's an example of one of my statements:
NextForm.action="Report3.r pt?sf={INC I.9}+%3d+' " & NextForm.Company.value & "'"
So I'm unsure of whether I'm going to need to pass SQL. This seems to do the job!
Here's an example of one of my statements:
NextForm.action="Report3.r
So I'm unsure of whether I'm going to need to pass SQL. This seems to do the job!
If it works for you...
I'll still take a look at the SQL thing if I get a chance. Good for me to do anyway.
Tom
I'll still take a look at the SQL thing if I get a chance. Good for me to do anyway.
Tom
ASKER
Thanks :o)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Roopesh_Mohan for your proposed answer. Unfortunately I have to leave now, so I'll only be able to test your answer tomorrow.
ASKER
I'm getting this when I use your answer:
--------
cpeaut32 error '800a4e20'
No error.
--------
Ummm, confused.
--------
cpeaut32 error '800a4e20'
No error.
--------
Ummm, confused.
Try Now...
<!-- #include file="SmartViewerActiveX.a sp" -->
And
Save this below text as a "SmartViewerActivex.Asp"
-------------------------- -------
<%
'This file contains the HTML code to instantiate the Smart Viewer ActiveX.
'
'You will notice that the Report Name parameter references the rptserver.asp file.
'This is because the report pages are actually created by rptserver.asp.
'Rptserver.asp accesses session("oApp"), session("oRpt") and session("oPageEngine")
'to create the report pages that will be rendered by the ActiveX Smart Viewer.
'
%>
<HTML>
<HEAD>
<TITLE>Seagate Crystal Smart Viewer for ActiveX</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript ONLOAD="Page_Initialize">
<OBJECT ID="CRViewer"
CLASSID="CLSID:C4847596-97 2C-11D0-95 67-00A0C92 73C2A"
WIDTH=100% HEIGHT=95%
CODEBASE="/viewer/activeXV iewer/acti vexviewer. cab#Versio n=7,0,100, 52">
<PARAM NAME="EnableRefreshButton" VALUE=1>
<PARAM NAME="EnableGroupTree" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=1>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableSearchControl" VALUE=1>
<PARAM NAME="EnableAnimationContr ol" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Page_Initialize
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("WebReportBro ker.WebRep ortBroker" )
if ScriptEngineMajorVersion < 2 then
window.alert "IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site."
CRViewer.ReportName = Location.Protocol + "//" + Location.Host +"/scrreports/rptserver.as p"
else
Dim webSource
Set webSource = CreateObject("WebReportSou rce.WebRep ortSource" )
webSource.ReportSource = webBroker
webSource.URL = Location.Protocol + "//" + Location.Host + "/sqlweb/rptserver.asp"
' webSource.URL = Location.Protocol + "//" + Location.Host + "/scrreports/rptserver.asp "
webSource.PromptOnRefresh = True
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
</BODY>
</HTML>
<!-- #include file="SmartViewerActiveX.a
And
Save this below text as a "SmartViewerActivex.Asp"
--------------------------
<%
'This file contains the HTML code to instantiate the Smart Viewer ActiveX.
'
'You will notice that the Report Name parameter references the rptserver.asp file.
'This is because the report pages are actually created by rptserver.asp.
'Rptserver.asp accesses session("oApp"), session("oRpt") and session("oPageEngine")
'to create the report pages that will be rendered by the ActiveX Smart Viewer.
'
%>
<HTML>
<HEAD>
<TITLE>Seagate Crystal Smart Viewer for ActiveX</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript ONLOAD="Page_Initialize">
<OBJECT ID="CRViewer"
CLASSID="CLSID:C4847596-97
WIDTH=100% HEIGHT=95%
CODEBASE="/viewer/activeXV
<PARAM NAME="EnableRefreshButton"
<PARAM NAME="EnableGroupTree" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=1>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableSearchControl"
<PARAM NAME="EnableAnimationContr
<PARAM NAME="EnableZoomControl" VALUE=1>
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Page_Initialize
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("WebReportBro
if ScriptEngineMajorVersion < 2 then
window.alert "IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site."
CRViewer.ReportName = Location.Protocol + "//" + Location.Host +"/scrreports/rptserver.as
else
Dim webSource
Set webSource = CreateObject("WebReportSou
webSource.ReportSource = webBroker
webSource.URL = Location.Protocol + "//" + Location.Host + "/sqlweb/rptserver.asp"
' webSource.URL = Location.Protocol + "//" + Location.Host + "/scrreports/rptserver.asp
webSource.PromptOnRefresh = True
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
</BODY>
</HTML>
ASKER
I did have those include files and the output I showed was when using them, or at least one of them.
However, I've managed to accomplish what I was trying without using SQL. I used a selection formula, which was a bit of a hassle at first, but it's all fine now.
If it's allowed, I can give you the points for your efforts, as I'm sure they would've worked if I continued to follow your suggestions. Thanks for your help.
However, I've managed to accomplish what I was trying without using SQL. I used a selection formula, which was a bit of a hassle at first, but it's all fine now.
If it's allowed, I can give you the points for your efforts, as I'm sure they would've worked if I continued to follow your suggestions. Thanks for your help.
To be honest I have never used formula on such occassions... Well as long it works I wouldnt worry...
Rooesh Mohan,
Do you have the coding for SmartViewerJava.asp, SmartViwer HTMLFrame.asp and SmartViewHTMLPAge.asp? if you do, can i have them?
Do you have the coding for SmartViewerJava.asp, SmartViwer HTMLFrame.asp and SmartViewHTMLPAge.asp? if you do, can i have them?
I think I may be able to help with this, but I have to find some time to look at an application I am working with. The prospect was a bit time consuming, which is why I didn't respond right away.
Will try to get back to you later today.
Tom