Solved

Refresh Report with .NET Web Control

Posted on 2003-11-04
6
237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 101

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 101

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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

630 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