Microsoft report viewer shows no report - c#

I am working on a small windows application. The application needs to show some reports. For each report, I made a simple form with Report Viewer control. When the form shows up, I call the RefreshReport() method and the report is shown. My problem is this - one report does not show up at all. I get only form with empty ReportViewer control. There is also no "Generating report" message. The query I use returns the correct data, but I am unable to get anything when I run the application. For each of the reports, I am using separate dataset. In each DtaSet I have placed the tables I want to use in corresponding report. I
I have also tried to create this particular report using Report Server Project Wizard (Business Intelligence Project > Report Server in Visual Studio). It showed the report correctly. I used exactly the same settings, same query, everything is identical. What could be the problem? Why is Visual Studio unable to show me this report? The other reports are working fine.
Thanks

Ok, I found out what was happening. For some reason, an exception was thrown during the creation of the report. The exception was "invisible" - there was no any message about it, nothing. I caught it when I was debugging the whole thing line by line. It seems that the exception originates on the database level, when the query is executed (the query contains several JOIN commands). I solved the whole thing by simply putting the Fill() method, which fills the dataset when the form is opened in the try block, with an empty catch block. The report showed correctly.

Related

Hyperlink in RDLC breaks the report

I have a client side report that is displayed in a report viewer within a webform. The report displays perfectly until I create a hyperlink within a textbox. However, when I try to render the report, it crashes with the following error:
An error occurred during local report processing.
Nothing fancy is done with the link. The link is static, not altered by any code, and points to an external site.
Apparently, there is an option EnableHyperlinks on the LocalReport object that I couldn't find in the designer, but is accessible during runtime:
reportViewer.LocalReport.EnableHyperlinks = true;
Once I included this single line the report stopped crashing and the link worked.

Load report failed in C#.net

I created one application in C# .Net for viewing crystal report.
But when i try to execute,it shows "load report failed" error message.
May i know the reason.
And what are the viewer files to be install for viewing report.
Developed the report in Crystal report 2008.
This usually happens. Try the following
Check your code. Try this here
Check your data table name and column names. They needs to be the same (case insensitive) as that of database
Check your database connectivity.
Check if you have any spelling errors in your code that specifies the name of your report file.
Check if you have installed all the right components for crystal report to work
Open crystal report and try to update connection to your data source
Try debugging by removing all fields and blankly showing the report. If it works, it should be problem with your code else it could be problem with crystal report or connectivity.
Let me know if any of this works for you

ASP.NET Crystal Report Print Automatically

I would like to know if exists the way to send a crystal report directly to the printer without print dialog. Ex. I have an asp.net page with a crystal report viewer and I want send to print once the report have been loaded into the viewer.
I saw an application what it is doing that but I don't know how that work.
I am using
Visual Studios 2010
Crystal Report for .NET Framework (Version=13.0.2000.0)
C# 4
if have a code sample (will be great!!!!)
I have read lot of resources in internet but nothing give me idea how to do what I need.
Thanks in Advance.
J.S.
It does not working like you think. Method PrintToPrinter generates printout directly to printer. Report preview also do the same. If you are executing both methods then report is generating twice. If you have more pritnout pages then report preview generates only visible pages. In most cases this does not change anything, but if report is generating a lot of time, then you are getting a lot of resources from system and you can expect deadlock on database. You also have to remember that if your report is generating new data per each executing then you will have doubled data.
Good I did it
I Just set this values to the ReportDocument.
CrystalReportDocument.PrintOptions.PrinterName = "Printer Name";
CrystalReportDocument.PrintToPrinter(1, true, 1, 1);
anyways I am open to other ideas and suggestion.

Crystal Reports load depending on its mood

I have a crystal report viewer on Windows forms.
The report viewer has one report associated with it. I pass 24 parameters programatically. When i try to run the program, sometimes the reports shows and sometimes the software hangs up.
I m passing same data every time to the report. There are no compile time errors. When I do step-debbuging, then every time the report loads perfectly and there are no hang-ups.
What can be reason of this moody opening of report ????
Edit1:
During step debugging, I found that assignment of reportsource to CrystalReportViewer causes the software to hangup.
goldBillReport = new GoldBill();
crystalReportViewer1.ReportSource = goldBillReport; //Hangs after this !!
SetGoldParameters();
Edit 2:
I have changed the scenario now, I take simple windows form, add a crystal report viewer to it. Secondly I create a blank crystal report.
Now I write the following lines in form load event of the windows form which contains viewer.
goldBillReport = new BillReport();
crystalReportViewer1.ReportSource = goldBillReport ;
80% of times when I load the form it shows the blank report (as required). The remaining time it shows nothing and application just hangs. Why ?
Note: My real application is very large. Is it the problem that the program is not getting proper memory space to open the report. If yes then are there any ways to collect garbage ?
Thank you in advance
I would check that you are correctly disposing of your viewer when the form is closed.
Also, I had an issue where the first time I ran a report it was extremely slow. The solution to this was to load a temp report during Application startup (behind a splash screen). This ensured that the Crystal Report DLL's were fully loaded before the user can generate a report. After I did this the reports loaded in few seconds each time.

How To Speed Up Loading DataSets

When Using SQL Server Reporting Services (client Reports), whenever a Client (rdlc) report Opens Visual Studio Loads entire application datasets,
how to speedup loading this all datasets or how to change the process to only load specific Dataset to use in Report ?
Bulk Insert (or the bcp utility) is your Friend for speedy data imports. Your probably going to have to write a data loader in some language though.
database snapshot could be an option
http://www.sql-server-performance.com/articles/dba/sql_server_database_snapshot_p1.aspx
I may be understanding you question wrong, but on Win Forms I've been loading the needed data sets manually. I basically have a method that loads the proper data from my database, attach the needed data sets to my report viewer using Me.ReportViewer1.LocalReport.DataSources.Add, then I just display my report using Me.ReportViewer1.LocalReport.ReportEmbeddedResource. My reports are embedded resources, but you can load it from a file too, I just can't remember off the top of my head. Once everything is loaded, call RefreshReport, and the report displays. Well, those are the main points, I don't have my code to look, but I know those are the basic steps.
Currently I have been researching how to load data sets on the fly as the user navigates through the report. My work around for this at the moment is to capture the ReportError event, check what report is trying to be displayed from the sender (this is the report viewer object), and load the dataset using the above. The only issue that I am having is that I don't have a loading screen when I am loading the dataset at this point, so it looks like my application freezes. I haven't figured out how to get back to that circular loading screen, but for now, I have a loading window that is displayed while I load. remember, when you get the error, the report trying to be displayed is already set as the local repot, so all you have to do is have a case/if statment checking for the report and loading the data as needed.
Can't you set a default parameter to something which stops much being returned, and only change it to a real one at run-time?

Categories

Resources