Crystal Reports Engine in Push Mode
Hi,
I want to use a report in PUSH mode, that is, to specify user credentials, dataset et.al. for that report AT RUN TIME !
The report as such I've created in Designer mode with my credentials on an existing view in the database, but...
at runtime the actual user will have to use :
- his own credentials
- a custom generated dataset via SQL statement (obviously with the same structure as the view) but with a different number of lines, depending on the contents of that SQL statement.
What happened so far:
I used the following code:
Dim objReport As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent
sRepName = sRepPath & sRepName & ".rpt"
objReport.Load(sRepName)
objReport.SetDatabaseLogon(sUser, sPassw, sServer, sDataBase)
ReportViewer.ReportSource = Nothing
ReportViewer.ReportSource = objReport
ReportViewer.Show()
My problem is that it worked !
It shouldn't have worked, since the user for which I supplied the credentials doesn't actually have access to the view, so I presume the report just used the Design time credentials, despite the above code !
How should I do it ? Is there a tutorial on the Internet for CREngine in PUSH mode ?
TIA
Mike
|