asp.net mvc - i want to make data as image type in rdlc reports(pdf) -
i want make data image rather text user can't copy text pdf in rdlc reports.
public fileresult downloadarticle(int id) { signalrdatacontext srcontext = new signalrdatacontext(); localreport localreport = new localreport(); localreport.reportpath = server.mappath("~/report/report1.rdlc"); reportdatasource reportdatasource = new reportdatasource(); localreport.enableexternalimages = true; reportdatasource.name = "dataset1"; reportdatasource.value = srcontext.articles.where(x => x.articleid == id).select(x => new { x.code, x.article_name }).tolist(); localreport.datasources.add(reportdatasource); string reporttype = "pdf"; string mimetype; string encoding; string filenameextension = "pdf"; warning[] warnings; string[] streams; byte[] renderedbytes; renderedbytes = localreport.render(reporttype, "", out mimetype, out encoding, out filenameextension, out streams, out warnings); response.addheader("content-disposition", "attachment;filename=membership." + filenameextension); return file(renderedbytes, filenameextension); }
try changing report type , extension tiff. sql server reporting services supports reports using tiff format.
public fileresult downloadarticle(int id) { ... string reporttype = "tiff"; ... string filenameextension = "tiff"; ... }
Comments
Post a Comment