GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Microsoft  >  VB.NET
Go To First  |  Previous Question  |  Next Question 
 VB.NET  |  Question 6 of 60    Print  
Can any body tell me the code procedure for preparing parameterized cristel reports.the report should be generated by taking to or more parameters.
example: report should be genarated FROM DATE to TODATE

  
Total Answers and Comments: 3 Last Update: April 07, 2009     Asked by: Yamini 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
December 02, 2005 03:08:11   #1  
Sutirtha        

RE: Can any body tell me the code procedure for prepar...

Create report with a view and pass sql with fromDate and todate.


 
Is this answer useful? Yes | No
August 30, 2006 21:59:48   #2  
JAGAN.G        

RE: Can any body tell me the code procedure for prepar...

We can generate Crystal Report by using date parameter but the date format should be yyyy mm dd .

Ex. CrystaReport1.SelectionFormula {GLNOTE.L_DT} date( & a & )

The variable 'a' should be assign with formated date


 
Is this answer useful? Yes | No
April 07, 2009 06:13:17   #3  
mubin4all Member Since: April 2009   Contribution: 5    

RE: Can any body tell me the code procedure for preparing parameterized cristel reports.the report should be generated by taking to or more parameters.example: report should be genarated FROM DATE to TODATE

'use this procedure for displaying crystal report with two date paramenters
Private Sub btnshow_Click(ByVal sender As System.Object ByVal e As System.EventArgs) Handles btnshow.Click
Dim cryRpt As New ReportDocument
Dim crtableLogoninfos As New TableLogOnInfos
Dim crtableLogoninfo As New TableLogOnInfo
Dim crConnectionInfo As New ConnectionInfo
Dim CrTables As Tables
Dim CrTable As Table

cryRpt.Load(My.Application.Info.DirectoryPath & "reportscashmemoreport.rpt")
With crConnectionInfo
.ServerName ""
.DatabaseName My.Application.Info.DirectoryPath & "dbhms.mdb"
.UserID "admin"
.Password "admin"
End With

CrTables cryRpt.Database.Tables
For Each CrTable In CrTables
crtableLogoninfo CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next
Dim crParameterFieldDefinitions crParameterFieldDefinitions1 As ParameterFieldDefinitions
Dim crParameterFieldDefinition crParameterFieldDefinition1 As ParameterFieldDefinition
Dim crParameterValues crParameterValues1 As New ParameterValues
Dim crParameterDiscreteValue As New ParameterDiscreteValue
Dim crParameterDiscreteValue1 As New ParameterDiscreteValue

crParameterDiscreteValue.Value dtprepbdate.Value
crParameterFieldDefinitions cryRpt.DataDefinition.ParameterFields
crParameterFieldDefinition crParameterFieldDefinitions.Item("bdate")
crParameterValues crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

crParameterDiscreteValue1.Value dtprepedate.Value
crParameterFieldDefinitions1 cryRpt.DataDefinition.ParameterFields
crParameterFieldDefinition1 crParameterFieldDefinitions.Item("edate")
crParameterValues1 crParameterFieldDefinition.CurrentValues
crParameterValues1.Clear()
crParameterValues1.Add(crParameterDiscreteValue1)
crParameterFieldDefinition1.ApplyCurrentValues(crParameterValues1)

crvdcashmemo.ReportSource cryRpt
crvdcashmemo.Refresh()

End Sub


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape