Click here to Skip to main content
16,017,376 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I was generating rdlc reports like below code:

XML
var proposalFor = ecmClient.ServiceProxy.GetProposalFor(projectId);

           LocalReport localReport = new LocalReport();
           localReport.ReportPath = Server.MapPath("~/Reports/TCOSummary.rdlc");

           localReport.DataSources.Add(new ReportDataSource("ProposalFor_DS", proposalFor));

           string reportType = "Pdf";
           string mimeType;
           string encoding;
           string fileNameExtension;

           string deviceInfo = "<DeviceInfo>" +
               "  <OutputFormat>Excel</OutputFormat>" +
               "  <PageWidth>8.5in</PageWidth>" +
               "  <PageHeight>11in</PageHeight>" +
               "  <MarginTop>0.5in</MarginTop>" +
               "  <MarginLeft>1in</MarginLeft>" +
               "  <MarginRight>1in</MarginRight>" +
               "  <MarginBottom>0.5in</MarginBottom>" +
               "</DeviceInfo>";
           Warning[] warnings;
           string[] streams;
           byte[] renderedBytes;

           renderedBytes = localReport.Render(reportType, deviceInfo, out mimeType, out encoding, out fileNameExtension, out streams, out warnings);

           return File(renderedBytes, mimeType);

Main rdlc was coming properly and subreport not showing
shows below error:
Data retrieval failed for the subreport,
VB
'Subreport1', located at: D:
\HussmannECECMSolution\ECECMWP\Main
\Hussmann.ECM.WebPortal
\Hussmann.ECM.UI\Reports
\SampleReport.rdlc. Please check the log files
for more information.
Posted

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