Solved

HTM Report?

Posted on 2012-03-21
8
254 Views
Last Modified: 2012-04-05
OK need some help / advice on this one.

I found this WONDERFUL Piece of code:
http://www.codeproject.com/Articles/14367/Email-Templates

That uses an HTM file that you can format how you like it and define varaible within the HTM File run the parse command after defining all your variables and passing in their values and it creates a GREAT HTML E-Mail!  The best part of this is you can get a feel for what your e-mail is going to look like and design the layout on the screen.

I was hoping I could use this same code to generate a report...but this is where my lack of knowledge comes into play!  I don't want to write it to a file and then display that htm file on the screen because then I would need to clean up all those files on the server later...but rather I would like to generate the report virtually and then either display it to the user in HTML format with a bar that could be printed to a printer or display it as a PDF on the screen where the user could either print it or save it.

Any ideas on how I could accomplish this using the code in the above link project?

Thanks,
Mark
0
Comment
Question by:smithmrk
  • 4
  • 4
8 Comments
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 37750911
That's not HTML, that's ASP.Net.  

That said, what you want to do is pretty easy.  You can either pass parameters to a page that uses the paramters to personalize the page, or you can push HTML into a control on the page so it displays the way you want.
0
 

Author Comment

by:smithmrk
ID: 37752369
OK...I may not have mentioned I'm new at this...so do you have an example of how I would do that?

Thanks,
Mark
0
 
LVL 34

Accepted Solution

by:
Paul MacDonald earned 500 total points
ID: 37752553
Here are a few examples to get your feet wet.  Essentially, you'd put a control on the page, and give it an ID so you can reference it from the code behind and set it to runat='server'.  In the code behind, you can modify the InnerText or InnerHTML property of the control so the page shows whatever you want it to.

http://www.techrepublic.com/blog/programming-and-development/use-aspnets-literal-control-to-its-full-potential/618

http://www.dotnetperls.com/aspliteral

http://stackoverflow.com/questions/467016/can-i-dynamically-add-html-within-a-div-tag-from-c-sharp-on-load-event
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:smithmrk
ID: 37752648
OK This is good stuff, but what I'm trying to do is take the MyParser.Parse method that returns a string of HTML text put it into something like a MemoryStream (so I don't have to write it to the server) and then use the HTML Test in that MemoryStream to PopUp a NEW Window using JavaScript like Window.Open to display this HTML Text so the operator can print it.

I've found lots of examples...but not quite what I'm looking for and like I said I'm new to this stuff so the examples I have found don't quite match what I'm trying to accoplish, so I'm having trouble putting all the missing pieces together.

I found this which is similar to what I'm trying to do but instead of taking the current page I want to take the text from my MyParser.Parse string and Popup a NEW Window.

http://forums.asp.net/t/1038709.aspx/1

Can you help me take a string of HTML and and Popup a NEW Window?

Thanks,
Mark
0
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 37752919
Sorry, even if it's possible, I'm not that smart.  

I'd do this by having a fixed aspx page (with only literal control on it) that you can pop-up as a new window.  As the page loads, have it inject the appropriate HTML into the literal.  You'll get the same effect, and you'll only have the one extra page.
0
 

Author Comment

by:smithmrk
ID: 37753324
I'm sure it's possible...it's just a matter of figuring it out.

I appreciate your help and maybe someone else will chime in with an idea.

Thanks,
Mark
0
 

Author Closing Comment

by:smithmrk
ID: 37813119
I found a solution for now using some of links you provided.  I'll keep working on it, but I have a work around for now.

Thanks!
Mark
0
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 37813125
Happy to help!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question