General thoughs - some ideas if you would (PDF, JSON etc)

Good afternoon from the land down under (and on the 21st December we are still here).

I have been happily creating a storyboard app and it is working well.

It uses it’s own sqlite database to store info (validated via JSON call to Visual Basic IIS JSON service (one of a few I have written).

The next level of enhancement is to allow the user to request a statement - currently a SSRS program on the IIS front end allows the user to type in some info and receive a statement - which he can then email or print.

In the APP I would like to replicate this functionality.

I am fairly confident that I can create a JSON service that will produce the SSRS report - and I have programs that I have used before to write PDF out to windows file system- so I would (hopefully) return the PDF data as a JSON variable (hopefully it will work…)

It is at the APP end I would appreciate Guidance. Once the stream comes in, I would like to display it (as pdf - like mail does) and email it somewhere. I don’t need to keep it around so would probably not need to write it to file system.

Would appreciate it if I could geta bit of general guidance on the APP/device (IOS in first instance) side.

Have a great CHristmas break guys

Stan [import]uid: 178113 topic_id: 34193 reply_id: 334193[/import]

Ok have found some of the answers.

To email, save stream as file using ifs.* and use the native.showpop() to send the email (with the file as attachement).

Wonder if I can print the document via native.showpopup()- more research needed!

Stan [import]uid: 178113 topic_id: 34193 reply_id: 136001[/import]

Printing is not supported the moment. [import]uid: 199310 topic_id: 34193 reply_id: 136075[/import]

Ok have found some of the answers.

To email, save stream as file using ifs.* and use the native.showpop() to send the email (with the file as attachement).

Wonder if I can print the document via native.showpopup()- more research needed!

Stan [import]uid: 178113 topic_id: 34193 reply_id: 136001[/import]

Printing is not supported the moment. [import]uid: 199310 topic_id: 34193 reply_id: 136075[/import]

Thanks Rob - I will stop looking for that now!

Any thoughts on viewing a PDF? (I found reference to media.show - will check that out)

Happy new year everyone who survived the mayan apocolypse!

Stan [import]uid: 178113 topic_id: 34193 reply_id: 137047[/import]

Thanks for all the advise etc.

Now have a working application.

  1. Has a configurable splash screen - shows for 5 seconds unless user has previously hit the ‘don’t show this again’ button.

Main screen displays current stored summary data in scrollable list.
Each item can be selected and shows more info in another screen (all of this is under storyboard control)

A button can be pushed that shows all data items in summary - each data item can be touched to show full detail.

Two buttons exist for retrieving a statement.

The statement can be viewed or emailed.

(This bit I am pretty proud of).

It sends a JSON request to a JSON IIS service (written in VB). This then calls a SSRS service to format the report into pdf. The PDF byte array is then sent back as a JSON reponse to the IOS program.
The PDF byte array is then written out to local file system as a PDF file.

Then depending on if the user want to email or view statement, the following occurs;

 local options = { baseUrl=system.DocumentsDirectory }  
 local mailoptions =  
 {  
 to = nil,  
 subject = "Statement of charges",  
 body = "Please find attached Statement of Charges",  
 attachment = { baseDir=system.DocumentsDirectory, filename="SOC.pdf", type="PDF" },  
 }  
 if SOC\_Mode == "emailsocbutton" then  
 native.showPopup("mail", mailoptions)   
 else  
  
 native.showWebPopup(0, 0, 320, 436,"SOC.pdf",options)  
 bottomBar.isVisible = true   
 backr.isVisible = true   
  
  
 end  

The showwebpopup works well to display pdf - I got the idea from;

http://mobile.tutsplus.com/tutorials/corona/corona-sdk-webview/

What it does is to make the web popup slightly smaller, and puts a bottom bar on the screen. This bar has a button with a call back attached. When the user hits the button, the call back dismisses the webpopup window - looks very clean.

Stan [import]uid: 178113 topic_id: 34193 reply_id: 137252[/import]

Sounds like progress indeed! [import]uid: 199310 topic_id: 34193 reply_id: 137254[/import]

Thanks Rob - I will stop looking for that now!

Any thoughts on viewing a PDF? (I found reference to media.show - will check that out)

Happy new year everyone who survived the mayan apocolypse!

Stan [import]uid: 178113 topic_id: 34193 reply_id: 137047[/import]

Thanks for all the advise etc.

Now have a working application.

  1. Has a configurable splash screen - shows for 5 seconds unless user has previously hit the ‘don’t show this again’ button.

Main screen displays current stored summary data in scrollable list.
Each item can be selected and shows more info in another screen (all of this is under storyboard control)

A button can be pushed that shows all data items in summary - each data item can be touched to show full detail.

Two buttons exist for retrieving a statement.

The statement can be viewed or emailed.

(This bit I am pretty proud of).

It sends a JSON request to a JSON IIS service (written in VB). This then calls a SSRS service to format the report into pdf. The PDF byte array is then sent back as a JSON reponse to the IOS program.
The PDF byte array is then written out to local file system as a PDF file.

Then depending on if the user want to email or view statement, the following occurs;

 local options = { baseUrl=system.DocumentsDirectory }  
 local mailoptions =  
 {  
 to = nil,  
 subject = "Statement of charges",  
 body = "Please find attached Statement of Charges",  
 attachment = { baseDir=system.DocumentsDirectory, filename="SOC.pdf", type="PDF" },  
 }  
 if SOC\_Mode == "emailsocbutton" then  
 native.showPopup("mail", mailoptions)   
 else  
  
 native.showWebPopup(0, 0, 320, 436,"SOC.pdf",options)  
 bottomBar.isVisible = true   
 backr.isVisible = true   
  
  
 end  

The showwebpopup works well to display pdf - I got the idea from;

http://mobile.tutsplus.com/tutorials/corona/corona-sdk-webview/

What it does is to make the web popup slightly smaller, and puts a bottom bar on the screen. This bar has a button with a call back attached. When the user hits the button, the call back dismisses the webpopup window - looks very clean.

Stan [import]uid: 178113 topic_id: 34193 reply_id: 137252[/import]

Sounds like progress indeed! [import]uid: 199310 topic_id: 34193 reply_id: 137254[/import]