1

I am using ssrs for the reporting .I am sending parameter list including image url as a parameter. My report is unable to show image while rendering .

  • My image is in root folder of my web app.

  • i have sent image url like this


            string path = "http://" + Request.Url.Host;
            path = path + ":" + Request.Url.Port;
            path = path + "/Image/Logo.png";
            querystrings.Add(new KeyValuePair<string, string>("Logo_Url", path));`
  • It is all ok while opening report but when i export it to pdf image couldnot be viewed.

I hope my question is clear. I have tried hard to make to clear so that i could be helped. thank you in advance.

for more clearance to my question

Report.ServerReport.SetParameters(lst1);
byte[] b = Report.ServerReport.Render("PDF");Response.Clear();
Response.ContentType = "application/pdf";
Response.OutputStream.Write(b, 0, b.Length);
Response.End();

This is how i export my report to pdf. Hope i ll get some idea around this

Binod
  • 457
  • 4
  • 12

2 Answers2

1

after all this i come to the solution


  • created a folder for my image in report server enter image description here

  • then i create a execution account.Use acount having reading only property avoid using account having high permissionsUse acount having reading only property avoid using account having high permissions

And i got what i was looking for .

Binod
  • 457
  • 4
  • 12
0

If everything is ok when you preview your report in ReportViewer, maybe is a permission problem.

Check external images section in this document: Adding Images to a Report

When the report is previewed in Report Designer, preview uses the credentials of the user to display the image. When the report is run on the report server, the report server uses the unattended execution account to retrieve the image. If the unattended execution account is not specified, the image is retrieved using no credentials (anonymous user account). If either of these accounts have insufficient rights to access the image, the image will not be displayed in the report. For more information about the unattended execution account, see Configuring the Unattended Execution Account.

tezzo
  • 10,858
  • 1
  • 25
  • 48
  • its a server report and if it is redered to the html, than rendering to "pdf" is just it byte conversion isn't it?? – Binod Jul 04 '13 at 10:42
  • yes, you're right! I confused Report Designer and Viewer. What happend if you manually export your rdlc to PDF (http://stackoverflow.com/questions/2684221/creating-a-pdf-from-a-rdlc-report-in-the-background)? – tezzo Jul 04 '13 at 13:00
  • i hav added my code for export to pdf please review it. Its okie for rendering all except image for my logo. – Binod Jul 05 '13 at 07:06
  • finally i have published image folder in report server and i specified unattended execution account. It works :) – Binod Jul 08 '13 at 04:46