Crystal Report takes a LONG time to load through app, but in VS 2008 it's fast - crystal-reports

I have a report that is taking about 10 minutes to load when opened through the application, but only 2 seconds when opened through VS 2008. There are many other reports which all work fine and I don't know what could be different about this one.
In the application, all of the code to load and setup the report runs fine but when I launch the form that has the viewer on it it displays the form, but hangs for several minutes before the report comes up. It's clear that it's not the query itself that is the problem since it only takes a second to run in VS, and all that is on the form is just the viewer.
After setting up my report into a variable named rDoc, I run the following code:
CrystalReportViewerForm frm = new CrystalReportViewerForm();
frm.CrystalReportViewer.ReportSource = rDoc;
Application.Run(frm);
CrystalReportViewerForm has the viewer control on it, and a public property called CrystalReportViewer that exposes the viewer so the calling code can set the ReportSource before opening the form, as you can see in the code. That is literally all the form consists of. When Application.Run(frm); is run it shows the form and viewer, but the report doesn't load for about 10 minutes.
If anyone else has run into this and solved it please let me know what you did!!
Thanks!

I'll go ahead and post the way I fixed it here in case it helps anyone, but I'd still like to hear if anyone else knows what the problem actually is...
My report was using the built in features of CR to select tables with data expert. I got rid of all the tables and added a command with the sql needed to get the data. This solution would obviously be faster because it doesn't return as much data and the processing is all done in SQL. However, it worked fine the way it was when run through VS so I know that's not the whole of the problem. At least it works now though.

Related

Can't refresh crystal report in VB for reports without parameters

I have a legacy VB6 application where I am able to open all reports and even refresh them (with their existing parameter entries). However, when I refresh reports that don't have any parameters I get error -2147483638/Automation error. This happens when I try to re-set the report source. It seems like the rptviewer.IsBusy flag is still set to True and stays that way indefinitely for these specific reports. If that's the issue, why does the report viewer control stay busy perpetually and how can I "stop" it? It doesn't seem like the report control is busy in the program as I am able to access the report in other ways.
While rptViewer.IsBusy
DoEvents
Wend
rptViewer.ReportSource = m_CrxReport '' Error occurs here
rptViewer.ViewReport
Again, I don't have any issues opening these reports and I don't have any issues opening and/or refreshing reports that request parameters. Any help would be greatly appreciated.
P.S. The viewer control is version 10 (I know, it's old)

Visual Foxpro exe file not working

I am beginner in using Visual FoxPro. I am trying to create a simple application which contains a form with a few textboxes. The problem is that the application window does not appear when I run the executable file which I build.
The code for the program is:
PROCEDURE main_app
_SCREEN.Activate
_SCREEN.WindowState = 2
_SCREEN.backcolor = RGB(128, 128, ;
128)
_SCREEN.Caption = ""
_SCREEN.refresh()
SET TALK OFF
SET DELETED ON
SET EXCLUSIVE OFF
CLEAR ALL
CLEAR
CLOSE ALL
DO FORM simpleform LINKED
READ EVENTS
RETURN
*MESSAGEBOX('Msg')
ENDPROC
In the form I have a few textboxes and a button. When the button is clicked then some code is executed. If I run the application from the IDE everything works fine but if I create the executable this does not display any window, still the process appears in the task manager. If I uncomment the MessageBox then this will appear even if I run the exe file. I don't know a way to trace the problem outside the IDE, maybe there is still a library needed that I am not aware.
I am using Visual FoxPro 9.0
Would someone be able to help me out?
If you can provide me with a link to a very simple application exe which uses just one form and finishes when the form is closed I would very much appreciate it.
Thanks in advance
I tried creating a brand new project, new code and new form just as you described. I copied your code and ran, but it never displayed the form.
If this is the main app in your project, you don't need the initial
PROCEDURE main_app
just remove this line as there is nothing CALLING the "Main_App" and thus is never getting called to ultimately call your form.
Just comment it out, save your project and run it... See what you get, it SHOULD work.
** PROCEDURE main_app
The problem was that I did not set the screen visibility to true.

GWT Selenium Tests sometimes fails

we currently have a nice problem with our selenium tests in a gwt powered gui.
The application contains two sections (filter and grid). Our tests sometimes fails with a NoSuchElementException.
Crazy is the following: I stop the test in eclipse with a breakpoint and inspect the page with firefox firebug or any other addon. And okay - I cannot find the desired element. But (without restarting the application or any other changes in eclipse), if i try again and search the element it is there and a resume in eclipse the test goes green. For me it seems like a synchronize problem in firefox.
A explicitly wait command
new WebDriverWait(getDriver(), 10).until(condition);
has the only effect, that the timeout (10 seconds) happens.
As I said - sometimes the test is green and sometimes it fails.
Has anybody an idea?
Sounds like you load some data asynchronous (RPC) from the server? The data and thus the element which presents the data in the UI is not there yet, when Selenium is looking for it. Depending on how long your queries take on the database or what latency you have on the network the wait time may vary from test-run to test-run.
I have a workaround for this problem and would share this.
The following piece of code is executed before the explicit wait command is running.
Window window = getDriver().manage().window();
Dimension dimension = window.getSize();
Dimension tmp = new Dimension(dimension.getWidth() - 1, dimension.getHeight());
window.setSize(tmp);
window.setSize(dimension);
I figured out, that the DOM is in "synchronized" state after the browser window is resized. So I decrement the width and than set it back to the old value.
If anybody has a better suggestion - let us know ;-)

