Hi,
Can you pls suggest what could be the problem the same report with images[same for test] from DB and custom assembly [it takes a id and return image as array of stream ]works fine in Visual Studio[i ve deployed to private assembly and to the reportserver-bin folder].
However the same assembly doesnot work after deploying to webserver.
Note that images works fine with CUstom Assembly in Visual Studio and i ve deployed the dll to both
C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin
and to
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies
i also tried GAced but with no result.The sameassemby although rendered fine with the Vs studio.
Also it was strange that even though i am supply the value from custom assmebly i have supply the image source as DB to get the same rendered in VS studio[preview mode]
Below is the RDL:-
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<DataSources>
<DataSource Name="AdventureWorks">
<ConnectionProperties>
<IntegratedSecurity>true</IntegratedSecurity>
<ConnectString>Data Source=Myservername;Initial Catalog=AdventureWorks</ConnectString>
<DataProvider>SQL</DataProvider>
</ConnectionProperties>
<rd:DataSourceID>ac9242f7-c779-47e6-bbd9-4dfadb9f51fe</rd:DataSourceID>
</DataSource>
</DataSources>
<BottomMargin>1in</BottomMargin>
<RightMargin>1in</RightMargin>
<rd:DrawGrid>true</rd:DrawGrid>
<InteractiveWidth>8.5in</InteractiveWidth>
<rd:SnapToGrid>true</rd:SnapToGrid>
<Body>
<ReportItems>
<Textbox Name="textbox1">
<rd:DefaultName>textbox1</rd:DefaultName>
<ZIndex>1</ZIndex>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Verdana</FontFamily>
<FontSize>16pt</FontSize>
<Color>DarkRed</Color>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.3in</Height>
<Value>ProductionPhotoReport</Value>
</Textbox>
<Table Name="table1">
<DataSetName>AdventureWorks</DataSetName>
<Top>0.3in</Top>
<Details>
<TableRows>
<TableRow>
<TableCells>
<TableCell>
<ReportItems>
<Image Name="image1">
<Sizing>AutoSize</Sizing>
<MIMEType>image/bmp</MIMEType>
<ZIndex>4</ZIndex>
<Source>Database</Source>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<BorderColor>
<Default>LightGrey</Default>
</BorderColor>
</Style>
<Value>=Fields!ThumbNailPhoto.Value</Value>
</Image>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Image Name="image2">
<Sizing>AutoSize</Sizing>
<MIMEType>image/bmp</MIMEType>
<ZIndex>3</ZIndex>
<Source>Database</Source>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<BorderColor>
<Default>LightGrey</Default>
</BorderColor>
</Style>
<Value>=Fields!LargePhoto.Value</Value>
</Image>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="ProductPhotoID">
<rd:DefaultName>ProductPhotoID</rd:DefaultName>
<ZIndex>2</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Verdana</FontFamily>
<BorderColor>
<Default>LightGrey</Default>
</BorderColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Fields!ProductPhotoID.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Primary">
<rd:DefaultName>Primary</rd:DefaultName>
<ZIndex>1</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Verdana</FontFamily>
<BorderColor>
<Default>LightGrey</Default>
</BorderColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Fields!Primary.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Image Name="image3">
<Sizing>AutoSize</Sizing>
<MIMEType>image/bmp</MIMEType>
<Source>Database</Source>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<BorderColor>
<Default>LightGrey</Default>
</BorderColor>
</Style>
<Value>=MyClassLibrary.ImageManager.getimagesfromDB(Fields!ProductPhotoID.Value)</Value>
</Image>
</ReportItems>
</TableCell>
</TableCells>
<Height>0.21in</Height>
</TableRow>
</TableRows>
</Details>
<Header>
<TableRows>
<TableRow>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox2">
<rd:DefaultName>textbox2</rd:DefaultName>
<ZIndex>9</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Verdana</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>11pt</FontSize>
<BorderColor>
<Default>LightGrey</Default>
</BorderColor>
<BackgroundColor>#4e0000</BackgroundColor>
<Color>White</Color>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>Thumb Nail Photo</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox3">
<rd:DefaultName>textbox3</rd:DefaultName>
<ZIndex>8</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Verdana</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>11pt</FontSize>
<BorderColor>
<Default>LightGrey</Default>
</BorderColor>
<BackgroundColor>#4e0000</BackgroundColor>
<Color>White</Color>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>Large Photo</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox4">
<rd:DefaultName>textbox4</rd:DefaultName>
<ZIndex>7</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<TextAlign>Right</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Verdana</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>11pt</FontSize>
<BorderColor>
<Default>LightGrey</Default>
</BorderColor>
<BackgroundColor>#4e0000</BackgroundColor>
<Color>White</Color>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>Product Photo ID</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox5">
<rd:DefaultName>textbox5</rd:DefaultName>
<ZIndex>6</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Verdana</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>11pt</FontSize>
<BorderColor>
<Default>LightGrey</Default>
</BorderColor>
<BackgroundColor>#4e0000</BackgroundColor>
<Color>White</Color>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>Primary</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox6">
<rd:DefaultName>textbox6</rd:DefaultName>
<ZIndex>5</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Verdana</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>11pt</FontSize>
<BorderColor>
<Default>LightGrey</Default>
</BorderColor>
<BackgroundColor>#4e0000</BackgroundColor>
<Color>White</Color>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>FROM CUSTOM ASSEMBLY</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
<Height>0.22in</Height>
</TableRow>
</TableRows>
<RepeatOnNewPage>true</RepeatOnNewPage>
</Header>
<TableColumns>
<TableColumn>
<Width>1in</Width>
</TableColumn>
<TableColumn>
<Width>1in</Width>
</TableColumn>
<TableColumn>
<Width>1in</Width>
</TableColumn>
<TableColumn>
<Width>1in</Width>
</TableColumn>
<TableColumn>
<Width>1.625in</Width>
</TableColumn>
</TableColumns>
</Table>
</ReportItems>
<Height>0.73in</Height>
</Body>
<rd:ReportID>84ed04b0-68eb-472b-aafd-621ce3a0c00f</rd:ReportID>
<LeftMargin>1in</LeftMargin>
<DataSets>
<DataSet Name="AdventureWorks">
<Query>
<CommandText>SELECT Production.ProductPhoto.ThumbNailPhoto, Production.ProductPhoto.LargePhoto, Production.ProductPhoto.ProductPhotoID,
Production.ProductProductPhoto.[Primary]
FROM Production.ProductPhoto INNER JOIN
Production.ProductProductPhoto ON Production.ProductPhoto.ProductPhotoID = Production.ProductProductPhoto.ProductPhotoID
WHERE (Production.ProductPhoto.ProductPhotoID <> 1)</CommandText>
<DataSourceName>AdventureWorks</DataSourceName>
</Query>
<Fields>
<Field Name="ThumbNailPhoto">
<rd:TypeName>System.Byte[]</rd:TypeName>
<DataField>ThumbNailPhoto</DataField>
</Field>
<Field Name="LargePhoto">
<rd:TypeName>System.Byte[]</rd:TypeName>
<DataField>LargePhoto</DataField>
</Field>
<Field Name="ProductPhotoID">
<rd:TypeName>System.Int32</rd:TypeName>
<DataField>ProductPhotoID</DataField>
</Field>
<Field Name="Primary">
<rd:TypeName>System.Boolean</rd:TypeName>
<DataField>Primary</DataField>
</Field>
</Fields>
</DataSet>
</DataSets>
<CodeModules>
<CodeModule>MyClassLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</CodeModule>
</CodeModules>
<Code />
<Width>5.625in</Width>
<InteractiveHeight>11in</InteractiveHeight>
<Language>en-US</Language>
<TopMargin>1in</TopMargin>
</Report>
This sounds like a permission issue, but you would need to look at the the RS logs to be sure. These are located here C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\LogFiles\.
In VS preview custom assemblies run with FullTrust, but when deployed to the server the code runs with the limited Execution permission set by default. See here for more information:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_prog_rdl_8mue.asp
and http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_prog_extend_install_25ia.asp.
Since the code runs with the limited Execution permission set, you may need to follow the instructions here to access protected resources, like accessing a database:
http://msdn2.microsoft.com/fr-fr/library/ms153587.aspx.
After you have set up the policy file to allow for special access to protected resources, you need to assert that you have permission. Here is an example of opening a connection to a SQL Server within the custom assembly:
SqlClientPermission sqlPermission = new SqlClientPermission(PermissionState.Unrestricted);
try
{
sqlPermission.Assert();
SqlConnection conn = new SqlConnection("...");
conn.Open();
}
Ian|||
Thanks Ian,
Problem Solved.The issue was with the case sensitiveness in the config.
No comments:
Post a Comment