Need help loading browser and dynamicaly generating webpage to load

M

moondaddy

I have a vb.net 1.1 winforms app that needs to open webpage reports that
contain confidential data. I wanted to use web services where I can encrypt
parameters being passed in and also encrypt the web page content coming
back. Then in the client app I wanted to decrypt the content and render it
in a browser. So far I've been able to generate the content for web page as
a byte() on back end. I can actually load the web page on the backend in a
test by running that project as a .net web app. Here's the code that could
take the byte() and load a web page with it:


Dim report As Byte()

'Fill 'report' with data from rendering a report from SQL Server Reporting
Services

'Now open the Report in an aspx page
HttpContext.Current.Response.BinaryWrite(report)
HttpContext.Current.Response.End()

At this point an aspx page opens with the report in it. All looks good.
However, what I want to do is not execute this last line of code (or 2) and
return 'report' as a return value in a web service back to the winforms app
and then somehow open a browser and populate it with a page made from
'report'.

How can I do this?

Thanks!
 
J

Jeffrey Tan[MSFT]

Hi moondaddy,

Thanks for your post!!

Based on my understanding, you have a C/S structure application, which in
server side, a WebService returns a Byte array, which contains the html
code of a web page. In client side winform app, you want to find a way to
dynamically show the byte array html code in a IE web page. If I
misunderstand you, please feel free to tell me. Thanks

For this, I think in client winform application, we can first get the byte
array, then write the html code in a temp .html file. To get this done, we
can leverage BinaryWriter class to wrap a FileStream(which wraps the temp
html file), then write the byte array into that BinarayWriter, for more
information, please refer to:
"Reading and Writing to a Newly Created Data File"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconreadingwritingtonewlycreateddatafile.asp

At last, we can use Process.Start method to navigate the temp html file.
This way has been provided by "Herfried K. Wagner [MVP]" in your another
issue "How to open browser and point to URL from winforms app", I suggest
you refer other post. Thanks
====================================================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
M

moondaddy

Thanks! That all worked. However, now there's another problem. the page
had HTML, but no images and the path for the images in the webpage was
completely incorrect even if there were images. I think this problem will
be better addressed in the SQL Server Reporting Services group because the
byte array was generated from a SSRS report and code used in working with
SSRS reports.

Thanks again for the help!
 
J

Jeffrey Tan[MSFT]

Hi moondaddy,

Thanks for your feedback!

Yes, for image, it requests some work for us to store it and link it in
html code correctly. Currently, I also suggest you use SQL Server Reporting
Services to get this done. Based on my knowledge to SSRS, it should meet
your need.(Although I am not familiar with SSRS :))

Anyway, if you need further help, please feel free to tell me. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top