passing parameters to active reports

Posted on 2008-11-19
Last Modified: 2012-05-05
I have an app developed with vs2008 and I'm using Data Dynamics Activereports for reporting.

I can't find an example of how to pass a parameter to the SQL view that I'm using to populate the report. Does anyone have a link or example of how to do so? I don't want to prompt the user from a dialog like the examples/walkthroughs on their site do, but pass the parameter dynamically.

Question by:jbh_blue
    LVL 37

    Expert Comment

    what I do is on the active report's codebehind I have a public variable that is a for example, I have an active report named MyReport, in the codebehind:

        Public DtReport As DataTable

    then from the aspx page, you can use any amount of paramaters you want to populate a datatable...then you just assign the dt on the aspx page to the dt on the active on the aspx:

        Dim  rpt
        rpt = New ActiveReportsAssembly.MyReport

       Dim DtOnPage as new datatable
    'do anything you need to with parameters to populate DtOnPage
    'then since DtReport is public, you can:

    rpt.DtReport = DtOnPage


    Author Comment

    thanks for the quick response.

    what imports are you using, because I can't find ActiveReportsAssembly. I checked in the object browser and couldn't find it either.

    I have
    Imports DataDynamics.ActiveReports
    Imports DataDynamics.ActiveReports.Document
    Imports DataDynamics.ActiveReports.Web

    Also, I should have mentioned that I'm using the webViewer to display the report.
    LVL 37

    Expert Comment

    Sorry, I should've explained that's kind of key to making what I posted work...

    My solution in Visual Studio has the Web App as one project and in another project I named ActiveReportsAssembly I have all the Active Reports.
    Then, in the Web App, I added a reference to my Active Reports project (the ActiveReportsAssembly)...
    On the aspx codebehind, I have the following references:
    Imports DataDynamics.ActiveReports.HtmlExport
    Imports DataDynamics.ActiveReports.Export.Pdf
    Imports DataDynamics.ActiveReports.Export.Xls
    Imports DataDynamics.ActiveReports.Export.Html
    Imports DataDynamics.ActiveReports.Export.Text
    Imports DataDynamics.ActiveReports.Export.Rtf
    Imports DataDynamics.ActiveReports.Export.Tiff
    Imports DataDynamics.ActiveReports.Web
    Imports ActiveReportsAssembly

    The last one of course is my "assembly" project.

    LVL 37

    Accepted Solution

    >>Also, I should have mentioned that I'm using the webViewer to display the report.

    My app has to work on all major browsers (IE, FF, Safari, Opera)...and if I remember correctly...their WebViewer control was an ActiveX I'm not using their WebViewer control, but it shouldn't make a difference....
    The bottom line is being able pass a loaded datatable to the ActiveReport report...and having a datatable as a public variable or property on the AR report codebehind and being able to get a reference and instantiate the report from the aspx is all that is needed.

    Author Comment

    thanks, i can't help but think there's a better way, but putting it in table and joining to it will work.


    Author Closing Comment

    thanks, but I can't help but think there's a better way than putting it in a table and joining to it, but that worked. there has to be a way to pass it in to the .vb file

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
    Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
    Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started: provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

    761 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

    6 Experts available now in Live!

    Get 1:1 Help Now