As I am generating in PDF in an ASP.NET-MVC project I am using a method that renders the report and then makes it available to be viewed in the browser.
public FileContentResult RenderReport(string reportName, List<dynamic> data, string format = "PDF", string deviceInfo = "")
{
LocalReport localReport = new LocalReport();
localReport.ReportPath = Server.MapPath("~/Reports/" + reportName + ".rdlc");
// Passa os dados para o arquivo .xsd
ReportDataSource reportDataSource = new ReportDataSource(reportName, data);
localReport.DataSources.Add(reportDataSource);
format = format.ToUpper();
string mimeType;
string encoding;
string fileNameExtension;
if (Common.Strings.IsEmpty(deviceInfo))
{
deviceInfo = "<DeviceInfo>" +
" <OutputFormat>" + format + "</OutputFormat>" +
" <PageWidth>21cm</PageWidth>" +
" <PageHeight>11in</PageHeight>" +
" <MarginTop>2cm</MarginTop>" +
" <MarginLeft>2cm</MarginLeft>" +
" <MarginRight>2cm</MarginRight>" +
" <MarginBottom>2cm</MarginBottom>" +
"</DeviceInfo>";
}
Warning[] warnings;
string[] streams;
byte[] renderedBytes;
renderedBytes = localReport.Render(
format,
deviceInfo,
out mimeType,
out encoding,
out fileNameExtension,
out streams,
out warnings);
return File(renderedBytes, mimeType);
}
The last parameter of this method was added and then I set the default values for the card. Ready. With this the card/ badge is now generated with quality.
Maybe using bitmaps or something? Memory consumption goes to space, I know, but you can achieve a correlation from one pixel on the screen to one on the printer if you put a lot of effort into it.
– Oralista de Sistemas
Generate and render directly using the .NET. classes so you have more control. However, it can be too much brute force... I do not know if it is the most suitable, or if there is a more elegant solution. I hope that someone can suggest something better as a response.
– Oralista de Sistemas
I had a similar problem, pdf really was the best solution, but Reportviewer did not. Parti pro GMC Inspire and I didn’t have any more problems.
– Filipe.Fonseca
You note the loss of quality when you see in the PDF or when you print?
– ramaral
The answer to your question depends on a few factors. In what part of the process is the badge losing resolution? After printing all content features aliasing? Or fonts, etc are printed in high resolution, but visual features like bitmaps do not?
– OnoSendai