on 07-08-2021 8:43 AM
Hello,
Currently I'm trying to display a report inside a winforms, I search many tutorial trying to see how should I made it and I came up with this:
I need a form whit a Crystalreportviewer on it, ok so I create it, and when I try to see if display correctly the report there is an exception that I dont know how to solve it.
Here is the code of my form as you can see there is a function call LanzadorReports which recibe a report and parameter list and pass the report to the crystalreportviewer, is very simple as you can see:
And the error happens on the first line of crystalreportviewer:
Is like if the crystal report viewer is not instantiated but is incrustated in the form so the error have no sense, could anyone help me?
First, set Copy local to False.
Leave Interopt to false also.
You are using SP 30, mark this page and keep it in your Favorite list:
https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads
You are not setting the Viewers Report object to the report.
I my main test app I have a flag that if I use RAS to modify the report I set it, otherwise I use the Report Object:
try
{
if (IsRpt)
{
crystalReportViewer1.ReportSource = rptClientDoc.ReportSource;
}
else
{
crystalReportViewer1.ReportSource = rpt;
}
}
catch (Exception ex)
{
btnSQLStatement.Text = "ERROR: " + ex.Message;
}
See if that works...
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This line in your code makes me suspect that the CrystalReportViewer is not embedded in the form when the form is created:
Controls.Add(crystalReportViewer1);
So, you would have to either instantiate it at the top of the procedure or add it to the form so that it gets instantiated with the form. Also, on the CrystalDecisions references in your project, make sure that the "EmbedInteropTypes" property is set to False.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.