p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Crystal Reports (http://p2p.wrox.com/forumdisplay.php?f=113)
-   -   Crystal Reports Engine in Push Mode (http://p2p.wrox.com/showthread.php?t=28214)

mike_abc April 17th, 2005 05:05 AM

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


All times are GMT -4. The time now is 09:35 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.