I have a report that has a PictureBox on it which I am using for an employee signature. I store the signature in the SQL server as a varbinary(max). The employee signature will be different for every report and is returned in the SqlDataSource for the report. I recently started getting a ""Parameter Not Valid" exception when rendering the report as a pdf and had to reboot the IIS server to get the report to render again. I must either be doing something wrong or not using the best practice for this scenario. Here is how I am importing the bmp signature to the table in SQL server:
Here is how I am rendering the report to pdf:
I think it is the signature block causing the issue but I could be wrong. Any suggestions as to how to properly add a bmp file to a report dynamically?
UPDATE
[HR_Employees]
SET
EmployeeSignature = (
SELECT
BulkColumn
FROM
OPENROWSET(
Bulk
'C:\Signatures\Justin.bmp'
, SINGLE_BLOB)
AS
BLOB)
WHERE
EmployeeNumber =
'99999'
Here is how I am rendering the report to pdf:
public
ActionResult PrintPoReport(
string
id)
{
var irs =
new
InstanceReportSource();
irs.ReportDocument =
new
LogisticsReports.PoHeader();
irs.Parameters.Add(
new
Parameter(
"PoID"
, id));
Telerik.Reporting.Processing.ReportProcessor rp =
new
Telerik.Reporting.Processing.ReportProcessor();
Telerik.Reporting.Processing.RenderingResult result = rp.RenderReport(
"PDF"
, irs,
null
);
byte
[] contents = result.DocumentBytes;
return
File(contents,
"application/pdf"
,
"P0 #"
+ id +
".pdf"
);
}
I think it is the signature block causing the issue but I could be wrong. Any suggestions as to how to properly add a bmp file to a report dynamically?