Announcement

Migration of this forum

Dear users of this forum,

we are pleased to inform you that we will be updating the software behind this forum in the near future.

Existing posts, users and categories will remain untouched.

Important:

  • Each user will need to reset their password.
  • Please select "I forgot my password".
  • Enter the email address you used to register in this forum.
  • You will receive an email with a link to set a new password.
  • Please choose a new (secure) password and confirm the process.

We will keep you informed in the pinned thread.

Kind regards,
Your ReportServer Team


Migration des Forums

Liebe Nutzer dieses Forums,

wir freuen uns, euch mitteilen zu können, dass wir in naher Zukunft die Software hinter diesem Forum aktualisieren werden.

Existierende Beiträge, Nutzer und Kategorien bleiben weiterhin bestehen!

Wichtig:

  • Jeder Nutzer muss sein Passwort neu vergeben.
  • Wählt dazu einfach "Ich habe mein Passwort vergessen".
  • Gebt die E-Mail-Adresse ein, mit der ihr registriert seid.
  • Ihr erhaltet eine E-Mail mit einem Link zur Passwortvergabe.
  • Bitte wählt ein neues (sicheres) Passwort und bestätigt den Vorgang.

Wir halten euch im angepinnten Beitrag auf dem Laufenden!

Mit vielen Grüßen
Euer ReportServer Team

#1 2016-06-16 10:06:14

JohnZa
Member
Registered: 2016-06-16

Creating a URL from an ID and inserting an image from a url

I'm pretty new to Jasper ReportStudio and am creating numerous reports using this fabulous tool.

Right now I'm in the process of creating a report that will include images imported from a web server via HTTP
The image ID is in the format of an integer and is stored on a MySQL server combined with its date

eg
ID               DATE
136347339   2016-06-11 09:19:05

The url is created using the following function in ASP.NET

function getAutoGeneratedImageFile(sightingid, seperator)
dim f, n, p
    f = ""
    for n = 0 to 7                     'Eight bytes in a long int (each byte will be used as a folder name)
        p = cdbl(sightingid) mod 256        'Due to the possible large scale of the uid, we have to use these functions
          f = seperator & p & f
        sightingid = sightingid \ 256
    next
    f = f & ".jpg"
    getAutoGeneratedImageFile = f
end function

URL generated ends up in the form
HTTP://Imageserver/images/0/0/0/0/8/32/126/203.jpg


Can anyone help me out with adding a function in Jasper to create the URL and insert the image?

Regards,

John

Offline

#2 2016-06-16 12:02:15

Thomas Davies
datenwerke
Registered: 2016-05-18

Re: Creating a URL from an ID and inserting an image from a url

Hi John,

you can add custom functions to Jasper, but you would need to implement them in Java. A starting tutorial on how this may be done is given in

http://community.jaspersoft.com/wiki/ja … s-part-2-0

Alternatively you could probably do the computation with a JasperReports expression. This could be something along the lines

($F{ID} % 256) + "/" + (($F{ID}/256) % 256) + "/" + (($F{ID}/(256*2)) % 256) + "/" + (($F{ID}/(256*3)) % 256) ... ... + ".jpg"

Hope this helps.

Thomas

Offline

Board footer

Powered by FluxBB