Hi,
New to nuBuilder and find it one of the best web database builder around.
Hope someone could help me with this.
I am building a staff database.
I have pictures stored in MYSQL for each staff record.
For displaying picture in the edit record page, i have done successfully by modifying the SCimage code and display using image ID, ie
<img id="theimage" src="">
However I can't do the same in the report designer by using <img id="theimage" src=""> as label.
How can I have the picture of the employee for each record printed out in the report?
Example:
Employee Report
--------------------------
Employee 1 Name
Employee 1 Contact Number
Employee 1 Photo Image
--------------------------
Employee 2 Name
Employee 2 Contact Number
Employee 2 Photo Image
Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
display image stored in MYSQL in report
Re: display image stored in MYSQL in report
calvinp,
Although it hasn't been documented yet there is a way to do it.
create a field with a value of <img src='formimage.php?dir=db/sample&iid=149bf07777e6a0'>
with iid being the image's id
and run the report displaying that as a field
Hopefully that makes sense, but it will only work as a html report.
Its the way used to display the banner on the index page.
Steven
Although it hasn't been documented yet there is a way to do it.
create a field with a value of <img src='formimage.php?dir=db/sample&iid=149bf07777e6a0'>
with iid being the image's id
and run the report displaying that as a field
Hopefully that makes sense, but it will only work as a html report.
Its the way used to display the banner on the index page.
Steven
-
- Posts: 4
- Joined: Wed Mar 21, 2012 12:56 pm
Re: display image stored in MYSQL in report
Thanks Steven for your idea and quick reply. Hope you can help me further in details.
By putting <img src='formimage.php?dir=db/sample&iid=theimageid'> as HTML label in the record builder object, I will be calling only one image only and all records will be displaying the same picture ( which is not I want, as each employee record in the report should have their own picture displayed)
What I need is theimageid has to be a variable, which the report builder grab from blob entry of each record and display it.
In the edit record page I have JavaScript code
function nuLoadThis(){
document.getElementById('theimage').src=getImage_em(document.getElementById('recordID').value);
}
to call this.
I cannot seems to think of how since the report object label only accepts simple HTML with no variable code, and there is no JavaScript field i can place codes as report objects.
I am new to this and a bit amateur in the programming. Really hope you can help. How do I go about this?
Thanks again for your kind assistance.
By putting <img src='formimage.php?dir=db/sample&iid=theimageid'> as HTML label in the record builder object, I will be calling only one image only and all records will be displaying the same picture ( which is not I want, as each employee record in the report should have their own picture displayed)
What I need is theimageid has to be a variable, which the report builder grab from blob entry of each record and display it.
In the edit record page I have JavaScript code
function nuLoadThis(){
document.getElementById('theimage').src=getImage_em(document.getElementById('recordID').value);
}
to call this.
I cannot seems to think of how since the report object label only accepts simple HTML with no variable code, and there is no JavaScript field i can place codes as report objects.
I am new to this and a bit amateur in the programming. Really hope you can help. How do I go about this?
Thanks again for your kind assistance.
Re: display image stored in MYSQL in report
calvinp,
What I was suggesting was to use a field not a label.
Just the same way as you might create a field in #dataTable# for fullname by concatenating first and last names.
eg.
I hope this makes sense.
Steven
What I was suggesting was to use a field not a label.
Just the same way as you might create a field in #dataTable# for fullname by concatenating first and last names.
eg.
Code: Select all
SELECT employee.*, CONCAT("<img src='formimage.php?dir=db/sample&iid=",cus_image_id, "theimageid'>") AS their_head FROM employee
I hope this makes sense.
Steven
-
- Posts: 4
- Joined: Wed Mar 21, 2012 12:56 pm