[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

HTM Report?

Posted on 2012-03-21
8
Medium Priority
?
264 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 1500 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
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 course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

656 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