Showing posts with label visual. Show all posts
Showing posts with label visual. Show all posts

Wednesday, March 28, 2012

Images on a report

Hi being new to reporting services this is probably simple, so here goes.

Using Visual Studio 2005 to create the report. I have a SQLExpress db.

In the Product table that I want to run the report on there is a field called ImageName it contains the image filename e.g CanonIXUS.jpg

and I have a directory with all the images in it.

So how do I get the report writer to show the Image for the product in the row?

Thanks

Please check the documentation:
http://msdn2.microsoft.com/en-us/library/ms156482(SQL.90).aspx

In your case, it sounds like you want to add an "external" image where you will need to dynamically construct the path with an expression.

-- Robert

|||

Hi,

Thanks for that.

However all the documentation talks of an image wizard and various properties when you drag an image control onto a report.

Unfortunatly after adding a report (test.rdlc) to my VS2005 project none of these options seem to be available to me. I can easily display data but I don't have a place to select the various properties for an image eg. "external" .

Any Ideas ?

|||

You can use the VS property browser to set the image properties. To set the source of an image to "external", select the image, go to the Properties window and locate the Source property.

-Albert

Images on a report

Hi being new to reporting services this is probably simple, so here goes.

Using Visual Studio 2005 to create the report. I have a SQLExpress db.

In the Product table that I want to run the report on there is a field called ImageName it contains the image filename e.g CanonIXUS.jpg

and I have a directory with all the images in it.

So how do I get the report writer to show the Image for the product in the row?

Thanks

Please check the documentation:
http://msdn2.microsoft.com/en-us/library/ms156482(SQL.90).aspx

In your case, it sounds like you want to add an "external" image where you will need to dynamically construct the path with an expression.

-- Robert

|||

Hi,

Thanks for that.

However all the documentation talks of an image wizard and various properties when you drag an image control onto a report.

Unfortunatly after adding a report (test.rdlc) to my VS2005 project none of these options seem to be available to me. I can easily display data but I don't have a place to select the various properties for an image eg. "external" .

Any Ideas ?

|||

You can use the VS property browser to set the image properties. To set the source of an image to "external", select the image, go to the Properties window and locate the Source property.

-Albert

sql

Images From Sql Database

I have a database in sql server with a table containing a few images stored as binary data and there unique ids. From a Visual Basic.NET Application I want to use the crystal report to display 1 of the images based on the id that it is fed. How can I read and image from the sql database and display it in a Crystal Report? Any help offered is greatly appreciated.I've used a stored procedure to get the images from db and then add the blob field to the report. problem is that the wizard "enter parameter value" keeps prompting while you're going to drag the blob to your report. I still haven't find a solution for this problem.|||Just drag the blob column to report and go to preview mode and check if it is displaying the image|||I too have the same problem But in the case of Auto cad images(*.dwg)

I am saving the image in image field (SQL server) in binary format

Is there any solution for that?

Reply as much as earlier!|||What is the error you get?|||While adding the image field(SQL server) in crystal report,it doesn't showing any error

But

1.If the image format other than autocad(*.dwg) then it is showing the image as it is.

2.But in the case of autocad image it doesn't showing anything the field space would be blank.

If anyone guide me for this prob,please help me out

My project has been delayed because of this problem

Lingeswaran.r|||Hi all
I have some problem load image to Crytal Report 11

I have database from sql Server. The Columns Images after.
The column
Column name Data Type Length Allownulls
Picture varchar 50 *

After i save to database is

image\picture.jpg.

When i drag the column to Crystal Report 11 it have only is image\picture.jpg.
Can you help me ?
Display the picture.jpg is a picture
Thank you.|||Hi,
I had face the problem in Sql server with CrystalReports11 at Visual studio2005. By doing the following way you can solve the problem.

Let assume table "Item_t" having "ItemPicture'' column and its datatype is "Image'' and assume picture is stored in that table.

fecth the picture data to a datatable.

Let assume the picture is in dtItem & write the following method

