Hi,
I am planning to design a form and the value enter in the form will be stored in the data table and finally i want to download/print those data in report as PDF. can you share me some example for this ?
Hi @yuvarajan1989 ,
I can get you part of the way there.
Here is an app that takes a number entered into a text box and passes it to a data table. After that you can download the data table as an html file.
app to copy
what you see
Generally speaking, if you want to increase the chances that your question will receive help you may want to keep these guidelines in mind:
Welcome to the Q&A Forum!
Help each other by asking questions about Anvil, and answering other people’s.
Post each question as a new topic - and if someone helps you, don’t forget to say thank-you. Try to provide information to help people answer your questions:
Be specific about what you’re trying to do.
Be specific about what your problem is (eg what’s not working), and what you have already tried.
Include code samples if you can.
It often helps if you can share your app’s source code and …
1 Like
shaun
February 6, 2019, 9:46am
3
Hi @yuvarajan1989 ! Have you seen this thread? It might help you with creating PDF files.
Hi Niels,
The following examples work for me in Python 3:
# trying PyPDF2
@anvil.server.callable
def test_pdf_read():
pdf_bytes = app_files.foo.get_bytes()
# Create a BytesIO object that can be used directly as a file
file = io.BytesIO(pdf_bytes)
pdfReader = PyPDF2.PdfFileReader(file)
print(pdfReader.numPages)
# trying FPDF
@anvil.server.callable
def make_pdf():
pdf = FPDF()
pdf.add_page()
pdf.set_font('Arial', 'B', 16)
pdf.cell(40, 10, 'Hello World!')
byte_string = pd…
1 Like