Pergunta

Why is ActiveReports printing a blank page? I've checked the dataTable and memoryStream objects in the code below during runtime, and both of them are fully populated with data so I'm completely stumped and at my whit's end. Any help would be greatly appreciated. Thank you.

using (var proposal Report = new Proposal()) //This is the ActiveReports object
using (PdfExport pdfExport = new PdfExport())
using (System.Data.DataTable dataTable = dataContext.GetViewProposal(proposalId))
{
    proposalReport.DataSource = dataTable;
    proposalReport.Run();

    pdfExport.Export(proposalReport.Document, memoryStream);
    memoryStream.Position = 0;
}

HttpContext.Response.AddHeader("content-disposition", "attachment; filename=proposal.pdf");
return new FileStreamResult(memoryStream, "application/pdf");

Some additional information:

This report has a ton of sub reports. My boss thinks it might have something to do with the content being outside the margins, however I've made sure that everything is inside the margins (which are set to 0.25 top, left, right, bottom). I even tried deleting all the subreports out of the Detail and Footer sections of the main report in an attempt to narrow things down (so the only things that remain are the four static subreports in the main report's group header) and I'm still getting the same results, but with an additional blank page.

Foi útil?

Solução

I actually ended up resolving the issue. I originally copied and pasted this report from another one and was tweaking it. Apparently the COPY didn't copy the wiring up of the event handlers to the various bands of the report such as the Detail_Format event despite me performing this copy and paste all through VS2010's Solution Explorer. I have no idea why this was the case, but anyway this is why the report was nothing but blank pages.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top