• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2112
  • Last Modified:

passing parameters to active reports

I have an asp.net app developed with vs2008 and vb.net. 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.

  • 3
  • 3
1 Solution
what I do is on the active report's codebehind I have a public variable that is a datatable...so 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 reports...so 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

jbh_blueAuthor Commented:
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.
Sorry, I should've explained that better...it'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.

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

>>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 control...so 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.
jbh_blueAuthor Commented:
thanks, i can't help but think there's a better way, but putting it in table and joining to it will work.

jbh_blueAuthor Commented:
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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now