Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 10th, 2003, 05:28 PM
Registered User
Join Date: Jun 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL, ASP and Crystal Reports

I have a report in Crystal that I need to let users view/print via the web. The report is based on a view in SQL that will remain constant. However, I need the report to be populated with a subset of that view based on user information. I've read the technical articles on Crystal's website about creating a TTX file...that's fine, but I don't need to create a new report...I want to use the one I've already created. I can generate a sql query string with the user information through asp. But I can't figure out how to get it to the report. I'm using the following code to access the viewer. I'm not (and prefer not to have to) access the RDC. My users don't need to be able to create a report...just view the report we've created populated with their subset of the data. Thanks!

<TITLE>Region 7</TITLE>
<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript topmargin=0 leftmargin=0>
    WIDTH=100% HEIGHT=99%
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=0>
<PARAM NAME="EnableGroupTree" VALUE=0>
<PARAM NAME="EnableAnimationControl" VALUE=1>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableRefreshButton" VALUE=1>
<PARAM NAME="EnableSearchControl" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
<PARAM NAME="EnableSearchExpertButton" VALUE=0>
<PARAM NAME="EnableSelectExpertButton" VALUE=0>

Sub window_onLoad()
End Sub
Sub Page_Initialize
    On Error Resume Next
    Dim webBroker
    Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
    if err.number <> 0 then
        window.alert "The Crystal ActiveX Viewer is unable to create it's resource objects."
        CRViewer.ReportName = "/Compass/TAKSTracker/TAKSReport2.rpt"
        Dim webSource0
        Set webSource0 = CreateObject("WebReportSource.WebReportSource")
        webSource0.ReportSource = webBroker
        webSource0.URL = "/Compass/TAKSTracker/TAKSReport2.rpt"
        webSource0.PromptOnRefresh = True
        CRViewer.ReportSource = webSource0
    end if
End Sub

<OBJECT ID="ReportSource"
    HEIGHT=1% WIDTH=1%
<OBJECT ID="ViewHelp"
    HEIGHT=1% WIDTH=1%
<OBJECT ID="ReportParameter"
    HEIGHT=1% WIDTH=1%
Old June 13th, 2003, 03:54 AM
Registered User
Join Date: Jun 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts


Have you looked at the ASPXMPS8 and ASPXMPS85 samples on the Crystal website.

I picked up quite a bit from them

I use the session variables in the activex viewer like so.

Set session("oApp") = Server.CreateObject("CrystalRuntime.Application")
Set session("oRpt") = session("oApp").OpenReport(reportname, 1)
Session("oRpt").RecordSelectionFormula = strFilter

Set strFilter to a valid SQL select.

Hope that helps

Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Reports 8.5 with SQL 2000 jroxit SQL Server 2000 2 March 20th, 2015 01:39 AM
ASP.NET 1.1,VB.NET,crystal reports, SQl server gvi Crystal Reports 1 September 11th, 2008 02:55 AM
Crystal Reports 8.0 , My Sql 5.0 with Vb6.0 thiyagu6682 Pro VB Databases 0 August 21st, 2007 08:22 AM
SQL in Crystal Reports Roopedog Crystal Reports 1 August 9th, 2005 07:18 AM
Need to connect SQL database to Crystal Reports vbmazza Crystal Reports 0 May 13th, 2005 06:24 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.