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

Tuesday, March 27, 2012

Change Image using parameter

I need to change the logo on my reports according to a parameter that I pass from VB.NET.

What is the best way to load the image into the report?

I have attempted to use a dataset:

I created a logo field in my dataset
I loaded the correct image in VB.NET
I then assigned the 'logo' field in the dataset to this image

My problem is that I don't know what the data type of the logo field should be - I have created the dataset manually and the images are not in a database.

This is my code:

'Load image into ByteArray
Dim fs As New System.IO.FileStream("C:\temp\test.jpg", IO.FileMode.Open)
Dim nBytes As Integer = fs.Length
Dim ByteArray(nBytes) As Byte
Dim nBytesRead As Integer = fs.Read(ByteArray, 0, nBytes)
fs.Read(ByteArray, 0, Convert.ToInt32(fs.Length.ToString(), 10) - 1)

'Set logo field to this image
Dim tbl As New mySchemas.myDataTable
Dim rw As DataRow = tbl.NewRow
rw("logo") = ByteArray 'AN ERROR OCCURS ON THIS LINE
tbl.Rows.Add(rw)
Dim ds As New DataSet
ds.Tables.Add(tbl)

Is this the best way to do load an image into crystal? If so what should the datatype of the logo field be in the dataset? I tried Byte but that did not work.

Thanks for any help
ElaineElaine,
I'll preface this by saying: I don't use CR10, and don't use .NET with CR.
From your code you are declaring a row object to hold the picture.
Shouldn't you be using a "field" object, or whatever the .NET equivalent is?
Field type should be OLE Object/BLOB(BinaryLargeOBject)/BitStream or similar.

Dave|||Thanks for your reply Dave. All sorted now.

The data type I needed turned out to be 'hexbinary'
Incase anyone has the same problem this is the solution:

Dim data As New DataSet()
Dim row As DataRow

data.Tables.Add("Images")
data.Tables(0).Columns.Add("img", System.Type.GetType("System.Byte[]"))

Dim fs As New FileStream("C:\test.jpg", FileMode.Open)
Dim br As New BinaryReader(fs)

row = data.Tables(0).NewRow()
row(0) = br.ReadBytes(br.BaseStream.Length)
data.Tables(0).Rows.Add(row)

br.close
fs.close

br = Nothing
fs = Nothing

' CrystalReport1 is a strongly typed report created in Visual Studio.
Dim cr As New CrystalReport1()
cr.SetDataSource(data)
CrystalReportViewer1.ReportSource = cr|||Are you using the version of crystal reports that came with visual net??
I create the typed dataset with a field hexBinary and load the pictur there but how can I put that picture in the report it shows as a number and no image apearssql

Change image properties at runtime

Hi,
I'm using Reporting Services for SQL2K. My report will need to dynamically
call a custom assembly for each row in a dataset, and then show the image
file that the custom assembly creates. I was thinking of using an Image
control in the report and then changing the path to the image file at
runtime. But I can not figure out how to access the image1.Value property.
Any tips on this or perhaps an alternative solution?
TIA
JonasI found the answer, and it was very easy ;-)
When the control is selected in the Report Designer, it it possible to edit
the properties as usual. The property for Value can also use an Expression,
and voila, this can point to a variable which contains a dynamically created
path.
Brgds
Jonas
"Jonas" <Jonas@.nospam.pl> wrote in message
news:%23z53z3cHGHA.240@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I'm using Reporting Services for SQL2K. My report will need to dynamically
> call a custom assembly for each row in a dataset, and then show the image
> file that the custom assembly creates. I was thinking of using an Image
> control in the report and then changing the path to the image file at
> runtime. But I can not figure out how to access the image1.Value property.
> Any tips on this or perhaps an alternative solution?
> TIA
> Jonas
>
>

Change Image

I'm using Crystal Report 7 ,use storc prcdure n vb 6. my prblem : let say in my system have company and their staff. how can i display one company and their staffname+ their picture. e.g: company A and their staff photo will appear n for cmpny B their staff photo will appear. means that the staff photo will appear based on their company.tnkiu..I'm using Crystal Report 7 ,use storc prcdure n vb 6. my prblem : let say in my system have company and their staff. how can i display one company and their staffname+ their picture. e.g: company A and their staff photo will appear n for cmpny B their staff photo will appear. means that the staff photo will appear based on their company.tnkiu..

simple sort the data by company name|||I'm using Crystal Report 7 ,use storc prcdure n vb 6. my prblem : let say in my system have company and their staff. how can i display one company and their staffname+ their picture. e.g: company A and their staff photo will appear n for cmpny B their staff photo will appear. means that the staff photo will appear based on their company.tnkiu..

Just sort the data by company name|||what do you mean by sort data by company name?

Change height of image control

