|
-
Aug 13th, 2007, 01:08 PM
#1
Thread Starter
Hyperactive Member
Sub To Open Strongly Typed Objects
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.
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
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.
Last edited by FastEddie; Aug 13th, 2007 at 01:12 PM.
-
Aug 13th, 2007, 04:35 PM
#2
Thread Starter
Hyperactive Member
Re: Sub To Open Strongly Typed Objects
Well this isn't what I had in mind but I did make this work.
Code:
Private Sub OpenCR_v2()
Dim aReport As ReportDocument
aReport = Nothing
Select Case intFileID
Case 0 : aReport = New Variances
Case 1 : aReport = New CountSheets
End Select
aReport.SetParameterValue("isAdmin", isAdmin)
aReport.SetParameterValue("parStoreID", StoreID)
aReport.SetDatabaseLogon("User", "pass", "db", "Table")
crvReports.ReportSource = aReport
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|