Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a problem with Microsoft report viewer
I have a database hosted in localhost through Sqlserver 2005 and I want to make a report about it using report viewer through VS 2008
When I tried this and make the report form as a main startup form it works fine and the report displayed with the right data fine
When I tried to make a normal start up form that has a button, this button's function is to show a report form and display the report in this form
When I tried this the program is closed when it tries to open the report form
When I debug it I found that when it reach the code line that refresh the report the program is terminated
The code of the button in the startup form is:
C#
Displayreport  Ldisplay = new Displayreport ();//Displayreport is the form //of the report
Ldisplay.Show();//show the form


And the code in the constractor of the form is:

C#
this.DataTable1TableAdapter.Fill(this.DataSet1.DataTable1, client_ID);
this.reportViewer1.RefreshReport(); //here the program is terminated


[edit]Code blocks added - OriginalGriff[/edit]
Posted
Updated 3-Mar-12 23:44pm
v5
Comments
ZurdoDev 2-Mar-12 11:01am    
I am having a hard time understanding what the issue is.
Uday P.Singh 4-Mar-12 5:22am    
not clear! what is the problem with "Microsoft report view"?
OriginalGriff 4-Mar-12 5:45am    
When you improve your question, try to preserve the code blocks that have been added for you - they make the code easier to spot, and to read.
You can insert these yourself, using the "code" widget or by wrapping the code in "pre" tags.

1 solution

From that? Not a lot we can do.
The best suggestion I can come up with is that you run this through the debugger, and set it to catch all exceptions.
Hopefully, the report viewer is throwing one that is no handled, and that is what is terminating the app.

If you look on the VS menu bar, under "Debug" is "Exceptions" Tick every box in the dialog, and press OK, then run through the debugger and see if you get anything.
 
Share this answer
 
Comments
Eng_Nour 4-Mar-12 6:14am    
Thank you for reply.
i do what you suggest but unfortunately it doesn't work any Exceptions
i checked all the radio buttons of Exceptions under thrown and it is by default the radio buttons under user-unhandled are checked

and then i tried to debug and check if the program throw an exception but the program terminate without any exception in run and debug
OriginalGriff 4-Mar-12 6:45am    
Then sorry, but there isn't a lot we can do. There is just not enough info there to locate anything, and it is difficult to see how much (and what) extra info would help.

I suggest that you have a look at the dataset before and after the Fill and see if it is widely different, and try removing bits of code until the problem goes away! :laugh: At the least then you would have an idea what is causing it...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900