Display image from file path in Crystal .NET Report

Discussion in 'ASP .Net' started by =?Utf-8?B?TWFyaw==?=, Dec 16, 2003.

  1. Hello all -

    I'm at wits end with trying to figure out why I'm having this problem since I followed the research, that I've dug up, to a "T". I'm trying to display a JPEG image from a path directory within a Crystal Report. I created a typed dataset that is not bound to the database called dsLogo and created one field within it that has a base64binary type for the image. Once I've incorporated the dataset into the report and dropped the control where I want the image to show, I populate the dataset using this code below but am still getting an error in relation to the Query Engine. What am I doing wrong? Any thoughts are GREATLY appreciated.

    ' Within code-behind file that contains the viewer for the report in the Page_Load event

    'Add row to Logo dataset
    Dim newLogoRow As DataRow
    Dim lLogo As New dsLogo
    newLogoRow = lLogo.Logo.NewLogoRow
    ' Session("LogoImage") contains path (i.e. \\webserv\wwwroot\site\images\site1.jpg)
    newLogoRow.Item("Image") = Session("LogoImage")
    lLogo.Logo.Rows.Add(newLogoRow)

    Thanks,

    Mark
     
    =?Utf-8?B?TWFyaw==?=, Dec 16, 2003
    #1
    1. Advertising

  2. I dont know Crystal Reports, but it looks to me like your trying to use a
    UNC file path when you probably need to use a html img tag.

    --
    Regards

    John Timney (Microsoft ASP.NET MVP)
    ----------------------------------------------
    <shameless_author_plug>
    Professional .NET for Java Developers with C#
    ISBN:1-861007-91-4
    Professional Windows Forms
    ISBN: 1861005547
    Professional JSP 2nd Edition
    ISBN: 1861004958
    Professional JSP
    ISBN: 1861003625
    Beginning JSP Web Development
    ISBN: 1861002092
    </shameless_author_plug>
    ----------------------------------------------

    "Mark" <> wrote in message
    news:...
    > Hello all -
    >
    > I'm at wits end with trying to figure out why I'm having this problem

    since I followed the research, that I've dug up, to a "T". I'm trying to
    display a JPEG image from a path directory within a Crystal Report. I
    created a typed dataset that is not bound to the database called dsLogo and
    created one field within it that has a base64binary type for the image.
    Once I've incorporated the dataset into the report and dropped the control
    where I want the image to show, I populate the dataset using this code below
    but am still getting an error in relation to the Query Engine. What am I
    doing wrong? Any thoughts are GREATLY appreciated.
    >
    > ' Within code-behind file that contains the viewer for the report in the

    Page_Load event
    >
    > 'Add row to Logo dataset
    > Dim newLogoRow As DataRow
    > Dim lLogo As New dsLogo
    > newLogoRow = lLogo.Logo.NewLogoRow
    > ' Session("LogoImage") contains path (i.e.

    \\webserv\wwwroot\site\images\site1.jpg)
    > newLogoRow.Item("Image") = Session("LogoImage")
    > lLogo.Logo.Rows.Add(newLogoRow)
    >
    > Thanks,
    >
    > Mark
     
    John Timney \(Microsoft MVP\), Dec 16, 2003
    #2
    1. Advertising

  3. Actually, I don't believe there is an option to incorporate an img tag within Crystal Reports .NET, from the best of my knowledge.

    Mark

    ----- John Timney (Microsoft MVP) wrote: -----

    I dont know Crystal Reports, but it looks to me like your trying to use a
    UNC file path when you probably need to use a html img tag.

    --
    Regards

    John Timney (Microsoft ASP.NET MVP)
    ----------------------------------------------
    <shameless_author_plug>
    Professional .NET for Java Developers with C#
    ISBN:1-861007-91-4
    Professional Windows Forms
    ISBN: 1861005547
    Professional JSP 2nd Edition
    ISBN: 1861004958
    Professional JSP
    ISBN: 1861003625
    Beginning JSP Web Development
    ISBN: 1861002092
    </shameless_author_plug>
    ----------------------------------------------

    "Mark" <> wrote in message
    news:...
    > Hello all -
    >> I'm at wits end with trying to figure out why I'm having this problem

    since I followed the research, that I've dug up, to a "T". I'm trying to
    display a JPEG image from a path directory within a Crystal Report. I
    created a typed dataset that is not bound to the database called dsLogo and
    created one field within it that has a base64binary type for the image.
    Once I've incorporated the dataset into the report and dropped the control
    where I want the image to show, I populate the dataset using this code below
    but am still getting an error in relation to the Query Engine. What am I
    doing wrong? Any thoughts are GREATLY appreciated.
    >> ' Within code-behind file that contains the viewer for the report in the

    Page_Load event
    >> 'Add row to Logo dataset

    > Dim newLogoRow As DataRow
    > Dim lLogo As New dsLogo
    > newLogoRow = lLogo.Logo.NewLogoRow
    > ' Session("LogoImage") contains path (i.e.

    \\webserv\wwwroot\site\images\site1.jpg)
    > newLogoRow.Item("Image") = Session("LogoImage")
    > lLogo.Logo.Rows.Add(newLogoRow)
    >> Thanks,
    >> Mark
     
    =?Utf-8?B?TWFyaw==?=, Dec 16, 2003
    #3
  4. Sorry Mark, should have made myself a bit clearer, as I said I'm not
    familiar with Crystal reports - but use an http path rather than a UNC path
    to an image instead and see if it makes a difference.

    Session("LogoImage") ="\site\images\site1.jpg";

    ....I could be barking up the wrong tree entirely, so ignore me if I am....

    --
    Regards

    John Timney (Microsoft ASP.NET MVP)
    ----------------------------------------------
    <shameless_author_plug>
    Professional .NET for Java Developers with C#
    ISBN:1-861007-91-4
    Professional Windows Forms
    ISBN: 1861005547
    Professional JSP 2nd Edition
    ISBN: 1861004958
    Professional JSP
    ISBN: 1861003625
    Beginning JSP Web Development
    ISBN: 1861002092
    </shameless_author_plug>
    ----------------------------------------------

    "Mark" <> wrote in message
    news:...
    > Actually, I don't believe there is an option to incorporate an img tag

    within Crystal Reports .NET, from the best of my knowledge.
    >
    > Mark
    >
    > ----- John Timney (Microsoft MVP) wrote: -----
    >
    > I dont know Crystal Reports, but it looks to me like your trying to

    use a
    > UNC file path when you probably need to use a html img tag.
    >
    > --
    > Regards
    >
    > John Timney (Microsoft ASP.NET MVP)
    > ----------------------------------------------
    > <shameless_author_plug>
    > Professional .NET for Java Developers with C#
    > ISBN:1-861007-91-4
    > Professional Windows Forms
    > ISBN: 1861005547
    > Professional JSP 2nd Edition
    > ISBN: 1861004958
    > Professional JSP
    > ISBN: 1861003625
    > Beginning JSP Web Development
    > ISBN: 1861002092
    > </shameless_author_plug>
    > ----------------------------------------------
    >
    > "Mark" <> wrote in message
    > news:...
    > > Hello all -
    > >> I'm at wits end with trying to figure out why I'm having this

    problem
    > since I followed the research, that I've dug up, to a "T". I'm

    trying to
    > display a JPEG image from a path directory within a Crystal Report.

    I
    > created a typed dataset that is not bound to the database called

    dsLogo and
    > created one field within it that has a base64binary type for the

    image.
    > Once I've incorporated the dataset into the report and dropped the

    control
    > where I want the image to show, I populate the dataset using this

    code below
    > but am still getting an error in relation to the Query Engine. What

    am I
    > doing wrong? Any thoughts are GREATLY appreciated.
    > >> ' Within code-behind file that contains the viewer for the report

    in the
    > Page_Load event
    > >> 'Add row to Logo dataset

    > > Dim newLogoRow As DataRow
    > > Dim lLogo As New dsLogo
    > > newLogoRow = lLogo.Logo.NewLogoRow
    > > ' Session("LogoImage") contains path (i.e.

    > \\webserv\wwwroot\site\images\site1.jpg)
    > > newLogoRow.Item("Image") = Session("LogoImage")
    > > lLogo.Logo.Rows.Add(newLogoRow)
    > >> Thanks,
    > >> Mark

    >
    >
    >
     
    John Timney \(Microsoft MVP\), Dec 17, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Wallace
    Replies:
    0
    Views:
    1,059
    James Wallace
    Oct 17, 2003
  2. =?Utf-8?B?SmFpZ2FuZXNo?=

    Reading report content using Crystal Report Viewer XI

    =?Utf-8?B?SmFpZ2FuZXNo?=, Jan 4, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,187
    =?Utf-8?B?SmFpZ2FuZXNo?=
    Jan 4, 2006
  3. Learner
    Replies:
    1
    Views:
    1,115
    Richard Dudley
    Jan 11, 2006
  4. anshu
    Replies:
    0
    Views:
    489
    anshu
    Aug 31, 2006
  5. Comfort
    Replies:
    0
    Views:
    552
    Comfort
    Oct 18, 2004
Loading...

Share This Page