We have several reports (not authored by me) that call a C# custom assembly that has 1 method. The 1 method converts an html input string into a bitmap and return the bitmap. The 1 method's call signature looks like this:
public byte[] GetImage(string html)
The existing reports run without error, and they convert html to images, but we weren't happy with the conversion results. Sooo I was tasked with creating a new custom assembly that uses the same call signature - but uses Aspose.Words to do the image conversion.
To that end I coded a new custom assembly with a GetImage method. I registered both my custom assembly and Aspose in the gac on the DB server and in the report .rdl I updated the CodeModule declarations to use Aspose and my new assembly:
<CodeModules> <CodeModule>Aspose.Words, Version=9.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56</CodeModule> <CodeModule>SSRSCustomTables, Version=1.0.0.0, Culture=neutral, PublicKeyToken=583b5b1f13c0ee82</CodeModule> </CodeModules> <Classes> <Class> <ClassName>CustomAssembly.GetImageClass</ClassName> <InstanceName>ImgClass</InstanceName> </Class> </Classes>
The existing reports all call the image conversion method like this:
<TablixCell>
<CellContents>
<Image Name="Image3">
<Source>Database</Source>
<Value>=IIF(Fields!SpecificationDescription.Value is system.DBNull.value,"stop",IIF(Fields!SpecificationDescription.Value = "","stop",Code.ImgClass.GetImage(Fields!SpecificationDescription.Value)))</Value>
<MIMEType>image/bmp</MIMEType>
<Style>
<Border>
<Style>None</Style>
</Border>
</Style>
</Image>
</CellContents>
</TablixCell>
The report uploads and runs without error -but- when I preview it I see the "white box with a red X missing image" placeholder where the images should appear. The custom assembly functions correctly in a small testbed app that feeds the GetImage method some html but it doesn't work in the report.
I put a SQL Profiler trace on the server looking for TSQL and AssemblyLoads. Then I started the reporting server and ran a report. The trace showed the correct sql statements were executing but it never fired an event for an assembly load even though I had the trace running before I started the reporting server instance.
Questions:
- Does anybody have any thoughts on what might be happening - it seems to me that the GetImage method is never being called but I don't get any errors
- When should the "assembly load" profiler events fire - I didn't get any events and I had profiler running before I started the reporting server
- If the "assembly load" events fire when the database engine is started is there any way to trace an engine start?
--Richard