How do I turn on Logging for Telerik Reports? - telerik-reporting

I have a Telerik Report project which is throwing a NullReferenceException somewhere in the ReportProcessor.RenderReport("PDF", reportToExport, null); method. I get the following stacktrace:
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.Reporting.Processing.Table.MeasureColumns(Graphics graphics)
at Telerik.Reporting.Processing.Table.Measure(MeasureDirection dir, Graphics graphics)
at Telerik.Reporting.Processing.ProcessingElement.MeasureElement(MeasureDirection dir, Graphics graphics)
at Telerik.Reporting.Processing.ProcessingElement.Measure(MeasureDirection dir, Graphics graphics)
at Telerik.Reporting.Processing.ReportSectionBase.Measure(MeasureDirection dir, Graphics graphics)
at Telerik.Reporting.Processing.ProcessingElement.MeasureElement(MeasureDirection dir, Graphics graphics)
at Telerik.Reporting.Processing.Group.MeasureElement(MeasureDirection dir, Graphics graphics)
at Telerik.Reporting.Processing.Report.MeasureElement(MeasureDirection dir, Graphics graphics)
at Telerik.Reporting.Processing.ProcessingElement.Measure(MeasureDirection dir, Graphics graphics)
at Telerik.Reporting.Processing.ProcessingElement.MeasureElement(MeasureDirection dir, Graphics graphics)
at Telerik.Reporting.Processing.ProcessingElement.Measure(MeasureDirection dir, Graphics graphics)
at Telerik.Reporting.Processing.ReportSectionBase.Measure(MeasureDirection dir, Graphics graphics)
at Telerik.Reporting.Processing.ProcessingElement.MeasureElement(MeasureDirection dir, Graphics graphics)
at Telerik.Reporting.Processing.Group.MeasureElement(MeasureDirection dir, Graphics graphics)
at Telerik.Reporting.Processing.Report.MeasureElement(MeasureDirection dir, Graphics graphics)
at Telerik.Reporting.Processing.Report.MeasureElement(ProcessingElement elementToMeasure)
at Telerik.Reporting.Processing.ReportProcessor.RenderCore(String format, IList`1 reports, Hashtable deviceInfo, Hashtable renderingContext, CreateStream createStreamCallback)
at Telerik.Reporting.Processing.ReportProcessor.ProcessAndRender(String format, IReportDocument reportDocument, Hashtable deviceInfo, Hashtable renderingContext, CreateStream createStreamCallback)
at Telerik.Reporting.Processing.ReportProcessor.ProcessAndRenderStateless(String format, IReportDocument reportDocument, Hashtable deviceInfo, Hashtable renderingContext, CreateStream createStreamCallback)
at Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, IReportDocument reportDocument, Hashtable deviceInfo)
at JIIGCAL.CareerCompass.Reports.Views.ReportsDefault.ExportToPDF(IReportDocument reportToExport) in C:\dev\.....\Reports\Viewer.aspx.cs:line 236
Line 236 in Viewer.aspx.cs is the call to RenderReport(); I have no idea how to track this error down. Is there a way to enable logging for the runtime report engine so I can get some more info on which field/column/table is the offending one?
Edit: Solution Found
Received the following response from Telerik:
Such an error can occur if you have a textbox in a Table cell which has zero set for Size. Changing the size from zero to a very small value would resolve the problem. Note that setting row/column groups to zero size sets them Visible=false, which is not supported. Due to the data driven nature of the CrossTab/Table, when you want to hide some data, you need to filter the CrossTab groups instead of hiding them.
I was setting a couple of text boxes to Visible=false based on certain conditions. I changed this and it worked perfectly.
As far as getting a result for how to log the internal runtime engine they gave this advice:
The standard way to enable any .NET application to output some logs is to use Trace Listeners. For example you can add TextWriterTraceListener to the configuration file of your application:
<configuration>
<system.diagnostics>
<trace autoflush="false" indentsize="4">
<listeners>
<add name="myListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="TextWriterOutput.log" />
<remove name="Default" />
</listeners>
</trace>
</system.diagnostics>
</configuration>
We use the same approach in our reporting engine. You can see some of the tracing we do in the Visual Studio output window and you can also download the product source code for reference.

Related

OCR fields recognition

can somebody help me with next question, we need use OCR technology but we don't need all text, only some fields from invoices and receips, can't find what is better solution for this
If you want to start mobile app development, you can use the Text Recognition Service, at the core of which is OCR technology. For example, Huawei ML Kit Text recognition API, Google Firebase ML's text recognition API, etc. You can extract the required text information(invoices and receipts if you need) ) through code.
I will list main procedures for ML Kit Text recognition integration, you can also download the demo on Github.
Preparations
1). Configure the Maven Repository Address in the Project-Level build.gradle File
buildscript {
repositories {
...
maven {url 'https://developer.huawei.com/repo/'}
}
}
dependencies {
...
classpath 'com.huawei.agconnect:agcp:1.3.1.300'
}
allprojects {
repositories {
...
maven {url 'https://developer.huawei.com/repo/'}
}
}
2). Add Configurations to the File Header
apply plugin: 'com.android.application'apply plugin: 'com.huawei.agconnect'
3). Configure SDK Dependencies in the App-Level build.gradle File
dependencies {
// Import the base SDK.
implementation 'com.huawei.hms:ml-computer-vision-ocr:2.0.1.300'
// Import the Latin character recognition model package.
implementation 'com.huawei.hms:ml-computer-vision-ocr-latin-model:2.0.1.300'
// Import the Japanese and Korean character recognition model package.
implementation 'com.huawei.hms:ml-computer-vision-ocr-jk-model:2.0.1.300'
// Import the Chinese and English character recognition model package.
implementation 'com.huawei.hms:ml-computer-vision-ocr-cn-model:2.0.1.300'
}
4). Add these Statements to the AndroidManifest.xml File so the Machine Learning Model can Automatically Update
<manifest>
...
<meta-data
android:name="com.huawei.hms.ml.DEPENDENCY"
android:value="ocr" />
...
</manifest>
5). Apply for the Camera Permission
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
2. Code Development
1). Create an Analyzer
MLTextAnalyzer analyzer = new MLTextAnalyzer.Factory(context).setLanguage(type).create();
2). Set the Recognition Result Processor to Bind with the Analyzer
analyzer.setTransactor(new OcrDetectorProcessor());
3). Call the Synchronous API
Use the built-in LensEngine of the SDK to create an object, register the analyzer, and initialize camera parameters.
lensEngine = new LensEngine.Creator(context, analyzer)
.setLensType(LensEngine.BACK_LENS)
.applyDisplayDimension(width, height)
.applyFps(30.0f)
.enableAutomaticFocus(true)
.create();
4). Call the run Method to Start the Camera and Read the Camera Streams for the Recognition
try {lensEngine.run(holder);} catch (IOException e) {// Exception handling logic.Log.e("TAG", "e=" + e.getMessage());}
5). Process the Recognition Result As Required
public class OcrDetectorProcessor implements MLAnalyzer.MLTransactor<MLText.Block> {
#Override
public void transactResult(MLAnalyzer.Result<MLText.Block> results) {
SparseArray<MLText.Block> items = results.getAnalyseList();
// Process the recognition result as required. Only the detection results are processed.
// Other detection-related APIs provided by ML Kit cannot be called.
…
}
#Override
public void destroy() {
// Callback method used to release resources when the detection ends.
}
}
6). Stop the Analyzer and Release the Detection Resources When the Detection Ends
if (analyzer != null) {
try {
analyzer.stop();
} catch (IOException e) {
// Exception handling.
}
}
if (lensEngine != null) {
lensEngine.release();
}
You can also refer to this medium article here.
For more, see official documentation.
there are a couple of solutions that I am aware of from the LEADTOOLS SDK. Both the Master Form editor and the Document Analyzer sound like they could be useful to your use case. In the interest of full discloser, it is the company that I work for, but I would be remiss not mention it as a possible solution for your scenario.
This is a link to a YouTube video describing how the Master Forms Editor technology works.
https: //www.youtube.com/watch?v=wo6TGcdrtb4
It essentially allows you to define pre-set zones on various forms, and then compare the document to the forms in the repository. Then it will extract the data from those zones and you can manage the OCR'd data however you would like.
As well as a link to Online Documentation that shows the coded implementation of some of the functionality:
https://www.leadtools.com/help/sdk/v21/dh/to/steps-to-generate-a-master-form-and-save-it-to-a-master-repository.html
Here is a link to the other functionality that I mentioned - Document Analyzer - that one of my colleagues goes over in the Microsoft Build Post Show.
https://www.leadtools.com/blog/general/microsoft-build-post-show-v21-document-analyzer-demo/
The code for these examples, and the technology used, can be found in a 60-day free trial offer that can be downloaded from the LEAD site if you are interested in checking it out.
https://www.leadtools.com/downloads

Debugging WCF service that will not serialize objects

I am having issues with serializing objects to JSON, and being new to WCF, I am having issues on where to start in terms of debugging. All I get if I hit the service by typing the url in the browser is page not available.
The scenario: I have class A which inherits a List of class B. If I comment out in Class A where it adds to it's collection, I can at least hit the service (just obviously no data will be present), but if it adds to its collection, I can no longer hit the service.
Interface:
<OperationContract()> _
<WebGet(UriTemplate:="getAdverseReactions", responseFormat:=WebMessageFormat.Json)> _
<ServiceKnownType(GetType(AdverseReactions))> _
<ServiceKnownType(GetType(AdverseReaction))> _
Function GetAdverseReactions() As AdverseReactions
Implementing interface:
Public Function GetAdverseReactions() As AdverseReactions Implements IPortalCoreService.GetAdverseReactions
Return CoreServiceController.GetAdverseReactions()//which returns class A
End Function
Class A:
<CollectionDataContract(Name:="AdverseReactionsCollection", ItemName:="AdverseReaction")> _
Public Class AdverseReactions
Inherits List(Of AdverseReaction)
Class B:
<DataContract(IsReference:=True)> _
Public Class AdverseReaction
I stepped through the code via attaching a process, and no exceptions are thrown and I can confirm that the objects are returned as they should be, I just obviously cannot serialize it. I have read about circular references, and a friend of mine suggested that these two classes might be serializing each other in an infinite manner.
My main question: Is there a place I can look to see why this is occurring, or at least some more information about it? This issue has been handling me, all I want is to serialize this and when I do I think I will take a weeks vacation :).
Add the following block to your web.config <configuration> block
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Information, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="c:\log\WebTrace.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
and ensure the directory specified (c:\log) exists and is writable by the IIS service.
Once this is done, perform the action that causes the serialization issue then navigate to the directory and double-click the generated svclog file.
This will open the file in the Microsoft Service Trace Viewer. Once this is opened, you will see errors displayed in red down the left-hand side.
Clicking on one of these will show the details in the top right pane and you can click on each of the actions to determine what WCF is complaining about.
While this is slightly dated (2010), I think it will give you some ideas of paths to try.
Quickly finding WCF Serialization/Deserialization Issues
This previous StackOverflow question might help to:
How to trace WCF serialization issues / exceptions

Azure role configuration management

I don't see how Windows Azure lets you vary the configuration of an application when you have no choice but to hold configuration settings in web.config (or app.config).
For example...
Quite often projects will make use of a 3rd party library that makes heavy use of web.config. The use of web.config may involve connection strings, app settings or custom configuration sections. A good example of this is ELMAH. A web.config file for ELMAH might look like the following:
<configuration>
<configSections>
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
</sectionGroup>
</configSections>
<connectionStrings>
<add
name="MyElmahDatabase"
providerName="System.Data.SqlClient"
connectionString="Server=tcp:myServer.database.windows.net,1433;Database=myDB;User ID=user#myServer;Password=password;Trusted_Connection=False;Encrypt=True;Connection Timeout=30" />
</connectionStrings>
<elmah>
<security allowRemoteAccess="1" />
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="MyElmahDatabase" />
</elmah>
</configuration>
There are a couple of problems here:
There is no way for me to update or vary whether remote access is enabled between Service Configurations.
There is no way for me to update or vary the ELMAH connection string between Service Configurations.
This is because the web.config is packaged as is into the .cspkg file and ELMAH will not look at the Service Configuration settings (which are the only way I can vary configuration settings between Service Configurations).
I can think of many other examples where this is a problem...
Any data access frameworks that look directly at the connection strings section.
Any custom configuration settings I need to create.
...to name just two.
Am I missing something or is this a significant gap in the configuration management offered by Windows Azure?
EDIT
From the answer and comments below, it looks like this is something that is not well supported. I think that managing multiple solution build configurations to support different configuration profiles is a very weak solution. I should not have to rebuild the solution for each configuration profile I need (there will likely be quite a few). Compilation is not equal to configuration.
I was wondering if there was a way to modify the .cspkg file as it is just a zip file. According to this documentation you can on Linux.
I've looked at the manifest in the .cspkg file and it looks like this:
<PackageManifest version="2">
<Encryption keytype="1" />
<Contents hashtype="1">
<Item name="MyApp.Web.UI_<GUID>.cssx" hash="AED69299C5F89E060876BC16BD3D6DE5130F6E62FFD2B752BAF293435339B7E2" uri="/MyApp.Web.UI_<GUID>.cssx" />
<Item name="MyApp.Web.Services_<GUID>.cssx" hash="7AC81AFF642E4345173C8470C32A41118A4E3CFD4185B82D0ADA44B71057192D" uri="/MyApp.Web.Services_<GUID>.cssx" />
<Item name="SMPackage_<GUID>.csmx" hash="B5E6B83B62AF64C7C11CAC1A394ABBF15D7DB7667A773C5284CE5BE95C5834E9" uri="/SMPackage_<GUID>.csmx" />
<Item name="SDPackage_<GUID>.csdx" hash="F34B7C02A551D82BAD96881E2DA9447D0014D49B47CCB3840475BDC575234A7D" uri="/SDPackage_<GUID>.csdx" />
<Item name="NamedStreamPackage_<GUID>.csnsx" hash="FA2B5829FF5D9B2D69DCDDB0E5BDEE6B8B0BC09FFBF37DAEEE41CF3F3F4D0132" uri="/NamedStreamPackage_<GUID>.csnsx" />
</Contents>
<NamedStreams>
<Stream name="RequiredFeatures/MyApp.Web.Services/1.0" />
<Stream name="RequiredFeatures/MyApp.Web.UI/1.0" />
<Stream name="SupportData/MyApp.Web.Services/1.0" />
<Stream name="SupportData/MyApp.Web.UI/1.0" />
</NamedStreams>
</PackageManifest>
Unfortunately, if I re-compute the hash of the unchanged "MyApp.Web.UI_.cssx" file, my hash is different from the one in the manifest.
Hash from manifest: AED69299C5F89E060876BC16BD3D6DE5130F6E62FFD2B752BAF293435339B7E2
My calculated hash: E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855
Note that I have not yet changed the file, so the hash should be the same.
This suggests I'm calculating it wrong. My method was as follows:
class Program
{
static void Main(string[] args)
{
using (FileStream fs = new FileStream(args[0], FileMode.Open))
{
ComputeHash(new SHA256Managed(), fs);
}
}
private static void ComputeHash(HashAlgorithm hashAlgorithm, Stream stream)
{
byte[] hash = hashAlgorithm.ComputeHash(stream);
string hashString = BitConverter.ToString(hash);
Console.WriteLine(hashString.Replace("-", string.Empty));
Console.WriteLine();
}
}
The documentation link above, suggests it is straightforward to re-calculate the hash (on Linux anyway).
Does anyone know how to re-compute the hashes?
Passing a Stream to ComputeHash() ends up with a different hash as compared to using the byte[] overload. I don't know why.
Try something like:
private static void ComputeHash(HashAlgorithm hashAlgorithm, Stream stream)
{
BinaryReader reader = new BinaryReader(stream)
byte[] hash = hashAlgorithm.ComputeHash( reader.ReadBytes( (int)stream.Length ) );
string hashString = BitConverter.ToString(hash);
Console.WriteLine(hashString.Replace("-", string.Empty));
Console.WriteLine();
}
This will give you the hash you're after.
As you've probably already discovered, on linux you can get the digest with
openssl dgst -sha256 /path/to/file
I you have items in your web.config that you want to change depending on how it's being built, there is a solution that is outside of Azure that you can use. You can use Web.config transforms. These transforms are tied to your build configuration not your service configuration, but your service configurations a likely closely tied to your build configurations anyway (...Local.csfg -> Debug, ...Cloud.csfg -> Release). If the default build configurations don't work for you, just create the ones you need.
If you want to use different service definitions per service configuration, then it's not supported by the UI, but you can mess around with the build process to make it work

BlackBerry - Exception when creating a graphics object from a bitmap

I am making the following call in my blackberry application (API ver 4.5)...
public void annotate(String msg, EncodedImage ei)
{
Bitmap bitmap = ei.getBitmap();
Graphics g = new Graphics(bitmap);
g.drawText(msg,0,0);
}
And I keep getting an IllegalArgumentException when I instantiate the Graphics object. Looking at the documentation for Graphics is confusing as it leaves many things unstated.
What does it mean by 'default type of the device'?
How do you know if the type of 'bitmap' is not supported? Does this mean that there are different types of bitmaps? Can different encodedImages generate different types of bitmaps?
Is there another way to add my string to the associated encoded image?
public Graphics(Bitmap bitmap)
Constructs a Graphics object for drawing to a bitmap.
Parameters:
bitmap - Bitmap to draw into. Must be Bitmap.COLUMNWISE_MONOCHROME or the default type of the device.
Throws:
IllegalArgumentException - If the type of 'bitmap' is not supported, or the bitmap is readonly.
Are you sure that your Bitmap is mutable? You can't create Graphics objects from immutable Bitmaps. That is one cause of an IllegalArgumentException. You can set the decode mode for your EncodedImage (EncodeImage.setDecodeMode). There are different modes that allow you to specify whether the file is native or readonly...along with other modes that can be combined.
The size of the bitmap might be another IllegalArgumentException. Of course, this is relevant to the target device.
I'd imagine that the default type depends on the graphics chip and hardware. (If you have a monochrome screen, the default would probably be different than if you had a color one.)
Bitmap has a static method getDefaultType(), which "Queries the default Bitmap type for the device". There's also a non-static method getType(). It seems to be telling you the rule is that for the code above to work then either:
bitmap.getType() == Bitmap.getDefaultType()
...or...
bitmap.getType() == COLUMNWISE_MONOCHROME
And presumably neither of these conditions are true. You can do a sanity check on that, and maybe print out the result of getDefaultType() so you know what your target is.
Looks like you'll have to convert the bitmap or get it from somewhere else.
The Graphics object isn't normally constructed explicitly. Rather, you are given an instance of it in the paint() method, if you've overridden it.
I suspect what you want to do is create a subclass of BitmapField and override the paint() method to include your code for drawing text on the bitmap.

MS WebBrowser + Embedded HTML Resource + res:// Protocol

I have an embedded HTML resource (helloworld.htm) inside my Visual Studio project. (Ie, I've added an HTML file to the project and set its properties to "Embedded Resource".
Within the same application I have a WebBrowser control.
I'd like to direct the WebBrowser control to display the HTML resource using the res:// protocol.
But I can't figure out the exact format needed to address an embedded resource using this style of URL.
Any ideas? Thanks!
I know this thread is dead, but I had to do this yesterday and couldn't get any of these methods to work. So I did a little research and found the method below, using the Stream class. I thought I'd post it here just in case somebody else runs into the same nonsense:
Stream docStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("NameSpace.HTMLPage.html");
WebBrowser.DocumentStream = docStream;
This worked for me without any tinkering, and it was so simple. I hope it benefits somebody else!
The res: protocol is not dead and is still a great way to embed webpages into Windows applications using a WebBrowser control. Unfortunately, it seems to me there are two types of resources in exe and dll files out there: C resources and .net resources. It may possible to embed C resources in a .net dll but I haven't figured out how to yet.
To answer your question, the res protocol is documented at here but actually building the dll or exe is the tricky part. The res protocol is simple enough. The basic gist of it is you specify res://, follow that by the path to the executable or dll (just the dll name if it's in the current path). For HTML type resources, follow that with the filename. Here is a recent MSDN article the talks about some known problems with the res protocol: http://support.microsoft.com/kb/220830.
Building the dll or exe resources can be a little bit tricky. For easiest results, make all of your resources of type HTML (even your .js, .png, .jpg files). Instead of naming your resources with a #defined resource identifier, modern res files allow you to name the files with a string. Doing this will make your life a lot easier.
Advanced Tip: Having folder names in the resource name is tricky; I haven't figured it our yet. I think you may be able to simulate folders by putting slashes in the resource name, but I think res protocol gets confused by the slashes thinking the first part of the path is the resource type. Explicitly specifying the resource type may alleviate this.
Advanced Tip 2: For the path newer versions of IE can deal with the '\' character, but you can use '%5C' as a substitute for '\' if you need to specify the absolute or relative location of the dll or exe.
Additional Resource:
MSDN Social: Webbrowser and res: protocol
DelphiDabbler: How to create and use HTML resource files
res://project.exe/helloworld.htm
This is the little helper class and how to call it:
How to call:
StreamResourceInfo info =
ResourceHelper.GetResourceStreamInfo(#"Resources/GraphicUserGuide.html");
if (info != null)
{
WebBrowser.NavigateToStream(info.Stream);
}
Helper class:
using System;
using System.Reflection;
using System.Windows;
using System.Windows.Media.Imaging;
using System.Windows.Resources;
namespace HQ.Wpf.Util
{
public class ResourceHelper
{
// ******************************************************************
/// <summary>
/// Load a resource WPF-BitmapImage (png, bmp, ...) from embedded resource defined as 'Resource' not as 'Embedded resource'.
/// </summary>
/// <param name="pathInApplication">Path without starting slash</param>
/// <param name="assembly">Usually 'Assembly.GetExecutingAssembly()'. If not mentionned, I will use the calling assembly</param>
/// <returns></returns>
public static BitmapImage LoadBitmapFromResource(string pathInApplication, Assembly assembly = null)
{
if (assembly == null)
{
assembly = Assembly.GetCallingAssembly();
}
return new BitmapImage(ResourceHelper.GetLocationUri(pathInApplication, assembly));
}
// ******************************************************************
/// <summary>
/// The resource should be defined as 'Resource' not as 'Embedded resource'.
/// </summary>
/// <param name="pathWithoutLeadingSlash">The path start with folder name (if any) then '/', then ...</param>
/// <param name="assembly">If null, then use calling assembly to find the resource</param>
/// <returns></returns>
public static Uri GetLocationUri(string pathWithoutLeadingSlash, Assembly assembly = null)
{
if (pathWithoutLeadingSlash[0] == '/')
{
pathWithoutLeadingSlash = pathWithoutLeadingSlash.Substring(1);
}
if (assembly == null)
{
assembly = Assembly.GetCallingAssembly();
}
return new Uri(#"pack://application:,,,/" + assembly.GetName().Name + ";component/" + pathWithoutLeadingSlash, UriKind.Absolute);
}
// ******************************************************************
/// <summary>
/// The resource should be defined as 'Resource' not as 'Embedded resource'.
/// Example:
/// StreamResourceInfo info = ResourceHelper.GetResourceStreamInfo(#"Resources/GraphicUserGuide.html");
/// if (info != null)
/// {
/// WebBrowser.NavigateToStream(info.Stream);
/// }
/// </summary>
/// <param name="path">The path start with folder name (if any) then '/', then ...</param>
/// <param name="assembly">If null, then use calling assembly to find the resource</param>
/// <returns></returns>
public static StreamResourceInfo GetResourceStreamInfo(string path, Assembly assembly = null)
{
if (assembly == null)
{
assembly = Assembly.GetCallingAssembly();
}
return Application.GetResourceStream(ResourceHelper.GetLocationUri(path, assembly));
}
// ******************************************************************
}
}
webBrowser1.DocumentText = ResourceinWebBrowser.Properties.Resources.HTML.ToString();
Where:
webBrowser1 is the WebBrowser control
ResourceinWebBrowser is your exe / Project Name.
HTML is the name of your embedded html resource
The easiest way, maybe not the safest or most sane, is to have a Settings variable that made up the base web page, place your own marker tags to REPLACE when streaming the strings in packets. This way, once the non-dynamic portions of the web page is completed, you only need to render the dynamic portions to REPLACE in the string. Then set the DoumentText = stringWebStream. Be sure to set AllowNavigation = True.
I know that it's been asked a long time ago, but here's how IE interprets the res: protocol:
res://sFile[/sType]/sID
sFile Percent-encoded path and file name of the module that contains the resource.
sType Optional. String or numerical resource type. This can be either a custom resource or one of the predefined resource types that
are recognized by the FindResource function. If a numerical resource
type is specified, the number of the identifier must follow a #
character. If this parameter is not specified, the default resource
type is RT_HTML or RT_FILE.
sID String or numerical identifier of the resource. If a numerical identifier is specified, the actual number of the identifier, not the
identifier itself, must follow a # character. See the example for more
information.