pui.download Question

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
emhill
Experienced User
Posts: 116
Joined: Wed Sep 05, 2012 11:14 am
First Name: Eric
Last Name: Hill
Company Name: Integrated Corporate Solutions
Phone: 256-760-8239
Address 1: 501 S Wood Avenue
City: Florence
State / Province: Alabama
Zip / Postal Code: 35630
Country: United States
Contact:

pui.download Question

Post by emhill »

I am currently using the pui.download API along with the PUIDNLEXIT program to generate a PDF of a spool file for the user to display. It is working famously!

I have been getting requests to display the spool file in a text mode so the user can copy/paste into EXCEL. I'm using the following for the API:

===================
pui.download({"id": "CPYSPLF" + padprtfile + padjobname + padusername + padjobnbr + padspoolnbr, "inline": true, "contentType": "application/pdf"});
===================

Is there an "application/text" for "contentType" or something similar? Would there be a better alternative to doing what I need to do? The user wants to display the report on the screen, copy the data he wants, then paste that data to EXCEL. He is used to copying and pasting from the green screen spool file display but the green screen is going away for them.

Thanks in advance....
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: pui.download Question

Post by Scott Klement »

Eric,

The content-type for a plain text file is 'text/plain'

In addition to changing the content-type parameter, you also need to change the code in PUIDNLEXIT to produce plain text instead of PDF.
emhill
Experienced User
Posts: 116
Joined: Wed Sep 05, 2012 11:14 am
First Name: Eric
Last Name: Hill
Company Name: Integrated Corporate Solutions
Phone: 256-760-8239
Address 1: 501 S Wood Avenue
City: Florence
State / Province: Alabama
Zip / Postal Code: 35630
Country: United States
Contact:

Re: pui.download Question

Post by emhill »

Thanks Scott!

I found that from a list of MIME types (where I should have looked first!!!).

But herein lies another problem. When the user is on the green screen and displays a spool file he can copy and paste data to EXCEL and it will separate the columns correctly. I've been testing a little with some .txt files. Copying from Notepad and pasting to EXCEL copies everything to one column. I'm going to have to do some digging on this. Do you have any ideas? We do create .csv files for some reports but not others. For the others the user is just copying/pasting from the green screen.

Thanks!
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: pui.download Question

Post by Scott Klement »

I've never done the copy/paste you reference. Maybe Client Access is doing something to make it easier?

You could consider loading your data into a subfile grid in PUI. Then turn on the "export CSV" option, this will make it easy to get the data in Excel.
emhill
Experienced User
Posts: 116
Joined: Wed Sep 05, 2012 11:14 am
First Name: Eric
Last Name: Hill
Company Name: Integrated Corporate Solutions
Phone: 256-760-8239
Address 1: 501 S Wood Avenue
City: Florence
State / Province: Alabama
Zip / Postal Code: 35630
Country: United States
Contact:

Re: pui.download Question

Post by emhill »

Scott,

Another quick question. What is the maximum number of characters that can be used for the "id" configuration option in the pui.download API?

Thanks!
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: pui.download Question

Post by Scott Klement »

I think the 'id' can be up to 640 characters. I'm not sure that I ever tested it that long, though.
emhill
Experienced User
Posts: 116
Joined: Wed Sep 05, 2012 11:14 am
First Name: Eric
Last Name: Hill
Company Name: Integrated Corporate Solutions
Phone: 256-760-8239
Address 1: 501 S Wood Avenue
City: Florence
State / Province: Alabama
Zip / Postal Code: 35630
Country: United States
Contact:

Re: pui.download Question

Post by emhill »

thanks Scott. Don't think I'll need anywhere near that much but just wanted to know what the limit was.

As always, I appreciate the help!
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests