peterhanse Posted June 16, 2016 Report Share Posted June 16, 2016 Hi all, Is it possible to process HTML in an Calculated Field. In the code below, I would like to change the text in an image. CASE WHEN [@field:PAARD_KOPPELINGEN_soort_koppeling]= 1 THEN 'Ruiter/Verzorger koppeling: [@field:GEBRUIKERS_volledige_naam]' ELSE 'Stal medewerker koppeling: [@field:STAL_GEGEVENS_stalnaam]' END Regards Peter Quote Link to comment Share on other sites More sharing options...
MayMusic Posted June 17, 2016 Report Share Posted June 17, 2016 That should be working when [@field:STAL_GEGEVENS_stalnaam] and [@field:GEBRUIKERS_volledige_naam] are text fields. What are you getting on your report? Quote Link to comment Share on other sites More sharing options...
peterhanse Posted June 17, 2016 Author Report Share Posted June 17, 2016 Hi Maymusic, this are text fields, and it works fine. but i would like to replace them for a image. I think i have found the answer in this topic I have to use a html block Quote Link to comment Share on other sites More sharing options...
wvantongeren Posted June 17, 2016 Report Share Posted June 17, 2016 peter, hoe heb je dat gedann? Quote Link to comment Share on other sites More sharing options...
MayMusic Posted June 17, 2016 Report Share Posted June 17, 2016 You need to have JS to do it for you Quote Link to comment Share on other sites More sharing options...
peterhanse Posted June 25, 2016 Author Report Share Posted June 25, 2016 Tanks MayMusic, This has become the solution <script> var pksoork='[@field:PAARD_KOPPELINGEN_soort_koppeling]'; var gbrvnaam='[@field:GEBRUIKERS_volledige_naam]'; var pkusid='[@field:PAARD_KOPPELINGEN_user_id_koppeling]'; var userid='[@authfield:GEBRUIKERS_user_id]'; var peid='[@field:PAARDEN_eigenaar_id]'; var sgstnaam='[@field:STAL_GEGEVENS_stalnaam]'; if(pksoork==1) { document.write('<IMG SRC="https://horseplanner.nl/wp-content/uploads/2016/06/paard-icon.png" ALT="logboek" WIDTH="30" HEIGHT="24" ALIGN="center"></A><br />[@field:GEBRUIKERS_volledige_naam]'); } else if(pksoork==2&&pkusid==userid) { document.write('<IMG SRC="https://horseplanner.nl/wp-content/uploads/2016/06/stal-icon-e1466102511312.png" ALT="logboek" WIDTH="30" HEIGHT="24" ALIGN="center"></A><br />[@field:GEBRUIKERS_volledige_naam]'); } else if(pksoork==3&&peid==userid) { document.write('<IMG SRC="https://horseplanner.nl/wp-content/uploads/2016/06/ruiter_icon.png" ALT="logboek" WIDTH="30" HEIGHT="24" ALIGN="center"></A><br />'); } else { document.write('<IMG SRC="https://horseplanner.nl/wp-content/uploads/2016/06/stalmedewerker-icon-e1466255481754.png" ALT="logboek" WIDTH="40" HEIGHT="24" ALIGN="center"></A><br />[@field:STAL_GEGEVENS_stalnaam]'); } </script> Quote Link to comment Share on other sites More sharing options...
MayMusic Posted June 28, 2016 Report Share Posted June 28, 2016 Thanks for sharing Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.