BIRT Exchange Forum: Update data after click - BIRT Exchange Forum

Jump to content


 

No Latest Open Poll.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Update data after click Rate Topic: -----

#1 User is offline   charas Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 27-June 12


Posted 28 June 2012 - 12:53 AM

Hello Birt-community!

This is my first post here ^_^ . I searched a long time for my problem, but didn't find anything.

So here is my question.

I have a Table in my db2 database: Example: Customername (string) | isListed (bool)

In my Birt-report is a data-field which is simultaneously a hyperlink (the hyperlink shows the boolean value of each customer.

Example:

Peter | Yes
John | No

If i press the hyperlink, the value in the database is changing from Yes to No and vice versa.
This works fine. Now my question: Is it possible to refresh only the hyperlink (after clicking it) without reloading the whole report?

Example: Peter | Yes -> clicking hyperlink 'Yes' -> Peter | No

I hope you understand my problem =)
If there is no possibility, how i can reload my birt -report after clicking the hyperlink?

Best regards and thank you for your help!
0

#2 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 12953
  • Joined: 16-May 08


Posted 28 June 2012 - 08:17 AM

You could probably make yes and no links for all names and then use client side javascript in html script tags in a text control to switch which one is visible on click. If you'd like me to try to make you an example, let me know your BIRT version.
Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
0

#3 User is offline   charas Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 27-June 12


Posted 30 June 2012 - 07:39 AM

Hi again,
thank you for the reply! Do you think it's the only solution? I tried something with a textbox. I binded the boolean value to the html button - this works fine! Now i tried with javascript to start my php script. This works also, but somethin strange happend. I called the script with "windop.location.href" - the problem is, that my php script is opening in my birt - window! I tried other ways to open it in an seperate window. Strange: in the seperate window my php file doesn't work correct. After starting the php file i reload the birt page also - this is working also.

Is there a possibility to go this way?

regards charas


EDIT: I solved it now with a complete refresh of the report - HTML with Javascript. Works fine!

If I find some time, i will try your idea also.

Tanks for the help!
0

#4 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 12953
  • Joined: 16-May 08


Posted 02 July 2012 - 12:10 PM

So, you're just refreshing the entire report now, each time? Tell me your version and I'll make you a sample. :)
Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
0

#5 User is offline   johnw Icon

  • Senior Member
  • View blog
  • Group: Members
  • Posts: 712
  • Joined: 08-May 08


Posted 02 July 2012 - 12:35 PM

You should be able to use just Javascript and update the innerHtml element of the Hyperline. So give the Hyperlink a Bookmark, then use document.findElementById in Javascript. Just old school HTML/Javascript should work. You should only need to change the value.
0

#6 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 12953
  • Joined: 16-May 08


Posted 02 July 2012 - 12:44 PM

That's what I was going to do in the example I'd have made, John! :)
Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
0

#7 User is offline   charas Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 27-June 12


Posted 04 July 2012 - 06:22 AM

View Postmwilliams, on 02 July 2012 - 01:44 PM, said:

That's what I was going to do in the example I'd have made, John! :)



That would be very helpfull! Thank you =)

kind regards
0

#8 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 12953
  • Joined: 16-May 08


Posted 06 July 2012 - 07:40 AM

charas,

What's your BIRT version?
Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
0

#9 User is offline   charas Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 27-June 12


Posted 08 July 2012 - 11:16 PM

View Postmwilliams, on 06 July 2012 - 08:40 AM, said:

charas,

What's your BIRT version?



Here is my Birt-Version: 3.2.22

regards charass
0

#10 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 12953
  • Joined: 16-May 08


Posted 10 July 2012 - 12:49 PM

Take a look at this simple example.

Attached File(s)


Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
0

#11 User is offline   charas Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 27-June 12


Posted 11 July 2012 - 12:30 AM

Hi again!

Thank you for the example. I will try it in the next few days.

Kind regards
0

#12 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 12953
  • Joined: 16-May 08


Posted 11 July 2012 - 06:38 AM

Sounds good. Let me know if you have questions.
Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
0

#13 User is offline   charas Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 27-June 12


Posted 12 July 2012 - 03:43 AM

I tried it out.

The link shows me first the correct value of the Dataset - "No". After clicking the value is changing to true than false and so on.

Usually this link should show us the values from the Database (No/Yes). I try to explain the problem:

I start the report -> the first shown value of the link is 'No' (because there is no User in that table called for example "Andrew") - that's correct. Now I am pressing the link. Immediately the value from the link is changing from No to true and a new window opened - the php script is starting. Usually the value of the link should change AFTER the php script finished. So the DataSet has to be refreshed also.
The link usually should show us "Yes" after clicking (because now "Andrew" is listed in that table - the php script added "Andrew" into that table). Instead to change the value from "No" to "Yes" it has the value "true". If I'm clicking it again, the php script deletes "Andrew" from the table - now the value of the link should be "No" instead the value is false.

So the value of the link is changing only from true to false and vice versa - the output from the Dataset doesn't matter.

I hope everybody understand my problem. :huh:

Kind regards
0

#14 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 12953
  • Joined: 16-May 08


Posted 13 July 2012 - 10:01 AM

I was just showing how to change the displayed value in your report without re-running it. If the code you have to change the db value works correctly on click, then the same value should be in the report and what is in the db. I used true and false, in my script. You'd just need to change it to yes and no. Maybe I'm misunderstanding your issue.
Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
0

#15 User is offline   charas Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 27-June 12


Posted 14 July 2012 - 08:33 AM

View Postmwilliams, on 13 July 2012 - 11:01 AM, said:

I was just showing how to change the displayed value in your report without re-running it. If the code you have to change the db value works correctly on click, then the same value should be in the report and what is in the db. I used true and false, in my script. You'd just need to change it to yes and no. Maybe I'm misunderstanding your issue.



Hi again =)

The button/link which shows us Yes/No or True/False, should get this information from a table in my database. If you click on that button/link, there is a php script which is changing this value in my database. In the same time the link/button should get the new value from the database - not just switching from "Yes" to "No" or vice versa. Usually the report gets data while it's loading. But in my case the report should only reload one dataset (the dataset which get the data of the table i mentioned before) when the link/button was clicked and renew the value of that link/button.

Kind regards
0

#16 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 12953
  • Joined: 16-May 08


Posted 16 July 2012 - 09:19 AM

To not reload the report, but to get the data from your database, you'd probably have to do an AJAX call, or something. Take a look at this link.

http://www.w3schools...ax_database.asp
Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users