Showing posts with label image. Show all posts
Showing posts with label image. Show all posts

Tuesday, March 20, 2012

Cant see image

Hello, my image is stored on the database as an URL, not binary.

I put a textbox and the url is show on the report,

then I put an image and this expression

=(ReportItems!dslogo.Value)

dslogo is the name of the textbox where the url is. but I dont see my image yet.

Did you set the source property of the image to "External"? Do you get the image in designer preview?|||

Its external and no I dont see it in the preview neither,

when I copy paste the url in the browser it shows me the image.

|||

Hmm, I tried a simple repro and it worked just fine for me. Here is the rdl I used:

<?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="Northwind">
<DataSourceReference>Northwind</DataSourceReference>
<rd:DataSourceID>6865eece-7da0-4cf5-9a9f-0f9d8d019185</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>
<Image Name="image1">
<Sizing>AutoSize</Sizing>
<Left>2.125in</Left>
<MIMEType />
<Top>1.25in</Top>
<ZIndex>1</ZIndex>
<Width>1.22917in</Width>
<Source>External</Source>
<Style />
<Height>0.36458in</Height>
<Value>=ReportItems!ID.Value</Value>
</Image>
<Textbox Name="ID">
<Left>2.125in</Left>
<Top>0.5in</Top>
<rd:DefaultName>ID</rd:DefaultName>
<Width>1in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>=Fields!ID.Value</Value>
</Textbox>
</ReportItems>
<Height>3.75in</Height>
</Body>
<rd:ReportID>689d4b94-4437-47b2-b266-840ecd5d2866</rd:ReportID>
<LeftMargin>1in</LeftMargin>
<DataSets>
<DataSet Name="DataSet1">
<Query>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
<CommandText>select 'http://hp.msn.com/global/c/lg/msft94.gif'</CommandText>
<DataSourceName>Northwind</DataSourceName>
</Query>
<Fields>
<Field Name="ID">
<rd:TypeName>System.String</rd:TypeName>
<DataField />
</Field>
</Fields>
</DataSet>
</DataSets>
<Width>12.875in</Width>
<InteractiveHeight>11in</InteractiveHeight>
<Language>en-US</Language>
<TopMargin>1in</TopMargin>
</Report>

|||

The reporting server is in another server than my machine, the image is on the reporting service but I am testing the report from the preview tab. Maybe it fails because the image is on another server and the report is not deployed?

The image is inside a folder of a web application

C:\Inetpub\wwwroot\Application\images\image1.gif.

Does the folder need special permissions, or do I have to configure reportserver XML configuration files to execute on another context?

Thanks

Sunday, February 12, 2012

Can't import image when size is more then 8K using "microsoft.xmlhttp"

I'm using following script to import image into SQL Server from web and it does not work for image 2 (http://dbalinks.com/images/mol2.jpg) but it work for image 1 (http://dbalinks.com/images/mol1.jpg):

declare @.local int
declare @.retcode int
declare @.status int
declare @.url varchar(2000)

create table #httpresult(pic image)

--set @.url = 'http://dbalinks.com/images/mol1.jpg'
set @.url = 'http://dbalinks.com/images/mol2.jpg'

exec @.retcode = sp_oacreate 'microsoft.xmlhttp', @.local out
exec @.retcode = sp_oamethod @.local, 'open', null, 'get',@.url , 'false'
exec @.retcode = sp_oamethod @.local, 'send', null, @.status
exec @.retcode = sp_oagetproperty @.local, 'status', @.status out
insert #httpresult (pic)
exec @.retcode = sp_oagetproperty @.local, 'responsebody'

select * from #httpresult

drop table #httpresult

exec sp_oadestroy @.local


Is it possible to import image larger then 8K into SQL Server from the web using T-SQL and stored procedure?

Is there any chance that admin can do something about this?

Maybe using stream:

exec sp_oacreate 'adodb.stream',@.o OUT
exec sp_oasetproperty @.o,'Type',adTypeBinary

or something like that.

Can't import image when size is more then 8K using "microsoft.xmlhttp"

I'm using following script to import image into SQL Server from web and it does not work for image 2 (http://dbalinks.com/images/mol2.jpg) but it work for image 1 (http://dbalinks.com/images/mol1.jpg):

declare @.local int
declare @.retcode int
declare @.status int
declare @.url varchar(2000)

create table #httpresult(pic image)

--set @.url = 'http://dbalinks.com/images/mol1.jpg'
set @.url = 'http://dbalinks.com/images/mol2.jpg'

exec @.retcode = sp_oacreate 'microsoft.xmlhttp', @.local out
exec @.retcode = sp_oamethod @.local, 'open', null, 'get',@.url , 'false'
exec @.retcode = sp_oamethod @.local, 'send', null, @.status
exec @.retcode = sp_oagetproperty @.local, 'status', @.status out
insert #httpresult (pic)
exec @.retcode = sp_oagetproperty @.local, 'responsebody'

select * from #httpresult

drop table #httpresult

exec sp_oadestroy @.local


Is it possible to import image larger then 8K into SQL Server from the web using T-SQL and stored procedure?

Is there any chance that admin can do something about this?

Maybe using stream:

exec sp_oacreate 'adodb.stream',@.o OUT
exec sp_oasetproperty @.o,'Type',adTypeBinary

or something like that.