|
Hello,
I would like to ask if how will do I change the recordsource of crystal report in
vb 6.0 .For example I will show only the records that is filtered by my datepicker.
Below here is my datepicker select between query:
Dim sSource As String
sSource = "Select * From studRecords Where DateEnrolled>= #" & DTPicker1.Value & "# and DateEnrolled<= #" & DTPicker2.Value & "# "
Adodc1.RecordSource = sSource
Adodc1.Refresh
If you would mine also can I also ask how will I do this in vb.net .
Comments ,suggestions are kindly appreciated.
Thanks,
dfan23
|
|
|
|
|
Thats the way to do in vb6 , you can also Use Selection Formula in Crystal Report and Pass the Values to report and Enter the Selection Formula in Crystal Report then it will select only those records. but this will be slow as we are giving the whole data to Crystal Report then its Filtering , better is to give the Crystal Report the Filtered data only
In vb.net it depends how you are connecting to the DB , their are so many waysBest Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
Thanks,
Would you mine if you could give me some sample how to pass the filtered data in Crystal report.
By the way the crystal report version I have is 8.5
In vb.net I have used OLEDB connection to connect in my database and
my database is MS ACCESS 2003.
Thanks you so much in immediate response.
Thanks,
dfan23
|
|
|
|
|
VB6 :
Open Report in Crystal Report ===> go to Reports menu ===>Select Expert ==> click on Show formula button and put your filter their like
{tabke.field} = {@FormulaField}
you can create a formula field from Insert ==? Field Object menu thne create New Formula Field here and then Pass in your VB Application the value to it
For vb.net my question is you are sing Dataset , Objects ?????Best Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
Thanks,
Can I ask if how do I will add my datepicker.value into the select formula,
I tried adding my sql command but it gives error.
In vb.net yup I use dataset and I also try to code my connections.
Thanks again for Immediate response.
Thanks,
dfan23
|
|
|
|
|
|
Thanks,
I would like to give a big thanks to you sir for immediate response and time for entertaining
my questions. If you would mine I would like to ask if what will I put in Field and here is the code
I am planning to yet
form1.Crystalreport1.Formulas(0) = "filteringDate=DateDate(" & Year(Field) & "," & Month(Field) & "," & Day(Field) & ")"
Thanks you so much sir,
The link you have gave is really nice
A 5 rating really suite on you
Thanks,
dfan23
|
|
|
|
|
thank you so much , if your work is done thats more to me
just remove date from datedate and in (Field) enter name of your date time picker or control name
thats all , if you have more then one fields in crystal reports then formulas(n) counter will increase like
1,2 , 3 , --- ,nBest Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
Hello again Sir,
Sorry for keep asking this again but I still confuse sir on the use of
formula in crystal report
I have tried these commands but still I have error and it says
"Remaining text does not appear to be a part of the formula"
form3.CrystalReport1.Formula(0)= "Select * From studRecords Where DateEnrolled>= #" & DTPicker1.Value & "# and DateEnrolled<= #" & DTPicker2.Value & "# "
form3.Crystalreport1.Formulas(0) = "filteringDate=Date(" & Year(DTPicker1.Value ) & "," & Month(DTPicker1.Value ) & "," & Day(DTPicker1.Value ) & ")" "
If you would mine sir could you give me a sample formula on how to filter the date using
the date picker I have use as the same I filter in my datagrid
Here are some details:
CrystalReport1 - the name of my crystal report
form3 - where my crystal form is
DTpicker1 - datepicker I use to filter( from this Date)
DTpikcer2 - datepicker I use to filter( to this Date)
filteringDate - the name of my formula
Thanks you so much again for immediate reponse and entertaining my question
Thanks,
dfan23
|
|
|
|
|
Hi,
Currently I'm working on a Smart Device project in VB.NET (in Visual Studio 2008) and I found a project on the net in C# which fits to my needs so I added to my solution as a class library.
So right now I have a solution with a VB project and a C# project (class library).
In the C# I have a part like this:
namespace Something
{
public class SomeList : SomeListControl
{
public event EventHandler SiteReached;
public event EventHandler SiteOpened;
public event EventHandler<ListEventArgs> ListOpened;
...
This namespace is included in my VB project as a Reference.
Public Class MainClass
Private SomeControl As SomeList
Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
'In the C# project the following code was implemented:
'SomeControl.SiteReached += (s, ea) => miBack.Enabled = false;
'SomeControl.SiteOpened += (s, ea) => miBack.Enabled = true;
'SomeControl.ListOpened += new EventHandler<ListEventArgs>(SomeControl_ListOpened);
'What can I do to inherit those Eventhandlers?
...
Thank you in advance for your kind help.
|
|
|
|
|
Do you have a question? Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Yes I do.
Actually the question is in the last code:
What can I do to inherit those Eventhandlers?
|
|
|
|
|
Sorry I missed the question.
The declaration of the SomeControl object should be :-
Private WithEvents SomeControl As SomeList Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
I'm sorry I wasn't clear what my question was.
And thank you very much for your quick replies.
I did the fix you suggested but still the error is there: 'SomeControl' is not an event of 'MyProject.Main' for
RaiseEvent SomeControl.SiteReached
Edit:
I also added to the
Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click SomeControl.SiteReached
No luck.modified on Tuesday, February 16, 2010 4:50 AM
|
|
|
|
|
You need to handle the events of SomeControl within your MainClass then raise another event from the handle that is specific to your MainClass for example
Private Sub SomeControl_SiteReached() Handles SomeControl.SiteReached
'Additional validation goes here, if required
RaiseEvent SiteReached()
End Sub
Public Event SiteReached() Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Thank you, that builds.
Finally: Can you point me to the right direction what this does/means?
SomeControl.SiteReached += (s, ea) => miBack.Enabled = false;
SomeControl.SiteOpened += (s, ea) => miBack.Enabled = true;
SomeControl.ListOpened += new EventHandler(SomeControl_ListOpened);
Should I ask in C# forum?
|
|
|
|
|
The last one is easy
SomeControl.ListOpened += new EventHandler(SomeControl_ListOpened);
converts to
AddHandler SomeControl.ListOpened, Addressof SomeControl_ListOpened
The other two are rather tricky. They use lambda functions which VB doesn't really support. Essentially
SomeControl.SiteReached += (s, ea) => miBack.Enabled = false;
Says, "Add a new handler for SiteReached that takes two parameters (s and ea). This function will set miBack.Enabled = False ."
Making the Sub in VB is rather easy
Sub SomeControl_SiteReached(s as Sender, ea as System.EventArgs)
The hard part is duplicating the middle. If miBack is global or accessible from SomeControl_SiteReached then you are fine. If miBack is local to ManuItem1_Click , then you have a problem. You will have to find some way to change the Enabled state for miBack .
|
|
|
|
|
Hello,
I want to display menu list on specified hot key such as 'ALT + S'.But i m unable to get key combination.as i press Alt the keydown event is fire it does not accept combination .Please help .
'Keypreview = true'.
|
|
|
|
|
If its Menu then in menu you can specify the Short key by just setting the Values , you dont need to do anything Best Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
Just wondering if the keypreview is causing the problem. I never use it but unless it is handled correctly it could zap the key combination as far as the menu is concerned. Just set Alt+S on your menu hotkeys
|
|
|
|
|
I like to calculate the total to a field [trn_qty] from Dtb1 [Datatable]. For that any ideas...?
My Query is
Dim Numbers = Dtb1.AsEnumerable()
Dim SvQy = (From n In Numbers Select n.Field(Of Decimal)("trn_qty")).Sum()
But Iam not getting any O/P. Also I don't know whether its correct or not... Any better ideas?
Thanks
|
|
|
|
|
I haven't tried your syntax but if you have null values, then you need to add a where clause to filter those out. 'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
dear friends, i need a vb.net project of "information visualizing system".in this project,generally we enter data inform of cost which is spend to carry out the project or any organization will display in form of pie chart or histo diagram.
|
|
|
|
|
Without wishing to put too fine a point on it then I suggest that you write one.modified on Monday, February 15, 2010 8:26 AM
|
|
|
|
|
TheComputerMan wrote: put too fine a point on it
I read your message and when i read the text above, instantly thought of 'They Might be Giants - Birdhouse in your Soul' http://www.youtube.com/watch?v=NAbZzdalZh4[^]
Strange how song lyrics just pop out of nowhere!
|
|
|
|