Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 10th, 2003, 05:28 PM
Registered User
Join Date: Jun 2003
Location: , , USA.
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%
Reply With Quote
  #2 (permalink)  
Old June 13th, 2003, 03:54 AM
Registered User
Join Date: Jun 2003
Location: , , .
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
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 06:39 PM.

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