on 09-20-2022 11:40 AM
I am new to Crystal Reports in ASP.net MVC. I have a main report with a logo from a subreport. The subreport is a separate .rpt file that gets its data from an image saved in the database in a binary string format. This logo's datatype when checked in the xsd is String.Byte[].
However, when I run the report viewer in the web browser, no image is being displayed. Even when I click on the box of the logo in the web browser and the separate rpt file is loaded, the report is blank.
I can confirm that this specific logo saved in the DB can be displayed in the report viewer when I tried to add a column for the image in the stored procedure that is used to populate and dragged that field in my main report.
I hope someone can help me as I am stuck here for days. This is what my code looks like in the report viewer:
report.Subreports["Logo"].ReportDefinition.ReportObjects[0].Height = 1500; //Convert.ToInt32(reportParam.CRParameters["COMPANYLOGOHEIGHT"]);
report.Subreports["Logo"].ReportDefinition.ReportObjects[0].Width = 5250; //Convert.ToInt32(reportParam.CRParameters["COMPANYLOGOWIDTH"]);
report.Subreports["Logo"].ReportDefinition.ReportObjects[0].Left = 13;
report.SetDataSource(reportParam.DataSource["Table"]);
report.Subreports["Logo"].SetDataSource(reportParam.DataSource["Logo"]);
StatementOfHoldingsReport.ReportSource = report;
I believe I am missing something when the image is being displayed in the separate sub report. I can also confirm that the string of bytes can be found in the row of the reportParam.DataSource["Logo"]
.
"PS: It doesn't also show when I try to view the report in CR Designer."
This suggests you do have network or permission issues if it only works some times. Could be resource issues also.
Not sure what else to suggest, if it's off/on in CRD it's going to be an issue in the SDK because the SDK uses the same API's CR Designer uses.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
9 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.