Source language: Translate to:

Can I export images inside the dbpExportToHTML command?

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Can I export images inside the dbpExportToHTML command?

Postby WinMacLyn » Mon Jan 21, 2013 4:56 pm

Can I export images inside the dbpExportToHTML command?
All images are located locally on the same PC.

Thanks in advance to anyone that can help me with this question.
If you do things with love, passion and common sense everything in life will be returned to you the same way.
User avatar
WinMacLyn
 
Posts: 110
Joined: Wed Jan 17, 2007 7:30 pm

Re: Can I export images inside the dbpExportToHTML command?

Postby Neosoft Support » Wed Jan 23, 2013 11:33 am

I'm sorry, the dbpExportToHTML action does not export picture fields. You could probably do it manually by going through the records one-by-one and using FileWrite to build the HTML code and dbpExportBlob to extract the images.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Can I export images inside the dbpExportToHTML command?

Postby WinMacLyn » Wed Jan 23, 2013 2:51 pm

Thank you for your reply.

I have many lines of information including the need of an image on each line.

How can I implement your suggestion if the images needed have to appear on the same line with other information from the access database?
Please can you write a sample code showing how to do this?

Thank you in advance.
If you do things with love, passion and common sense everything in life will be returned to you the same way.
User avatar
WinMacLyn
 
Posts: 110
Joined: Wed Jan 17, 2007 7:30 pm

Re: Can I export images inside the dbpExportToHTML command?

Postby Neosoft Support » Thu Jan 24, 2013 11:29 am

I'm sorry, I don't have time to write a full example for you, but here's something to get you started:

Code: Select all
.write html header to file
FileWrite "[PubDir]export.html" "All" "<html>[#13]<head>[#13]<title>New Page 1</title>[#13]</head>[#13]<body>[#13]"

.start html table
FileWrite "export.html" "Append" "<table border="1" width="100%">[#13]"

.loop through database and export data
dbpFirst "MyDB" "Table1"
Loop "1" "[MyDB.Table1.$RecCount]" "[Count]"
  .start new table row
  FileWrite "[PubDir]export.html" "Append" "<tr>[#13]"

  .export picture field from database
  dbpExportBlob "MyDB" "Table1" "Photo" "[PubDir]Photo[Count].jpg"

  .write table columns: firstname, lastname, photo
  FileWrite "[PubDir]export.html" "Append" "<td>[MyDB.Table1.FirstName]</td>[#13]<td>[MyDB.Table1.LastName]</td>[#13]<td><img src=[#34]Photo[Count].jpg[#34]></td>[#13]"

  .end table row
  FileWrite "[PubDir]export.html" "Append" "</tr>[#13]"

  dbpNext "MyDB" "Table1"
EndLoop

.end html table
FileWrite "[PubDir]export.html" "Append" "</table>[#13]"

.finish html file
FileWrite "export.html" "Append" "</body>[#13]</html>"
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest