|
hi there.
report viewer control is a part of dll so you wouldn't be ablt o use it serperately. there might be some other options, but here is a rough-one.
export the report to a file of desired format and then view in explorer or other application that supports the
format you chose.
Rep r = new Rep(); //report object
r.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat , "C:\\myreport.pdf"); //exporting as pdf file
ProcessStartInfo info = new ProcessStartInfo("iexplore.exe","C:\\myreport.pdf");
Process.Start(info);
if you cant find something more robust, this may be usefull, at least on educational level.
regards.
|
|
|
|
|
guys..
i'm getting this error from the event viewer log.
Event ID:1000
description as below..
Faulting application erss.winui.exe, version 1.0.0.0, stamp 45742a0c, faulting module mscorwks.dll, version 2.0.50727.42, stamp 4333e7ec, debug? 0, fault address 0x0006d580.
byte data as below..
0000: 41 00 70 00 70 00 6c 00 A.p.p.l.
0008: 69 00 63 00 61 00 74 00 i.c.a.t.
0010: 69 00 6f 00 6e 00 20 00 i.o.n. .
0018: 46 00 61 00 69 00 6c 00 F.a.i.l.
0020: 75 00 72 00 65 00 20 00 u.r.e. .
0028: 20 00 65 00 72 00 73 00 .e.r.s.
0030: 73 00 2e 00 77 00 69 00 s...w.i.
0038: 6e 00 75 00 69 00 2e 00 n.u.i...
0040: 65 00 78 00 65 00 20 00 e.x.e. .
0048: 31 00 2e 00 30 00 2e 00 1...0...
0050: 30 00 2e 00 30 00 20 00 0...0. .
0058: 34 00 35 00 37 00 34 00 4.5.7.4.
0060: 32 00 61 00 30 00 63 00 2.a.0.c.
0068: 20 00 69 00 6e 00 20 00 .i.n. .
0070: 6d 00 73 00 63 00 6f 00 m.s.c.o.
0078: 72 00 77 00 6b 00 73 00 r.w.k.s.
0080: 2e 00 64 00 6c 00 6c 00 ..d.l.l.
0088: 20 00 32 00 2e 00 30 00 .2...0.
0090: 2e 00 35 00 30 00 37 00 ..5.0.7.
0098: 32 00 37 00 2e 00 34 00 2.7...4.
00a0: 32 00 20 00 34 00 33 00 2. .4.3.
00a8: 33 00 33 00 65 00 37 00 3.3.e.7.
00b0: 65 00 63 00 20 00 66 00 e.c. .f.
and right before this error i'm also getting the .Net Runtime error and it says
.NET Runtime version 2.0.50727.42 - serious runtime engine error(7A05E2B3) (80131506)
my application is running on the .Net Framwwork 2.0 and it's a winform application...
i'm not pretty sure but after this errors i also get the application hang. it just stops and the it dies...
please help...
|
|
|
|
|
|
I am doing performance measurements and would like to use a native executable to avoid having JITs occur during performance timing. How does one execute an ngen-generated executable?
There are blogs and MS documentation everywhere that talk about how to use ngen, but I have not found a single place that says how to execute an ngen-executable!
Here is what I tried. Compile:
% csc helloworld.cs
Then install in the global assembly cache:
% ngen install helloworld.exe
Then go to the assembly cache and try to execute:
% cd c:\windows\assembly\helloworld\[hex string]
% ./helloworld.ni.exe
This gives the error message: c:\windows\assembly\helloworld\[hex string\helloworld.ni.exe is not a valid WIN32 application.
|
|
|
|
|
If I remember correctly, you still run the "normal" helloworld.exe file. The runtime will figure out that you have a corresponding native image and use that instead.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
I tried that before posting - I don't think it works. The md5 sum of helloworld.exe is unchanged by running "ngen install helloworld.exe".
|
|
|
|
|
We have various enumerated types in our system and we obviously want to present human readable values that can be easily configured by our UI folks rather than the cryptic identiofiers that we use in the code.
Just wondering what facilities are available in .NET 3.0 to accomodate this kind of thing. In the old days, I would use a string resource and a mapping table for the lookup.
Anybody got any cool/slick/modern ideas on this?
Thanks
NIK
|
|
|
|
|
The following will print "Blue" to the console:
namespace CSFoo
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(ETest.Blue);
}
}
enum ETest
{
Red,
White,
Blue
}
}
|
|
|
|
|
I need to provide a secondary string description of the enum value.
Rather than "Blue", I would want to map that value to a human friendly string such as "The Color Blue".
Make sense?
|
|
|
|
|
The easiest way to do that would be to use a hashtable to map "Blue" to "The Color Blue".
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
namespace CSFoo
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("The Color {0}", ETest.Blue.ToString());
}
}
enum ETest
{
Red,
White,
Blue
}
}
|
|
|
|
|
should have extended subject to say
"that can be easily modified by non-programmers outside of the .cs file"
I think I can probably build a ResourceDictionary in XAML that would provide a basic lookup capability at application scope. Thus my UI guy can tweak the XAML and I can simply do a FindResource using the enum value identifier as the key.
|
|
|
|
|
Are you looking for something that can be modified at runtime or just modified by a "non-programmer" at design time?
You can also look at using the DescriptionAttribute and using a little bit of reflection to retrieve the attribute value at runtime. I believe the strings used in the attribute constructor can be referenced from a resource file.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
No runtime modification or localization needs.
Decided to go with a simple XAML declaration of strings in Application.Resources and use typename.value as key (ID) name.
No hard coded string IDs, and easy for non-programmers to maintain (notepad) in a centralized location.
|
|
|
|
|
The meaning is writed as
"If the member was not serialized, the CLR will leave the members's value null rather than throwing an exception."
Visual Studio does the same thing as if this attribute was not used, so why should anyone use it?
Or is it to garantee compatibility with .Net 1.x?
|
|
|
|
|
It is part of the changes made to serialization in .NET 2.0 to help alleviate the versioning issues that can be encountered when dealing with serialized objects.
If you have version 1.0 of your product that serializes an object and then you create version 2.0 of your product that adds new fields, you would get an exception when you tried to deserialize the 1.0 version of the object. By marking the field with the OptionalField attribute, the object will be deserialized properly and the "missing" fields will be null.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Strange, I can't simulate an exception, what am i doing wrong?
1. Create a class
2. Create an object instance
3. Serialize this object
4. Add a field to the class (value or reference)
5. Deserialize (I supposed .Net would trow an exception here because there's a new field that isn't serialized, but it doesn't)
I think it's just .Net 1.x that generate an exception
-- modified at 4:58 Wednesday 6th December, 2006
|
|
|
|
|
S O L V E D
By using 'BinaryFormatter', the .Net Framework 2.0 doesn't give an exception if you do not use the 'OptionalField' attribute.
But if u use the 'SoapFormatter', the meaning of the 'OptionalField' attribute becomes clear.
|
|
|
|
|
Hiya all.
I instantiated a filesystemwatcher and set it to monitor a directory filtered with a specific file.
Then I made a method which handles the Changed event from the filesystemwatcher.... however when I save/alter the file the watcher monitors - I get the event called twice.
Does anybody know why? Or possible what I need to look for?
|
|
|
|
|
When I first used this class I had this problem - but I don't have the problem anymore.
To resolve my issue I no longer listen to CHange event, but to the Created, Renamed and Deleted events instead.
Depends on what you need to know, but these covered my requirements.
Stuart Wells
Software Engineer
|
|
|
|
|
It's because a changed-event fires more than you probably expect, for example:
- When you create a file
- When you delete a file
- When you rename a file
- ...
|
|
|
|
|
I have a file, in which I need to monitor changes, so I can't use any of the others. The file exits, so it isn't because it gets created that the watcher triggers twice.
Both events are the "Changed" event.
---------------------------
127.0.0.1 - Sweet 127.0.0.1
|
|
|
|
|
I don't know for sure, but maybe you get one event for the content change, and one for the update of the LastWriteTime ?
Luc Pattyn
|
|
|
|
|
Hmm - could be, could be.
|
|
|
|
|
It depends on the file too. If it's a Word document, for example, you're not opening the orignal file. You actually open a copy of it. When you go to save the changes, the file is actually written to the temporary copy (Changed event), then the original file is deleted (Changed event) and the temporary file is renamed (Changed event) to the orignal filename.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|