Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Refresh Report with .NET Web Control

Posted on 2003-11-04
6
Medium Priority
?
238 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 500 total points
ID: 9719136
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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 …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

705 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