Solved

Refresh Report with .NET Web Control

Posted on 2003-11-04
6
224 Views
Last Modified: 2012-08-14
I have a ton of reports, all with saved data turned off. The reports are designed on a "in-house" database. The client database structure is exactly the same as our in-house database. I simply want to change the database at runtime to the database that the user/client is connected to and run the report against that database. The reports I am currently testing with do not require parameters. However, we have many that do. I have read that reports with parms seem to refresh more readily. Using the CrystalViewer1.RefreshReport() function doesn't work, nor does oRpt.Refresh() ,with oRpt being an object of type ReportDocument. I have the logon code in place, and am relatively certain that it works, here it is:

            For Each rptTable In oRpt.Database.Tables
                ' Set the connection information for current table.
                logOnInfo.ConnectionInfo.ServerName = sServer
                logOnInfo.ConnectionInfo.DatabaseName = sDB
                logOnInfo.ConnectionInfo.UserID = sUser
                logOnInfo.ConnectionInfo.Password = sPW
                logOnInfo.TableName = rptTable.Name
                rptTable.ApplyLogOnInfo(logOnInfo)
                rptTable.Location = rptTable.Name
            Next

When I run the report the first time it will connect to the database and get the information to fill the
report. If I close the viewer, change my db connection, and re-run the report...the old data from my previous db connection is still there. Again, this is an asp.net application and again the refreshes don't work. Any help is much appreciated.
0
Comment
Question by:jaylien1
  • 2
6 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 9680983
0
 

Author Comment

by:jaylien1
ID: 9682061
Thanks for the suggestion mlmcc. Oh how I wish one of them would have solved it, but they didn't. I am not using the web component server for this and the url is different each time anyway. I know there has to be some way to do this, it seems to me that changing the logoninfo (thus changing the database to report off of) would signify that the report changed and cause the report to pull in the updated information. I believe now that the logoninfo isn't applying the second time through. Example: I have db1, db2, db3. The report, rpt.A, is designed against db1. The report is sitting on the web server. The asp .net page containing the viewer is requested with rpt.A, the asp .net page's onload event sets the logoninfo the that of the user requesting it, let's say it's db2. The report is displayed with the data from db2. If the user then changes their db connection to db3 and goes and requests the same report, the viewer displays the report with the data from db2 in it. It is almost as if the page_load event isn't being ran the second time the viewer is requested. Any other suggestions?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 9684091
No ideas.  I use VB and the application isn't web based.

mlmcc
0
 
LVL 7

Accepted Solution

by:
ladylinet earned 125 total points
ID: 9719136
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now