I am including my Crystal Reports as Resources in my ClickOnce application so that I can include them without having to worry about file security (users on an untrusted domain).
The only way to accomplish this, at least as far as I can tell, is to use a Strongly Typed Report Object. My problem is that I want to keep the report name generic so I can call it with arguments instead of hardcoding as I do below.
How can I accomplish opening different reports in my sub while still using the Strongly Typed Report Object? For instance CountSheets is the name of the report above but I also want to use the same Sub to open other reports.Code:Private Sub OpenCR_v2() Dim aReport As New CountSheets aReport.SetParameterValue("isAdmin", isAdmin) aReport.SetParameterValue("parStoreID", StoreID) aReport.SetDatabaseLogon("User", "pass", "db", "Table") crvReports.ReportSource = aReport End Sub




Reply With Quote