hi guys i am having a problem with my pdf form. i have a cart that gives me all the items and a total for everything. i then create a pdf with this information by moving the cart items to a data table and then into a data grid on the pdf form. how would i also move the total value to the pdf form. i have been looking through many different examples but nothing works.
The subject of this thread is “search not working”, but your post doesn’t seem to have anything to do with not working searches.
Please create a new post with a new question, otherwise you are unlikely to get an answer.
Also, if you say “i have been looking through many different examples but nothing works”, you will get an answer that says “i found some that work”. Please include the code that you have tried, what it does that you don’t like and what would you like for it to do, and you will get an answer with working code and clear explanation.
so in the form that i am rendering as a pdf all the fields are showing up accept the total field. i see it if i open the form ,but on the download and emailed copy the total does not show up.
this is the cart form when you click checkout.
def checkout_button_click(self, **event_args):
"""This method is called when the button is clicked"""
source_text = self.total_label.text
open_form('PDF_FORM', source_text=source_text)
pdf = anvil.server.call('create_order_form_pdf', self.item)
anvil.media.download(pdf)
anvil.server.call('create_order_form_pdf', self.items)
anvil.server.call('send_pdf_email')
anvil.server.call('delete_table_rows', 'orders')
get_open_form().cart_items = []
get_open_form().cart_link_click()
Notification("Your order has been received!").show()
pass
this is the code in the pdf form that i am downloading.
self.repeating_panel_1.items = app_tables.orders.search()
if 'source_text' in properties:
self.total_label_pdf.text = properties['source_text']
user = anvil.users.get_user()
if user is not None:
self.name_box.text = user['name']
self.city_box.text = user['city']
self.homegroup_box.text = user['homegroup']
self.email_box.text = user['email']
self.phone_box.text = user['phone']
what i am trying to ask is there has to be a simple way to take the total from the cart page and put it onto the pdf. the code i just posted was the only thing that has come close to working. I just started with anvil and python just over 2 months now and it’s been a challenge.