|
This[^] article should help you.
|
|
|
|
|
Hey Pete, and thanks! The article looks helpful, I'm reading it now.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
No bother mate. Glad I could help.
|
|
|
|
|
See this[^] article.
/ravi
|
|
|
|
|
Hey Ravi,
Long time no see buddy Thanks for your informative link, but I'm sorry I bothered you guys, the problem way a particular one that relates to my form and works fine with any other windows form!
Thanks mate! 5 for trying to help though
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Okay.. Here is my question!
I want to generate reports using crystal report or any other reporting feature that works in visual studio 2005 (using C-sharp). now the trick is, i want the user to be able to define what they would like in their report(without them actually writing the sql behind the report). for example lets say they they wanted to see a list of people with names starting with "G" according to how much they earned.. it should be able to do this. the user should just select options on the "form" and a report be generated..
thanks.
|
|
|
|
|
For this you need to pass parameters to your store procedure based on the users choice. And then based on that build your crystal report.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
hey..
ive created reports before but ive never had to pass parameter in a report.. can more than one parameter be passed? if its not too much to ask for you could you please just explain to me how to do this.
Thanks.
(sent the exact msg to your email, wasnt sure if you'd get it or not)
|
|
|
|
|
I am not asking you to pass parameter to report. I am asking to pass parameter to your query or storeprocedure which gives you the selected records based on the parameters.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
After defining and opening your connection and creating your data adapter..
yourCommand.CommandType = CommandType.StoredProcedure;<br />
yourCommand.CommandText = "YourStoredProcedureName(ParameterValue1,ParameterValue2)";<br />
yourCommand.ExecuteNonQuery();
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Do you mean, the users are able to really define what they like to see in the report, or, do you mean, the users have pre-defined options to choose how to filter the data??
For the first case, many developers has been asked the same thing, and the answer is no, the user, unless they know how to use the report generation tool such as Crystal Report or SQL Reporting Service, and know the system, they can't "freely" generate any report that they like.
For second case, you can pass value by parameters and have the report filter by these parameters, or in Crystal Report case, you can add the selection criteria to SelectionFormula that is formed by the user interface.
|
|
|
|
|
Hello,
i have a very very strange problem. My Application gets often a "out of memory" exception. i have a lot of classes in there and in my form, yes there are a lot of controls too. when i start my application with the debugger, it shows me all of my controls and all classes are loaded of course, but then when i want to open another form from the application, it shows me the form (but without the title-bar Oo) and if i klick somewhere in this form i get in the debugger an "outofmemory" exception. directly on the line where i start the form. the form has only a few labels and a few checkboxes.
but thats the strange on this problem... my physical memory is enough! and i thougt maybe it has to do with the debugger, i started the app directly from the explorer. there i get at the same line a exception with "parameter not valid"...
i think thats not a "code" problem... because when i have a little less controls in my form, it works... i don't know why it makes this exception, can somebody help me?
|
|
|
|
|
I guess your application is stuck in some loop and it is creating an object again and again due to which it runs out of memory.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
i load this controls all from a list with foreach, so it has no loop, where it can't drop out.
|
|
|
|
|
softwarejaeger wrote: i have a lot of classes in there and in my form, yes there are a lot of controls too.
You would have to have an obscene number of controls before you would be running out of memory for that reason...
softwarejaeger wrote: i think thats not a "code" problem...
I think that it is... but that doesn't really matter, the method of isolating the problem is the same. Set a breakpoint before the code that opens the second form, and single step through the code to determine what's happening and what part of your code that is causing/triggering the problem.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
what do you mean with "obscene" number of controls... i think at my project in that form i have round about 3000 controls.
i think it's a problem with the drawing of the second form or drawing in common... because, if i open the form, i have relly graphics problems. for example the taskbar gets on top, everything is black, the title-bar of the form isn't shown, now i see a banner of this website is out of the window oO. it looks like everything hangs here.... what to do?
|
|
|
|
|
softwarejaeger wrote: i think at my project in that form i have round about 3000 controls.
Maite, are you sure that you have 3000 controls on your form.
What do you or the user do with these many controls?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Ok so 3000 controls on a form is an obscene number and should probably qualify as a coding horror. You need to redesign your app. I'm gobsmacked, 3000 controls wow.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
they're all needed, i show a "table" with them from data from an file. each control is like a cell...
so have you maybe an better idea to show such big amount of controls? dataGrids isn't the right for my project and the table-layout-panel doesn't make it even better
|
|
|
|
|
Do a custom control and draw every cell yourself!
|
|
|
|
|
ehm... i don't know exactly what you mean, but i do it this way...
i have a own control, where i load the ~3000 "cell-control-classes" in... and then i have a method "DrawMe()" where i show every control is in there and put them to the right location with the right size...
that's all about it, thats not very much code and so on, so i don't understand what you mean with "Do a custom control"... have you an example or do we both mean the same?
|
|
|
|
|
Search around for custom drawn controls .
|
|
|
|
|
Instead of adding the cells as controls to have them drawn, use the Paint event to draw them yourself.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
ehm i have custom controls for the cells... they are all classes with the paint method, where they're drawn and some other methods.
ok but what is now when i want to change one cell? so what to do if i change their backgroundColor, because the backgroundColor indicates a value from this cell...
because i think you mean i shoudl draw lines and rectangles to draw the controls or? or can i take the graphics from another class to the form?
|
|
|
|
|
Do not use a control for every little piece of content. This is too heavy weight.
softwarejaeger wrote: because i think you mean i shoudl draw lines and rectangles to draw the controls or?
Exactly that. And dont be scared. It is actually one of the funner parts of programming
|
|
|
|