Page 1 of 2

Printing from a page

Posted: Tue Jul 16, 2013 6:46 am
by Deon

Hi.

I want to pull data from the db and display it to a page. Once displayed I need to print the displayed information.

  1. What is the best way to display the data? Though a List? There will be a few records.

  2. Once displayed how would I print the data? I would like use a button to achieve this if possible.

    Thank you.


Printing from a page

Posted: Tue Jul 16, 2013 8:21 am
by Maryna Brodina

Hi,
1) it depends on you data, perhaps it would be better to use Grid element. So it's up to you;
2) to print data use codewindow.print() /code
here is more info http://www.w3schools.com/jsref/met_wi...


Printing from a page

Posted: Tue Jul 16, 2013 8:53 am
by Deon

Thank you Marina. I will give it a try.


Printing from a page

Posted: Tue Jul 16, 2013 12:05 pm
by Deon

I have used the Grid Element but it only displays the 1st record. I need it to display all the records, like the list? Is that possible. I was under the impression that it works like a table and not like a datagrid?

The window.print() works perfectly.
Thank you


Printing from a page

Posted: Tue Jul 16, 2013 12:19 pm
by Maryna Brodina

Please post screenshot of mapping.


Printing from a page

Posted: Tue Jul 16, 2013 1:38 pm
by Deon

I have it showing all records through the query service. I do not know the syntax to use for the Where Request. I need the database OrderNo field to equal my Stored Variable OrderNo. Image
Image


Printing from a page

Posted: Tue Jul 16, 2013 1:54 pm
by Deon

Can I presume that this would be the correct syntax for JS?

return '{"OrderNo":"'+value+'"}';


Printing from a page

Posted: Tue Jul 16, 2013 2:01 pm
by Deon

Nope does not work. No records returned


Printing from a page

Posted: Tue Jul 16, 2013 7:22 pm
by Kateryna Grynko

Hi Deon,

Paste: codereturn '{"OrderNo":"'+value+'"}'; /code as a JavaScript code for field "where" when creating a request.

Where do you pass database session token X-Appery-Session-Token in mapping?


Printing from a page

Posted: Wed Jul 17, 2013 7:34 am
by Deon

Thanks Katya
I was not aware that I had to map it. Can you please explain why this is needed and what I should do?

Thank you