Showing posts with label binary. Show all posts
Showing posts with label binary. 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

Saturday, February 25, 2012

Can''t precompile script

Hi,

with a script task I get an error "This task is configured to pre-compile the script but the binary code is not found. Please visit the IDE in Script Task editor by clicking Desing Script button to cause binary code to be generated".

Well, if I do so the error doesn't disappear. The only chance I have is to switch of precopilation, which is quite a performance issue...

I have no idea where this error is comming from... The script is quite easy, just some string and file operations (find out file change date using system.io)...

Any idea?

I can only think that there is an error in compilation because this should of course work!

-Jamie

|||...any idea where to look? If I switch of precompile everything works, so there shouldn't be any error in the script...|||

Hmmm...bizarre.

Sorry Thomas, can't help you there!

|||This is an old one, but I just had the same problem and just noticed that my script had a syntax error. Once I fixed the syntax error, the problem was resolved.|||im facing the same problem....for the first time....simply cant keep precompile option to true as binary code is not getting generated....the issue is my env may change to 64 bit....evn keepin the option precompile false wont help then( which is workin fine now)
...just as im writin this....was this a issue bfr SP1... i havent checked if i have run it in new installation...
will check n post back if success....
ne suggestions welcome in the meanwhile...|||This is just wrong - when I set property precompile = false for the Script Task everything works fine.

SSIS works in odd ways sometimes (or perhaps it is just me)

Actually I now noticed that whatever package's script i open up - they dont compile anymore - I wonder what causes all of a sudden all the scripts on my workstation not to compile?|||as i guessed...SP1 solves this problem...worked for me... i had a new local server installation n missed out on the service packs....so install SP1 and 2 and ur done.....but ya ull have to then change all precompilei otions to true and open n close the script once to get the binary code........

sorry for the delay in reply!!

Can''t precompile script

Hi,

with a script task I get an error "This task is configured to pre-compile the script but the binary code is not found. Please visit the IDE in Script Task editor by clicking Desing Script button to cause binary code to be generated".

Well, if I do so the error doesn't disappear. The only chance I have is to switch of precopilation, which is quite a performance issue...

I have no idea where this error is comming from... The script is quite easy, just some string and file operations (find out file change date using system.io)...

Any idea?

I can only think that there is an error in compilation because this should of course work!

-Jamie

|||...any idea where to look? If I switch of precompile everything works, so there shouldn't be any error in the script...|||

Hmmm...bizarre.

Sorry Thomas, can't help you there!

|||This is an old one, but I just had the same problem and just noticed that my script had a syntax error. Once I fixed the syntax error, the problem was resolved.|||im facing the same problem....for the first time....simply cant keep precompile option to true as binary code is not getting generated....the issue is my env may change to 64 bit....evn keepin the option precompile false wont help then( which is workin fine now)
...just as im writin this....was this a issue bfr SP1... i havent checked if i have run it in new installation...
will check n post back if success....
ne suggestions welcome in the meanwhile...|||This is just wrong - when I set property precompile = false for the Script Task everything works fine.

SSIS works in odd ways sometimes (or perhaps it is just me)

Actually I now noticed that whatever package's script i open up - they dont compile anymore - I wonder what causes all of a sudden all the scripts on my workstation not to compile?|||as i guessed...SP1 solves this problem...worked for me... i had a new local server installation n missed out on the service packs....so install SP1 and 2 and ur done.....but ya ull have to then change all precompilei otions to true and open n close the script once to get the binary code........

sorry for the delay in reply!!

Can't precompile script

Hi,

with a script task I get an error "This task is configured to pre-compile the script but the binary code is not found. Please visit the IDE in Script Task editor by clicking Desing Script button to cause binary code to be generated".

Well, if I do so the error doesn't disappear. The only chance I have is to switch of precopilation, which is quite a performance issue...

I have no idea where this error is comming from... The script is quite easy, just some string and file operations (find out file change date using system.io)...

Any idea?

I can only think that there is an error in compilation because this should of course work!

-Jamie

|||...any idea where to look? If I switch of precompile everything works, so there shouldn't be any error in the script...|||

Hmmm...bizarre.

Sorry Thomas, can't help you there!

