custom assemblies

  • Hi all,

    I'm trying to use a C# based custom assembly in a report.  I haven't tried to tackle the security mess involved with the config files.  I'm simply trying to see if the function is working in the preview window, which Microsoft claims operates outside the managed code structure.  I've followed all the steps, including referencing the assembly in the report.  It recognizes the class and seems to be making the call.  When I test the function outside the report, it works fine.

    Here's the Output window results when I preview the report:

    Build complete -- 0 errors, 0 warnings

    The value expression for the textbox ‘Test’ contains an error: Index and length must refer to a location within the string.

    Parameter name: length

    Preview complete -- 0 errors, 1 warnings

    Any insight would be appreciated.  There are not a lot of resources available on this.

    Thanks

    Doug

     

     

  • This was removed by the editor as SPAM

  • Doug,

    your question was a bit vague.  I have had to wrestle with this in using encryption to store images here was the solution in total:

    1. Make a Class that will return a byte array of the image data.

    2. Put the DLL (and the pdb if you want to debug) for that class in:

              a.               C:\Program Files\Microsoft SQL Server\80\Tools\Report Designer

              b.                C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin

    3. In your report Add references to the class and the code module:

                <Classes><Class><ClassName>CESIDecoderExtension.CESI.ImageDecoder</ClassName><InstanceName>mydecoder</InstanceName></Class></Classes><CodeModules><CodeModule>CESIDecoderExtension</CodeModule></CodeModules>

    4.Add an image to your report

    5. in the image wizard Chose Database

    6. close (finish) the wizard.

    7. view the xml code and make the following changes:

                  a. <MIMEType>image/jpeg</MIMEType>---or whatever yours is

                  b. <Value>=Code.mydecoder.downloaddata(Fields!PhotoFile.Value)</Value>----where photofile=the name of the file

    8.  A complete image would look something like this:

        <Image Name="image1"><Top>0.5in</Top><MIMEType>image/jpeg</MIMEType><Height>1.75in</Height><Width>2.375in</Width><Source>Database</Source><Style /><Value>=Code.mydecoder.downloaddata(Fields!PhotoFile.Value)</Value><Left>0.25in</Left><Sizing>AutoSize</Sizing></Image>

    You Have to add a codegroup to

    RSSRVpolicy.config located at :

    C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer

    and to

    rspreviewpolicy.config located at:

    C:\Program Files\Microsoft SQL Server\80\Tools\Report Designer

    A code group must be added nested within the codegroup "FirstMatchCodeGroup"

    This codegroup follows:

    <CodeGroup class="UnionCodeGroup"

               version="1"

               PermissionSetName="FullTrust"

               Name="MyCodeGroup"

               Description=""><IMembershipCondition class="ZoneMembershipCondition"

               version="1"

               Zone="MyComputer"/></CodeGroup> 

     

    Lots of instructions there .... these were the notes I left for myself after a tech support call to Microsoft

    HTH

     

    tal mcmahon

       


    Kindest Regards,

    Tal Mcmahon

  • Tal,

    Thanks very much for your response.  My solution was actually quite simple.  I simply needed to make sure the config files were at the default locations.  We had a bit of an unusual install, so Reporting Services was confused.

    I was prepared to modify the config files, but it turned out I didn't need to.

    Thanks again.  I'm sure I'll be referring to your post down the road.

    Doug

     

     

     

     

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply