Saturday, January 26, 2013

SSRS - Presenting Dynamic Images From Database To Report

I will explain how to represent images stored in SQL DB into report.

I expected you already save image in SQL DB as varbinary.



STEP -1
Create project SSRS project.


STEP -2
Create shared data source and report.

STEP -3
Create data source and select your image binaries, I supposed the image binary column named FileContent.






STEP -4
Now, in report body, add new table then add new image from toolbox in the first second row of the table and set the following properties:


Then press OK. The result will be like the following:



Tuesday, January 1, 2013

SSRS - Localize Microsoft Report Viewer


Scenario:
We have multi-language site. This site contains a lot of reports presented in different languages. But we have problem. The report viewer, the control which shows report, is English. We need to localize this control. Can you do it?

Answer:
Yes, its so simple.
there is interface called 'IReportViewerMessages'. Via this interface you can change report viewer internal controls value as the following steps:

STEP -1:
Add a class named, for example, 'ReportViewerMessages' which implement 'IReportViewerMessages'.

STEP -2:
Create GlobalResource named 'ReportViewerResource'.


STEP- 3:
Add the following line to your web.config:
<add key="ReportViewerMessages" value="YourClass, YourAssembly" />

Build and run your project and the result will be like the following: