Pass Parameter to Crystal Report through ASP Page

Posted on 2005-04-06
Last Modified: 2008-01-09

Sort of a newbie to crystal.  I have a .rpt file.  It does a bunch of stuff which basically involves connecting to the DB and then pulling back information into the report.  It requires one parameter to be passed in.  That parameter is called @recid.  Once the report knows the record id, it gets the information from the DB for that record.  

So, I need the user to fill out the form which collects their information and inserts it into the DB which the report will read from.  Then, I get back the record id and I need to pass it to the CrystalRuntime.Application.10 object in ASP and then generate a pdf of the report in the user's browser.  Here is what I need to know:  How do i pass the parameter to the crystal object?

Question by:lsrbby
    LVL 13

    Expert Comment

    Have you downloaded the asp samples for CR 10?

    I've got some of the older samples.  Typically, there is a SimpleParameterFields.asp sample application that demonstrates how to pass a parameter.

    LVL 100

    Expert Comment

    That should have the example.  Do you have CR 10 Developer or Advanced edition?


    Author Comment

    I'm using cr10 developer.  Actually, I see the part in the sample for passing the parameter.  what I really need is a list of all the methods and properties of the crystalruntime object for classic ASP.  If i had that, I would probably be good to go.

    however, if that isn't available, here is my current issue:

    When i save the report (.rpt file) without data and then try to call it through my classic asp code i get this error--

    Error Occurred Reading Records: Logon failed. Details: ADO Error Code: 0x80040e4d Source: Microsoft OLE DB Provider for SQL Server Description: Login failed for user 'WebReports'. SQL State: 42000 Native Error: 18456

    So, i'm thinking i need the properties of the runtime object so i can pass the login,password,datasource, etc. to the report.

    Again, if i save the report with data everything works fine.  but obviously this does me no good because each time the report runs it has different data associated with it.
    LVL 100

    Accepted Solution

    There should be an example in the file for passing logon parameters.  

    Here is a sample in VB.Net

    SQL logon info

    LVL 100

    Expert Comment

    Glad i could help


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
    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 …
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    737 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

    22 Experts available now in Live!

    Get 1:1 Help Now