Solved

Refresh Report with .NET Web Control

Posted on 2003-11-04
6
230 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

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 …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

776 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