Solved

HTM Report?

Posted on 2012-03-21
8
256 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Modal Popup Extender control 1 53
How can I run RAW complex query's with Entity Framework Core 1 67
How to filter by key press ? 6 57
aspx ascx, c# 7 20
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 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