|
Hi.
I'm developing a part of a larger System where I'm using the crystal reports
viewer that comes with Visual Studio .NET.
I want to be able to control wether or not the printer selection screen
should be displayed.
In our System we already have configured wich printer to use, so the windows
printer selection screen that appears after pressing the print button,
should not be shown.
Is this at all possible to control when I'm usig the crystal reports viewer?
Regards Troels
|
|
|
|
|
If you use the ildasm.exe IL disassembler that ships with the .NET Framework SDK and view the IL for CrystalReportViewer.PrintReport - following it till ReportDocumentBase.Print - you'll see that it displays the PrintDialog without checking any state variables. So, unfortunately, you can't change this behavior.
You might try emailing support at http://www.crystaldecisions.com[^] to request such a feature.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
It looks like you are right.
Thanks anyway.
|
|
|
|
|
I'm a C/C++ programmer trying to keep up with the game.
How do I construct this C fragment in C#? I'm happy to use strings rather than char *.
struct UserData
{
char *pName;
char *pData;
int n;
} UserData[] =
{
{"Dave", "123", 44},
{"Harry", "345", 67}
};
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
public struct UserData
{
public UserData(string name, string data, int n)
{
this.Name = name;
this.Data = data;
this.N = n;
}
public string Name;
public string Data;
public int N;
} See the documentation for the StructLayoutAttribute in the .NET Framework SDK for more details and examples.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks Heath, I was actually wondering about how to initialise the data, and you put me on the right track. I've ended up with your class
public struct UserData<br />
{<br />
public UserData( string name, string data, int n)<br />
{<br />
this.Name = name;<br />
this.Data = data;<br />
this.N = n;<br />
}<br />
public string Name;<br />
public string Data;<br />
public int N;<br />
}
and then for the data:
<br />
public UserData[] uData =<br />
{<br />
new UserData( "Dave", "123", 44),<br />
new UserData( "Harry", "345", 67),<br />
};
and thus use the 'uData' array in a loop as I wanted.
Thanks
|
|
|
|
|
I'm just trying to make sure I understand. Obviously there is nothing wrong with this but it was my understanding that StructLayoutAttribute was used if the struct were to be passed to unmanaged code, otherwise it wouldn't be necessary. Is there some benefits to using the attribute for managed code as well?
|
|
|
|
|
No, it wouldn't be necessary in managed code unless marshaled to native code, but since he mentioned C/C++ I just assumed that he might require it.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks, just wanted to make sure I wasn't missing something.
|
|
|
|
|
I am trying to access data from the serial port using c# I don't want to use a GUI I just want to be able to recieve a stream of bytes, does anybody know how to do this or have any suggestions thanks Tim
|
|
|
|
|
there are no .NET library to use for this.
You have another couple of options.
Use a component from VS 6.0:
http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=320
OR use the win32 API:
http://msdn.microsoft.com/msdnmag/issues/02/10/NETSerialComm/default.aspx
|
|
|
|
|
Hi,
I am trying to play mp3 files from C# app. I have Windows Media Player 6.4 and I am able to play the file but with mp3 files, it disables the fast forward and rewind buttons and I also want the trackbar with it.
So, I installed Windows Media Player 9 with SDK. That has a problem that it doesn't look like the gray color simple WMP and that is the look I want. I know I can change the skin, but that seems to be a lot of work and I don't know how to choose a skin while playing a file !
I did read in help that if I put audio.URL = "c:\filename.mp3?WMPSkin=Compact" it should work, but I didn't see the skin change when I ran the applicaiton.
Any suggestions ?
Thanks,
Paul
|
|
|
|
|
pahluwalia wrote:
Any suggestions ?
Stop double posting
|
|
|
|
|
Why don't you just set the visibility to false and handle the events and methods (like Play and Stop ) yourself? It appears there is no way to change the skin using the WMP object model.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I developed a system to print our companies invoices. Now, I am trying to find ways to optimize the system. One of the biggest things is how long it takes to print. When a bill is printed, it also prints all the paperwork stored as tiff images that go with that bill. These images really seem to take a long time to print. I tried converting them to a smaller format to hopefully speed up spooling time. Funny enough, it took longer to print a 159KB gif file than a 1344KB tiff file. My question is, does anybody know of a way to decrease the amount of time it takes to print these images? Thanks.
|
|
|
|
|
I think it really depends on the capabilities of your printer. In which case short of writing your own device driver there isn't anything you can do.
|
|
|
|
|
But can anybody explain why it takes longer to print a 159KB gif image than it does to print a 1344KB tiff image?
|
|
|
|
|
.NET sends _all_ data to a printer using Raster images. This means if you only send plain taxt to a printer, it still converts it into a raster image. If you communicate with the printer via the Serial port it takes quite a while.
If you only want to send text you can develop a component in VB (VS 6.0) that sends plain text to a printer and use this in .NET.
can't help with the image though...
|
|
|
|
|
Looking of your great help gurus.
I new to know how to get the current user info, namely, domain user name and computer name, IP address.
How to get these Net details in C# ?
Best Regards,
Ashraf.
|
|
|
|
|
To get the domain name, you can use Environment.UserDomainName . For the username, you can use Environment.UserName . To get the computer name, use Environment.MachineName . If you want more information than this, you can P/Invoke the Network Management APIs. See the API documentation on MSDN at http://msdn.microsoft.com/library/en-us/netmgmt/netmgmt/network_management.asp[^] for more information about the Network Management API.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
My many thanks to you. It was very helpping..
Keep best of support to each other..
Best Regards,
Ashraf Alsadiq.
|
|
|
|
|
Hi there,
I'm a newbie in C# and learning the language right now.
I have MFC backgrounds for almost 10 years now and I want to migrate to C#.
My question is simple... What is the equivalent of the MFC TRACE macro for C#?
The goal is to display traces in the output debug window of the IDE the same way as TRACE macro.
Thanks for the answer.
Best regards.
bouli.
|
|
|
|
|
Although these are not macros they are much more powerful than the MFC equivalents.
System.Diagnostic.Trace.WriteLine();
System.Diagnostic.Debug.WriteLine();
The Debug version will only work in the debug build (or any build where you #define DEBUG ).
The Trace version is more for instrumented builds where you want the output to go to a log file of the system event log and it is valid to have available in the release build. The Trace version will only work where you #define TRACE .
See also TraceListener
Also, for future reference: In the next version of .NET the Trace classes are meant to be vastly improved.
--Colin Mackay--
EuroCPian Spring 2004 Get Together[^]
|
|
|
|
|
Hi,
Nice stuffs!
No possible comparison with the simple TRACE macro
Thanks.
|
|
|
|
|
To add to that, the DefaultTraceListener will output messages you pass to Trace or Debug to the output window when you're debugging your application in .NET. To write to files, the event log, or any custom targets you can use additional TraceListener implementations even at runtime (we use one for error logging in our app).
You're right, though, it is much better than the various TRACE macros, though - as Colin mentioned - a much better trace facility would be nice and is expected. To elaborate, every message you pass is passed to each TraceListener , regardless of whether or not they want to handle it (based on a TraceSwitch setting or other proprietary filtering). This can hamper performance.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|