|
|
I have a problem when displaying a report that have more than 1 page.
When I click on "next page" button in crystal report toolbar, the page cannot be shown .
and, now my code is look like this :
rpt.SetDataSource(dataSet21);
CrystalReportViewer1.ReportSource = rpt;
|
|
|
|
|
Have you placed the special field "Page N of M" on your report?
This should force the report to load all pages on startup. Otherwise it tries to load the pages dynamically (as far as I know).
Don't know if this could solve your problem, but maybe you'll give it a try...
-------------------------------------------
The light at the end of the tunnel has been switched off temporarily due to budget problems...
|
|
|
|
|
Hi, I'm looking for a free menu/toolbar library (ideally with rebar/coolbar support ala IE6; Windows XP support would be icing). My target environment is an Explorer Bar, where top-level menus don't exist because they're not Windows applications, but I need a menu anyway. I've tried using the WinForms.ToolBar class as well as Lutz Roeder's CommandBar library. Both have flaws, perhaps a shared flaw in the WinForms.CommonDialog class clashing with the WinForms.Button class in this environment.
Anyhow, it seems that the relevant articles on this site don't seem to meet my criteria, and I'd like a free library (free as in beer, although source code would be nice, too). Nothing necessarily too fancy, although icon support and font/color customization of the text would be helpful.
By the way, does anyone know of a good repository of open-source .NET libraries and such besides this site? I know of WindowsForms.net and GotDotNet. They're okay.
Thanks!
Arun
|
|
|
|
|
If you're willing to wait couple months (or use beta software) .net framework 2.0 will have those.
|
|
|
|
|
I'm trying to create a C# class with functionality similar to the one from this article:
http://www.codeproject.com/cpp/enumleafclasses.asp
The only problem I have encountered is that under my design an instance of the leaf class must be created before the class will registered itself. This is not so with the code from the article.
How can I have a leaf class register itself with its base class without needing to create an instance of the leaf class?
The base class has the following member of my class defined:
protected static LeafFactory _LF = new LeafFactory(Type.GetType("LeafFactory_dev.BaseClass"));
And this is how I currently register the leaf class in its constructor:
BaseClass._LF.RegisterLeaf(this.GetType(), "description here");
-- K
|
|
|
|
|
I was checking out Ianier Munoz's implementation of streaming audio input using the DirectSound API and C# .NET. My question has to do with a problem I'm facing in C#.
The function I want to access is declared as follows:
[c]
public void Play(nsStreamPlayer.PullAudioCallback pullAudio)
{
// Bunch of stuff
}
[/c]
nsStreamPlayer is a namespace in which a delegate and an interface are defined.
[c]
namespace nsStreamPlayer
{
///
/// Delegate used to fill in a buffer
///
public delegate void PullAudioCallback(IntPtr data, int count);
///
/// Audio player interface
///
public interface IAudioPlayer : IDisposable
{
int SamplingRate { get; }
int BitsPerSample { get; }
int Channels { get; }
int GetBufferedSize();
void Play(PullAudioCallback onAudioData);
void Stop();
}
}
[/c]
The "Play" function is defined in a nested private class
[c] private class PullStream : Stream [/c]
which itself belongs to a public class StreamingPlayer
[c] public class StreamingPlayer : IDisposable, nsStreamPlayer.IAudioPlayer [/c]
NOW: On my mainform designer I have a button called btnStartStream.
I want to write the code such that clicking btnStartStream calls the play function. How do I do this? Everything I've tried throws up an error message.
I know I'm missing something basic. Could you please help me out?
Thanks a lot for your time!
|
|
|
|
|
You have an instance of the StreamingPlayer class, correct?
StreamingPlayer stmPlyr = new StreamingPlayer();
private void btnStartStream_Click(object sender, EventArgs e)
{
PullAudioCallback cbk = new PullAudioCallback(someAudioCallBack);
stmPlyr.Play(cbk);
}
private void someAudioCallBack(IntPtr data, int count)
{
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Nick, thanks for the reply! However, I still have a slight problem.
The constructor for StreamingPlayer needs three arguments - owner, DirectSound playback device and waveformat.
How do I include these in the function call? They are set in the function definition, i.e.
public StreamingPlayer(Control owner, Device device, WaveFormat format)
{
m_Device = device;
if (m_Device == null)
{
m_Device = new Device();
m_Device.SetCooperativeLevel(owner, CooperativeLevel.Normal);
m_OwnsDevice = true;
}
BufferDescription desc = new BufferDescription(format);
desc.BufferBytes = format.AverageBytesPerSecond;
desc.ControlVolume = true;
desc.GlobalFocus = true;
m_Buffer = new SecondaryBuffer(desc, m_Device);
m_BufferBytes = m_Buffer.Caps.BufferBytes;
m_Timer = new System.Timers.Timer(BytesToMs(m_BufferBytes) / 6);
m_Timer.Enabled = false;
m_Timer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
}
|
|
|
|
|
Sorry, disregard that...that was a really dumb question. Been working on this too long...not thinking straight.
BUT:
PullAudioCallback is a delegate defined as
public delegate void PullAudioCallback(IntPtr data, int count);
When I instantiate a PullAudioCallback object,
PullAudioCallback cbk = new PullAudioCallback(...)
I need arguments for data and count. What should these be?
I tried digging through the source code but I don't see where he calls this function explicitly, though it is integral to the application.
|
|
|
|
|
crushinghellhammer wrote:
I need arguments for data and count. What should these be?
It's a delegate which means that it's instance has to represent that signature it defines. Take a look at my example, the example function matches that method signature. Does that make sense?
- Nick Parker My Blog | My Articles
|
|
|
|
|
I see now! Sorry if this is exasperating...I'm new to C# and sometimes reading other people's code (in this case Ianier's) is a little confusing.
My understanding of his intention in using PullAudioCallback is that the delegate is supposed to wait for count bytes to be copied to the data buffer which is an IntPtr before it plays these bytes.
What exactly is IntPtr...is it a pointer to a byte array? What would the contents of
"someAudioCallBack(IntPtr data, int count" be?
Thanks again!
|
|
|
|
|
|
If i have a FileSteam and open a BinaryReader on it the FileStream is Closed/Disposed when I close the Binaryreader - does it work the other way around? Does calling Close on the FileStream call Close/Dispose on the BinaryReader?
Rugby League: The Greatest Game Of All.
|
|
|
|
|
PaleyX wrote:
Does calling Close on the FileStream call Close/Dispose on the BinaryReader?
No, you should not do that. Internally, the BinaryReader uses a reference to the FileStream instance. Because the BinaryReader implements IDisposable , you can wrap the BinaryReader in a using statement so try/finally blocks are emited and the BinaryReader is cast to an IDisposable and the Dispose() method is called.
- Nick Parker My Blog | My Articles
|
|
|
|
|
i am student ,and i want to work on some telephony application
i know that the perfect subject is TAPI ,but there are some questions :-
1- can i use the TAPI in c# language ?
2- should i install some files or dll files that help to execute TAPI functionallity ?
3-couild i have an example in c# that shows me how exactly work with TAPI in c#?
finally ,forgive me for my bad english?
>
|
|
|
|
|
Wail A.Salem wrote:
can i use the TAPI in c# language ?
Yes, but you will have to P/Invoke your method calls because they are native. If you are unfamiliar with this process you can find more information here[^]. Take a look at the TAPI.H file to see what's available to you.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Nick Parker wrote:
Yes, but you will have to P/Invoke your method calls because they are native. If you are unfamiliar with this process you can find more information here
[edit]
Probably better to make use of the work already done by Helen Warn[^]
Its a good lesson in Interop too.
Michael
CP Blog [^]
|
|
|
|
|
Michael P Butler wrote:
Probably better to make use of the work already done by Helen Warn[^]
I would agree that it would be extremely practical (in the business sense) to use the project Helen Warn has put together, however I took into consideration that he was a student and learning the process behind P/Invoke would be helpful in the long run.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Nick Parker wrote:
however I took into consideration that he was a student and learning the process behind P/Invoke would be helpful in the long run.
Certainly. However, speaking from experience. TAPI can be hard enough to get to work, without having the extra overhead of learning P/Invoke too.
Michael
CP Blog [^]
|
|
|
|
|
Wail A.Salem wrote:
can i use the TAPI in c# language ?
Yes. You can use TAPI 3 via COM interop but it isn't 100% reliable. This article[^] is supposed to be a lot more reliable. I haven't used it personally as I already have my own TAPI 2 Com wrapper.
IMO, unless you really have a good reason to use C#. TAPI is a lot easier to use in C++.
Michael
CP Blog [^]
|
|
|
|
|
i want to write a rss reader program. but i'm a beginner and i dont know how to start. there're 2 problems for me now:
1. i dont know how to read .aspx files (for example http://www.gotdotnet.com/team/dbox/rss.aspx)
2. how can i display text from that file in form???
thanks!!!
|
|
|
|
|
Have a read of this[^]
It should tell you all you need to know.
Michael
CP Blog [^]
|
|
|
|
|
thanks...i'm trying to understand
|
|
|
|
|