|||This is an old one, but I just had the same problem and just noticed that my script had a syntax error. Once I fixed the syntax error, the problem was resolved.|||im facing the same problem....for the first time....simply cant keep precompile option to true as binary code is not getting generated....the issue is my env may change to 64 bit....evn keepin the option precompile false wont help then( which is workin fine now)
...just as im writin this....was this a issue bfr SP1... i havent checked if i have run it in new installation...
will check n post back if success....
ne suggestions welcome in the meanwhile...|||This is just wrong - when I set property precompile = false for the Script Task everything works fine.

SSIS works in odd ways sometimes (or perhaps it is just me)

Actually I now noticed that whatever package's script i open up - they dont compile anymore - I wonder what causes all of a sudden all the scripts on my workstation not to compile?|||as i guessed...SP1 solves this problem...worked for me... i had a new local server installation n missed out on the service packs....so install SP1 and 2 and ur done.....but ya ull have to then change all precompilei otions to true and open n close the script once to get the binary code........

sorry for the delay in reply!!

Can't precompile script

Hi,

with a script task I get an error "This task is configured to pre-compile the script but the binary code is not found. Please visit the IDE in Script Task editor by clicking Desing Script button to cause binary code to be generated".

Well, if I do so the error doesn't disappear. The only chance I have is to switch of precopilation, which is quite a performance issue...

I have no idea where this error is comming from... The script is quite easy, just some string and file operations (find out file change date using system.io)...

Any idea?

I can only think that there is an error in compilation because this should of course work!

-Jamie

|||...any idea where to look? If I switch of precompile everything works, so there shouldn't be any error in the script...|||

Hmmm...bizarre.

Sorry Thomas, can't help you there!

|||This is an old one, but I just had the same problem and just noticed that my script had a syntax error. Once I fixed the syntax error, the problem was resolved.|||im facing the same problem....for the first time....simply cant keep precompile option to true as binary code is not getting generated....the issue is my env may change to 64 bit....evn keepin the option precompile false wont help then( which is workin fine now)
...just as im writin this....was this a issue bfr SP1... i havent checked if i have run it in new installation...
will check n post back if success....
ne suggestions welcome in the meanwhile...|||This is just wrong - when I set property precompile = false for the Script Task everything works fine.

SSIS works in odd ways sometimes (or perhaps it is just me)

Actually I now noticed that whatever package's script i open up - they dont compile anymore - I wonder what causes all of a sudden all the scripts on my workstation not to compile?|||as i guessed...SP1 solves this problem...worked for me... i had a new local server installation n missed out on the service packs....so install SP1 and 2 and ur done.....but ya ull have to then change all precompilei otions to true and open n close the script once to get the binary code........

sorry for the delay in reply!!

Sunday, February 12, 2012

Can't Insert Binary Data Into Sql Mobile

Hi guys, I'm having a problem inserting a file into a SQL Mobile table.

I'm updating the table via a tableadapter designed through the Dataset designer in VS2k5.

The SQL used to insert is "Insert into TestTable (itemid,itemdata) values (@.itemid,@.itemdata)"

Where ItemID is a GUID, and ItemData is an Image field. The tableadapter has typed the parameters as GUID and Binary properly already.

Only problem is when I actually call the command with a byte array containing my file, I get a "Byte truncation" error message.

I remember this working properly in SQL CE 2.0 but so far I don't seem to get it to work in SQL mobile, anyone got any pointers?

How big is the array? If you try to insert array of, say, one byte in size, does that work?

|||

Here is a sample of what you need to do to insert binary data into an image column in SQL Mobile:

MemoryStream ms = new MemoryStream();
pictureBox1.Image.Save(ms, ImageFormat.Jpeg);
byte[] imageBytes = ms.ToArray();

SqlCeConnection cn = DatabaseManager.GetInstance().DBConnection;
string sql = "INSERT INTO Photos (ID, Photo) VALUES (NewID(), ?)";
SqlCeCommand command = new SqlCeCommand(sql, cn);

command.Parameters.Add("@.image", SqlDbType.Image, imageBytes.Length);

command.Parameters["@.image"].Value = imageBytes;

command.ExecuteNonQuery();

-Darren