Monday, March 12, 2012
Referencing a Control's Value Property
the contents of the value property in a textbox control. I thought I
saw this before but cannot seem to find it again.
For example, I have an image control called image1. Which has a value
of: C:\images\xxxx.jpg
In a textbox I want to show "C:\images\xxxx.jpg"
I'm trying something like: textbox.value=image1.value
So when I preview the report I get an image, and a textbox that shows
the value used for the text box.
Any ideas?
Thanks,
rwiethornCurrently, the only Value property exposed to expressions is Textbox.Value
(in fact, the only report items visible to expressions at all are
textboxes).
But... You could achieve the desired result by making the value of the image
control an expression that refers to the contents of the textbox:
=ReportItems!Textbox1.Value
--
This post is provided 'AS IS' with no warranties, and confers no rights. All
rights reserved. Some assembly required. Batteries not included. Your
mileage may vary. Objects in mirror may be closer than they appear. No user
serviceable parts inside. Opening cover voids warranty. Keep out of reach of
children under 3.
"rwiethorn" <rwiethorn2002@.yahoo.com> wrote in message
news:553a0349.0408230522.2226ad4d@.posting.google.com...
> I'm trying to reference a image control value property. I want to show
> the contents of the value property in a textbox control. I thought I
> saw this before but cannot seem to find it again.
> For example, I have an image control called image1. Which has a value
> of: C:\images\xxxx.jpg
> In a textbox I want to show "C:\images\xxxx.jpg"
> I'm trying something like: textbox.value=image1.value
> So when I preview the report I get an image, and a textbox that shows
> the value used for the text box.
> Any ideas?
> Thanks,
> rwiethorn
Monday, February 20, 2012
Reduce file size of image when uploaded to sql server
Is it possible to reduce the file size of an image when the user uploads it into a sql server image field.
i.e Crush it from 500K to less.
Regards,
RGHi,
If you just want to reduce the file size but keep the same content, you could ZIP it after uploading it.
http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx
Or, if you want to reduce the physical image dimensions, you could make a thumbnail.
http://www.csharp-station.com/Articles/Thumbnails.aspx
Or both!
A.|||Zipping won't help much. Most image types that I've used are already compressed and zipping them gets you very little. Make a thumbnail or use an image processing component to reduce the resolution.|||Thanks Guys,
The user uploads the pic which is then saved to an image field as the full image; as well as a Thumnail made and stored in another image field.
The images are then available through the page.
The thumnail is fine but the full image needs sometimes to be compressed further.
I'll take a look at image processing components but is there now easier way to do this?
Should I be storing images in SQL server anyway, some people say not??
Regards,
RG|||::The thumnail is fine but the full image needs sometimes to be compressed further.
The bad thing with thisis that unless the "image" is an uncompressed bitmap there basically is not too much you can compress out.
::I'll take a look at image processing components but is there now easier way to do this?
No. You need to change the image to compress it further, or you need to change the format of the image (like bitmap to jpg).
::Should I be storing images in SQL server anyway, some people say not??
Some people will also gladly tell you to kill yourself. Will you follow their advice, too?
Storing images in SQL Serverhas advantages and disadvantages. Disads are that SQL Server storage is more costly (in hosting), that operformance is lower (The file system IS faster) unless you manage to pull off some caching (not hard). Advantages are that you can use relational integrity, stuff like cascading delete etc. - basically it is pretty hard to accumulate garbage somewhere.|||That question is one of those which people always debate! Putting it in the database you gain referential integrity, but for much larger files you'll probably lose performance. For small stuff, putting them in the database is fine IMHO, disk is cheap and it keeps things tidy.
A.