cancel
Showing results for 
Search instead for 
Did you mean: 

Logo image not displaying in Crystal Report Subreport C# ASP.NET MVC

0 Kudos

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"].

former_member27
Community Manager
Community Manager

Hi jj_sone,

Welcome to the SAP Community! Thank you for visiting us to get answers to your questions.

Since you're asking a question here for the first time, I'd like to offer some friendly advice on how to get the most out of your community membership and experience.

First, please see https://community.sap.com/resources/questions-and-answers, as this resource page provides tips for preparing questions that draw responses from our members. Secondly, feel free to take our Q&A tutorial at https://developers.sap.com/tutorials/community-qa.html as well, as that will help you when submitting questions to the community.

Finally, I recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html.

I hope you find this advice useful, and we're happy to have you as part of SAP Community!

Regards,

Dedi

View Entire Topic
DonWilliams
Active Contributor
0 Kudos

"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.