private DataTable ConvertPicture(DataTable dtItem)
{
DataTable dtReturn = dtItem.Clone();

foreach (DataRow dRow in dtItem.Rows)
{
DataRow drRow = dtReturn.NewRow();

// Convert the picture into binary format

Byte[] bPictureInByte = (Byte[])dtItem.Row["ItemPicture''];
System.IO.MemoryStream mStream = new System.IO.MemoryStream(bPictureInByte ); // convert as stream
Bitmap pictureBimap= new Bitmap(mStream);//store in a Bitmap

// save the picture data in Local harddisk as .jpg file
pictureBimap.Save("C:\\temp\\Itempicture.Jpg", System.Drawing.Imaging.ImageFormat.Jpeg);

//Read the same jpg Picture from your Local harddisk
System.IO.FileStream fs = new System.IO.FileStream("C:\\temp\\Itempicture.Jpg", System.IO.FileMode.Open);
System.IO.BinaryReader br = new System.IO.BinaryReader(fs);

//convert to byte[] & save in your new data row
drRow = br.ReadBytes((int)br.BaseStream.Length);
br.Close();

//add the datarow to the datatable dtReturn;

dtReturn.Rows.add(drRow);

}

return dtReturn

}

now you passing the dtReturn data table to your .rpt file and print the Image.

Best wishes|||But now i don't want to Write a picture into the SQL Server
I only want write a link of it.
Example: image\picture_name.jpg
After that i load into Crytal Report.
How I can to do it ?
You can help me ?

If i write to sql server is no proplem.|||Hi all,
I want to display image in report but I can't. The following is what I do.
I create a report in C#.NET 2003, using CR XI. Data is stored in SQL Server 2005, and I store image as BLOB field. I design by drag and drop fields into report. In my code, I connect to database, get mydataset by executing a sql string, and then using rpt.SetDataSource(mydataset). All data in text field is ok but image field is empty.
Anybody help me, please.|||I know why I can't display image in report now. A simple reason is the aslias name of image field in sql statement and the image field name in my report are different.

But now I don't understand the reason why sometimes I can 't drag image field from tree view into report. Anybody know?

Monday, March 26, 2012

Image Storing In SQL Server 2000

HI,

Kindly Guide me how to store picture files in SQL server 2000 using Visual studio 2005

In your database design, make space for a field of type text.

When you work with the images, serialize them into a string and insert the string into the DB. When you retrieve the string, you have to convert it from string to an image.

Have a look at those two methods:

public static string ImageToString(System.Drawing.Image img) { MemoryStream ms =new MemoryStream(); img.Save(ms, img.RawFormat);byte[] array = ms.ToArray();return Convert.ToBase64String(array); }public static System.Drawing.Image StringToImage(string imageString) {if (imageString ==null)throw new ArgumentNullException("imageString");byte[] array = Convert.FromBase64String(imageString); System.Drawing.Image img = System.Drawing.Image.FromStream(new MemoryStream(array));return img; }

|||
Public Shared Function ImageToString(ByVal imgAs System.Drawing.Image)As String Dim msAs MemoryStream =New MemoryStream() img.Save(ms, img.RawFormat)Dim array()As Byte = ms.ToArray()Return Convert.ToBase64String(array)End Function Public Shared Function StringToImage(ByVal imageStringAs String)As System.Drawing.ImageIf imageStringIs Nothing Then Throw New ArgumentNullException("imageString")End If Dim array()As Byte = Convert.FromBase64String(imageString)Dim imgAs System.Drawing.Image = System.Drawing.Image.FromStream(New MemoryStream(array))Return imgEnd Function
In VB.NET this should do the trick:

I found this language conversion tool, in case you need it for later use:http://www.dotnetspider.com/convert/

Please mark my post as anwer if it solves your issue.

|||

Thanks

Reagrds

Fakhruddin

Monday, March 19, 2012

I'm unable to install SQL SERVER 2005 develop ed. and VISUAL STUDIO 2005

I'm unable to install SQL SERVER 2005 develop ed. and VISUAL STUDIO 2005 in
the same computer.
I have tried to install several times from different ways and all was with
error.
I understand that I have to uninstall all previous versions os SQL and VS. I
done it.
I understand that first I have to install is SQL Server and after VS
selecting "custom" installation choice and deselecting the last entry in the
list: "Express Edition of SQL Server"
Doing so, I have installed SQL SERVER sucessfully. But, when tried to
install VS the Window's installation disappear without tellling nothing. No
error, no message. Don't arrive to the installation options !
Please, someone could give some help ?
Thanks!
hi,
3Dfelix wrote:
> I'm unable to install SQL SERVER 2005 develop ed. and VISUAL STUDIO
> 2005 in the same computer.
> I have tried to install several times from different ways and all was
> with error.
> I understand that I have to uninstall all previous versions os SQL
> and VS. I done it.
> I understand that first I have to install is SQL Server and after VS
> selecting "custom" installation choice and deselecting the last entry
> in the list: "Express Edition of SQL Server"
> Doing so, I have installed SQL SERVER sucessfully. But, when tried to
> install VS the Window's installation disappear without tellling
> nothing. No error, no message. Don't arrive to the installation
> options !
personally I did the opposit way... first VS2005 and then SQL Server 2005..
with no problem at all...
ok, this has been done on a "clean" box, that's to say on a box without
"beta" of "2005" tools (SQL or VS) installed...
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.bizhttp://italy.mvps.org
DbaMgr2k ver 0.20.0 - DbaMgr ver 0.64.0 and further SQL Tools
-- remove DMO to reply

Sunday, February 19, 2012

IID_IDBInitialize interface of sql mobile 2005 problem in VisualStudio2005

Opening a connection to the database in Visual Studio 2005 and while closing the connection donot release the IID_IDBInitialize interface ,properties and not Uninitialising.

Try to open database file using CFile to check existence.

Works perfectly using sqlce2.0 & evc4.0 project.

After upgrading the above project to Visual Studio 2005

Same CFile open method fails at run time

But if close the connection completely i.e. close the IID_IDBInitialize interface also .Then it works perfectly in Visual Studio 2005.

Is there any change in IID_IDBInitialize interface of sql mobile 2005 ?

SQL Mobile *REALLY* commits the changes to DISK FILE at a default flush interval of 10 seconds. So, may be the database might have been created in RAM and is yet to be flushed to DISK and with in this flush interval, you might hit this problem.

Thanks,

Laxmi Narsimha Rao ORUGANTI, SQL Server Everywhere, Microsoft Corporation

|||

of course, this default interval (for commit transaction) could be changed and you could ask the SQL CE 3.0 engine to flush in real time (what we do in our development)


HTH,
Fabien.