Link to home
Start Free TrialLog in
Avatar of jbh_blue
jbh_blue

asked on

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.

Thanks
Avatar of samtran0331
samtran0331
Flag of United States of America image

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
rpt.Run(False)

Avatar of jbh_blue
jbh_blue

ASKER

Samtran0331,
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.

ASKER CERTIFIED SOLUTION
Avatar of samtran0331
samtran0331
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks, i can't help but think there's a better way, but putting it in table and joining to it will work.

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