Why is Eclipse's HTML viewer randomly showing previous output and an error?

Well, this video shows my problem best : http://www.youtube.com/watch?v=yDeChV254Ck&feature=youtu.be
If I have a page that is proper/ok, everything works fine and as expected.
If I purposely induce an error (which I have been doing loads of whilst learning!), Eclipse doesn't show an error at all inline/red underline, and, when I try to run, it will either display an error (which I expect it should be doing every time), or it will randomly display the last successful build.
I can (remotely) understand the logic of alternating, maybe someone would want to see the previous output, but, this is just completely random - no logic at all, so, I just don't understand why it is happening.
Does anyone know what is going on?
edit - been able to recreate this on a brand new install. What is going on!?

Using Shared Dataset in Subreport

Greetings!
I am using SSRS with MS SQL Server 2008 R2, which has the new feature of supporting shared datasets.
First, I created my shared dataset, and made sure that it worked correctly and had a good connection. That worked great.
Second, I created a new report (Let's call it "ReportSub"), and I had it use my shared dataset. The report works great.
Third, I created another report (Let's call is "ReportMain"), and I put a subreport object into the report and associated it with "ReportSub". Doesn't work. Instead, I get this error:
Data retrieval failed for the subreport, 'ReportSub', located at: /ReportSub. Please check the log files for more information.
Any ideas of what the problem may be? It will work if I use an embedded dataset, but I really need to use a shared dataset.
Thanks,
Currently, there is no way to Preview the subreport with shared datasource/dataset in BIDS.
Link: http://social.msdn.microsoft.com/Forums/en/sqlreportingservices/thread/74e51434-1d14-4fb1-9b1c-1a394c187b2f
I had this problem for "preview" only. As soon as I deploy this to Reporting Service server it starts working fine.
I had the same problem when previewing my MainReport. The SubReport preview works fine, but the MainReport preview produces the error "Data retrieval failed for the subreport".
The solution is not use shared dataset in the SubReport but an embedded daaset!
I have also observed that some changes in the SubReport are not taken over by the MainReport. So I had to close and repoen the project again.
I was experiencing this problem even after deploying. I discovered that I was prompting for datasource credentials in the subreport, but not in the main report.
After I made them both the same (prompt for credentials or set them both to use the provided credentials), the problem went away and I was able to preview.