Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

Sponsored Links

Discuss "print option" in the ASP Development forum.

ASP Development - Learn coding practices and tips to get the best out of your Active Server Pages (ASP). The Classic ASP forum is for ASP/VBScript and ASP/JScript applications.


Reply « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1  
Old September 7th, 2008, 12:25 PM
Barn Frequenter

 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default print option

Hi,

I have a drop down right now a user selects a name and hits submit and it opens up a excel file


I have to make a change so that a user can select multiple names from the drop down and when he hits submit button it opens up a excel file for all the names that were selected and prints out the excel files for all the names.

I am just not getting the printing side of the excel file can someone tell me how i can make it happen.

todd
Reply With Quote
Sponsored Links
  #2  
Old September 7th, 2008, 02:05 PM
jmurrayhead's Avatar
The Barnfather

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 820
Thanks: 20
Thanked 74 Times in 71 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura about

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default

As far as I know, you can't use ASP to make an Excel document print. You can only use ASP to add a header which will generate the Excel document.

As for selecting multiple users, do the following in your HTML:

Code:
<select multiple="multiple">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
</select>
This will store a comma delimited string in the post value. Create an array from this using the Split() function and then iterate through this array to generate your documents.
__________________
jmurrayhead
If you agree with me... click the icon!
If my post solved your problem, click the button in the lower right-hand corner of the post.

Join our Folding team: DeveloperBarn Folding
Reply With Quote
  #3  
Old September 7th, 2008, 09:19 PM
dr_rock's Avatar
Drunk Developer

 
Join Date: Jun 2008
Posts: 31
Thanks: 4
Thanked 3 Times in 1 Post
Rep Power: 1
dr_rock is on a distinguished road

Awards Showcase
Classic ASP 
Total Awards: 1

Default

I would create a simple CSV file using FSO dependent on the options selected, then redirect the page to that file you just created, this will prompt the user to dl/open the file, at this poing the user simply presses CTRL+P to bring up the print options.

Reply With Quote
  #4  
Old September 9th, 2008, 09:49 PM
Barn Frequenter

 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

Hi,

I have not tried it as my on vacation currently but i thought of this idea and u guys might tell me if it will work or not

when i hit submit button it opens up a excel file in the excel file i will have the body tag can i have a function called onload so when the page is loading the function is called which has window.print()

will this work

todd
Reply With Quote
  #5  
Old September 10th, 2008, 05:07 PM
BLaaaaaaaaaarche's Avatar
Administrator


 
Join Date: Mar 2008
Posts: 55
Thanks: 10
Thanked 7 Times in 5 Posts
Rep Power: 1
BLaaaaaaaaaarche is on a distinguished road

Awards Showcase
HTML & CSS Classic ASP 
Total Awards: 2

Default

I don't see why not as long as you are controlling with JS.
__________________
"You'll never be as perfect as BLaaaaaaaaarche."
Reply With Quote
  #6  
Old September 12th, 2008, 10:40 AM
Barn Frequenter

 
Join Date: Mar 2008
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default

ok guys i am back to work

i had the code window.print which i fire in onload event

when the page is loaded it shows me the print option dialog box is there a way i can automatically print it instead of the user clicking on "OK" button in the dialog box

todd
Reply With Quote
  #7  
Old September 12th, 2008, 11:37 AM
guddu's Avatar
Barn Frequenter

 
Join Date: Jul 2008
Location: Oxford UK
Posts: 129
Thanks: 6
Thanked 3 Times in 2 Posts
Rep Power: 1
guddu is on a distinguished road
Default

as per my knowledge u can not do like this when u use window.print

for details pls see this link
Print Directly to Printer

Comments on this post
jmurrayhead agrees: yeap
__________________
Love is physical attraction and mental destruction
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > ASP Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Previous n Next option for threads! micky Suggestions & Feedback 2 July 19th, 2008 03:16 AM
print problem todd2006 JavaScript Programming 5 June 25th, 2008 01:36 PM
Text or List option plus Rebelle JavaScript Programming 8 June 17th, 2008 12:27 PM
Print out data on a letterhead format Shem .Net Development 3 May 22nd, 2008 09:15 AM


All times are GMT -4. The time now is 05:24 PM.



Content Relevant URLs by vBSEO 3.2.0