So, I use the following code to generate PDF
LocalReport relatorio = new LocalReport();
relatorio.EnableExternalImages = true;
relatorio.ReportPath = HttpContext.Current.Server.MapPath("~/Admin/Financeiro/NotaFiscalEletronica/Danfe/NotaFiscalEletronicaDanfeReport.rdlc");
ReportParameter codigoBarrasParameter = new ReportParameter();
codigoBarrasParameter.Name = "CodigoBarras";
string codeBarArquivo = String.Format(@"file://{0}\{1}-codBarras.png", this.CaminhoXML, chaveAcesso);
codigoBarrasParameter.Values.Add(codeBarArquivo);
relatorio.SetParameters(codigoBarrasParameter);
DanfeReports nfeReport = new DanfeReports();
relatorio.DataSources.Add(new ReportDataSource("IdeDataSet", nfeReport.NotaFiscalEletronicaIdentificacao(chaveAcesso)));
relatorio.DataSources.Add(new ReportDataSource("EmiDataSet", nfeReport.NotaFiscalEletronicaEmitente(chaveAcesso)));
relatorio.DataSources.Add(new ReportDataSource("DestDataSet", nfeReport.NotaFiscalEletronicaDestinatario(chaveAcesso)));
relatorio.DataSources.Add(new ReportDataSource("ValTotDataSet", nfeReport.NotaFiscalEletronicaValoresTotais(chaveAcesso)));
relatorio.DataSources.Add(new ReportDataSource("TranspDataSet", nfeReport.NotaFiscalEletronicaInformacoesTransporte(chaveAcesso)));
relatorio.DataSources.Add(new ReportDataSource("ProdSevDataSet", nfeReport.NotaFiscalEletronicaProdutoServico(chaveAcesso)));
relatorio.DataSources.Add(new ReportDataSource("InfAdicDataSet", nfeReport.NotaFiscalEletronicaInformacoesAdicionais(chaveAcesso)));
string reportType = "PDF";
string mimeType;
string encoding;
string fileNameExtension;
Warning[] warnings;
string[] streams;
byte[] bytes;
//Renderiza o relatório em bytes
bytes = relatorio.Render(
reportType,
null,
out mimeType,
out encoding,
out fileNameExtension,
out streams,
out warnings);
MemoryStream memoryStream = new MemoryStream(bytes);
memoryStream.Seek(0, SeekOrigin.Begin);
string arquivo = String.Format("{0}.pdf", chaveAcesso);
SaveMemoryStream(this.CaminhoXML, arquivo, memoryStream);'
public bool SaveMemoryStream(string caminho, string nomeArquivo, MemoryStream memoryStream)
{
if (!Directory.Exists(caminho))
Directory.CreateDirectory(caminho);
FileStream file = new FileStream(caminho + @"\" + nomeArquivo, FileMode.Create, System.IO.FileAccess.Write);
byte[] bytes2 = new byte[memoryStream.Length];
memoryStream.Read(bytes2, 0, (int)memoryStream.Length);
file.Write(bytes2, 0, bytes2.Length);
file.Close();
memoryStream.Close();
return true;
}'
I think it's just you getting the PDF and sending the command to the printer.