Is it possible to use an iif statement to set the height of an image
control. I have tried something like this, but it did not work:
iif(Parameters!parm < 20,1.5in,.5in). I also tried putting double quotes
around the 1.5in and .5in, but that didn't work either.
Thanks,On Jun 1, 9:33 am, "Tim Kelley" <tkel...@.company.com> wrote:
> Is it possible to use an iif statement to set the height of an image
> control. I have tried something like this, but it did not work:
> iif(Parameters!parm < 20,1.5in,.5in). I also tried putting double quotes
> around the 1.5in and .5in, but that didn't work either.
> Thanks,
As far as I know, it is not possible. Why are you needing to adjust
the image size? Are you trying to swap images?
Enrique Martinez
Sr. Software Consultant|||I have a subreport that will have a varying amout of lines. I have a bitmap
I am using for a border and would like to grow or shrink the bitmap based on
how many lines are in the subreport. I will probably need to resize the
subreport control too if that is possible.
"EMartinez" <emartinez.pr1@.gmail.com> wrote in message
news:1180742850.339314.203650@.q69g2000hsb.googlegroups.com...
> On Jun 1, 9:33 am, "Tim Kelley" <tkel...@.company.com> wrote:
>> Is it possible to use an iif statement to set the height of an image
>> control. I have tried something like this, but it did not work:
>> iif(Parameters!parm < 20,1.5in,.5in). I also tried putting double quotes
>> around the 1.5in and .5in, but that didn't work either.
>> Thanks,
>
> As far as I know, it is not possible. Why are you needing to adjust
> the image size? Are you trying to swap images?
> Enrique Martinez
> Sr. Software Consultant
>|||On Jun 4, 7:37 am, "Tim Kelley" <tkel...@.company.com> wrote:
> I have a subreport that will have a varying amout of lines. I have a bitmap
> I am using for a border and would like to grow or shrink the bitmap based on
> how many lines are in the subreport. I will probably need to resize the
> subreport control too if that is possible.
> "EMartinez" <emartinez...@.gmail.com> wrote in message
> news:1180742850.339314.203650@.q69g2000hsb.googlegroups.com...
> > On Jun 1, 9:33 am, "Tim Kelley" <tkel...@.company.com> wrote:
> >> Is it possible to use an iif statement to set the height of an image
> >> control. I have tried something like this, but it did not work:
> >> iif(Parameters!parm < 20,1.5in,.5in). I also tried putting double quotes
> >> around the 1.5in and .5in, but that didn't work either.
> >> Thanks,
> > As far as I know, it is not possible. Why are you needing to adjust
> > the image size? Are you trying to swap images?
> > Enrique Martinez
> > Sr. Software Consultant
You might be able to achieve the same result via a border style in a
header of the subreport, etc. As far as I know, resizing the subreport
may not be feasible. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||Would it be possible to move the subreport or other controls on the report?
Tim
"EMartinez" <emartinez.pr1@.gmail.com> wrote in message
news:1180998091.389326.168520@.o5g2000hsb.googlegroups.com...
> On Jun 4, 7:37 am, "Tim Kelley" <tkel...@.company.com> wrote:
>> I have a subreport that will have a varying amout of lines. I have a
>> bitmap
>> I am using for a border and would like to grow or shrink the bitmap based
>> on
>> how many lines are in the subreport. I will probably need to resize the
>> subreport control too if that is possible.
>> "EMartinez" <emartinez...@.gmail.com> wrote in message
>> news:1180742850.339314.203650@.q69g2000hsb.googlegroups.com...
>> > On Jun 1, 9:33 am, "Tim Kelley" <tkel...@.company.com> wrote:
>> >> Is it possible to use an iif statement to set the height of an image
>> >> control. I have tried something like this, but it did not work:
>> >> iif(Parameters!parm < 20,1.5in,.5in). I also tried putting double
>> >> quotes
>> >> around the 1.5in and .5in, but that didn't work either.
>> >> Thanks,
>> > As far as I know, it is not possible. Why are you needing to adjust
>> > the image size? Are you trying to swap images?
>> > Enrique Martinez
>> > Sr. Software Consultant
>
> You might be able to achieve the same result via a border style in a
> header of the subreport, etc. As far as I know, resizing the subreport
> may not be feasible. Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>

Wednesday, March 7, 2012

Change "Report is being generated" text

Is there a way to modify or suppress the "Report is being generated" text and
image? I am trying to setup reports in the Report Viewer webpart on a
Sharepoint site (Sharepoint 2007, SQL Server 2005 SP2, Reporting Services in
Sharepoint integrated mode), but do not want the user to see that message.
Any suggestions?
Thanks!
dawI think that I answered my own question in this scenario. There is an
Asynchronous Rendering checkbox in the properties of the webpart. That seems
to solve it.
I would be interested to know if there is a way to do this outside of
Sharepoint. I'm not a programmer, so it may be something obvious.
Thanks!
daw
"daw" wrote:
> Is there a way to modify or suppress the "Report is being generated" text and
> image? I am trying to setup reports in the Report Viewer webpart on a
> Sharepoint site (Sharepoint 2007, SQL Server 2005 SP2, Reporting Services in
> Sharepoint integrated mode), but do not want the user to see that message.
> Any suggestions?
> Thanks!
> daw

Friday, February 24, 2012

center images?

Hi,

maybe it's just me, but does anyone know how I can automatically center a dynamic image in a cell?
This is about a KPI image, so one that's loaded based on the status of the KPI. I would like to have that image centered, and not (like it's now) aligned to the left of the cell.

Anyone?

Have a look at this:

http://blogs.msdn.com/chrishays/archive/2004/10/27/CenteredImages.aspx

Center image

Hello,
is it possible to center an image on a report (RS 2000)?
regards
Wim Kunz
www.caesar.nlwell like in old HTML u can insert into table...
"Wim Kunz" wrote:
> Hello,
> is it possible to center an image on a report (RS 2000)?
> regards
> Wim Kunz
> www.caesar.nl
>