Got the idea from this answer:
https://mcmap.net/q/1166527/-rdlc-reports-use-a-sub-report-as-a-report-header
can't really post it there, since the topic is about rdlc, which is only client-side.
But I would say it fits here.
Create an image, set its size to fit proportionally, with the following url:
http://*reportserverUser*:*reportserverPassword*@*ssrsHost*/ReportServer?%2f*reportName*&rs:Command=Render&rs:Format=IMAGE&rc:OutputFormat=BMP&rc:dpix=1000&rc:dpiy=1000
&rs:Format=IMAGE
give me an Image.
&rc:OutputFormat=BMP
as a BMP, since Reports can't handle TIFF's.
&rc:dpix=1000&rc:dpiy=1000
give me a higher resolution, so it wont look ugly
EDIT: Seems to work locally in VisualStudio but not on the ReportServer. Might have to create a custom DLL for the authentication.
EDIT2:
[System.Security.SecuritySafeCritical]
[WebPermission(System.Security.Permissions.SecurityAction.Assert, Unrestricted = true)]
public static string GetReport(string reportname)
{
// request file permission for config-file
FileIOPermission f = new FileIOPermission(FileIOPermissionAccess.Read, @"c:\ssrs\ssrsutils_auth.txt");
f.Assert();
// BASE-URL\tusername\tpassword
var config = File.ReadAllText(@"c:\ssrs\ssrsutils_auth.txt");
// Get BASE-URL and insert reportname into {0} placeholder
var str = string.Format(config.Split('\t')[0], reportname);
var requestUri = new Uri(str);
// Set Credentials according to configuration
NetworkCredential nc = new NetworkCredential(config.Split('\t')[1], config.Split('\t')[2]);
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(requestUri);
request.Credentials = nc;
// Give me an Image object
var img = Image.FromStream(request.GetResponse().GetResponseStream());
// and return as Base64
return GetBase64(img);
}
private static string GetBase64(Image image)
{
using (MemoryStream m = new MemoryStream())
{
image.Save(m, ImageFormat.Png);
byte[] imageBytes = m.ToArray();
return Convert.ToBase64String(imageBytes);
}
}
Then you set the image-source to database, use the following expression:
=*Project*.*Class*.GetReport("*ReportName*")
Mime Type to image/bmp
and you are good to go
Example-Config c:\ssrs\ssrsutils_auth.txt
(replace [TAB] with actual \t - ASCII 09):
http://*ssrsHost*/ReportServer?%2f{0}&rs:Command=Render&rs:Format=IMAGE&rc:OutputFormat=BMP&rc:dpix=1000&rc:dpiy=1000[TAB]username[TAB]password
By the way, be aware of the way, SSRS handles CAS.
https://mcmap.net/q/1166528/-ssrs-custom-assembly-permissions-issue