![]() ' This call is required by the Windows Form Designer. #Region " Windows Form Designer generated code " Imports ĭim con As String = ("connectingstring") here after debugging i dont want login window to see database. I have been making this report for last one month but cant understand what i am doing wrong. ObjForm.ViewReport("C:\Develop\JawoodSql-New\CrystlRpts\contracttest.rpt", SubĪlso, where does the long bit of code go for the Friendly, becasue no matter where I put it some of the code shows up fine and the rest of the code isgrayed out.Īny help in this matter is greatly appreciated. Private Sub btnContract_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnContract.Click I copied the code that does the report call and get an error on this line: objForm.ViewReport("C:\contract.rtp",, error is with the objForm.ViewReport it says "ViewReport" is not a member of mViewReport, here is the entire code I have a vb form with a button on it that calls the report. I am having a bit of a problem understanding your code. I am pretty new to VB but have been using Crystal Reports and MS SQL for 2 years now. Initially it was hard to detect, but finally I solved that problem. When there were no parameters and only the selection formula, the function failed because the parameters collection was picking the selection formula. The main problems while developing the function were the sub reports and the selection formula. RptViewer.ReportSource = Nothing ' Set the current report object to report. ObjReport.RecordSelectionFormula = sSelectionFormula Next End If End With Next Next ' If there is a selection formula passed to this function then use that If sSelectionFormula.Length > 0 Then MySubReportObject.OpenSubreport(mySubReportObject.SubreportName)įor intCounter1 = 0 To - 1 MySubReportObject = CType(.ReportObjects(intCounter), _Ĭ) Index).ReportObjects.Count - 1 With (index)ĬrystalDecisions. Next ' Loop through each section on the report then look ' through each object in the section ' if the object is a subreport, then apply logon info ' on each table of that sub report For index = 0 To - 1 For intCounter = 0 To _ StrVal( 0)).Appl圜urrentValues(currValue)Įnd If Next End If ' Set the connection information to ConInfo ' object so that we can apply the ' connection information on each table in the reportįor intCounter = 0 To - 1 StrVal = strParValPair(index).Split( " =") ![]() If InStr(strParValPair(index), " =") > 0 Then If intCounter > 0 And Trim(param) " " Then IntCounter = 0 End If End If ' If there are parameters in report and ' user has passed them then split the ' parameter string and Apply the values ' to their concurrent parameters. If intCounter = 1 Then If InStr((_Ġ).ParameterFieldName, ". ' As parameter fields collection also picks the selection ' formula which is not the parameter ' so if total parameter count is 1 then we check whether ' its a parameter or selection formula. ' Check if there are parameters or not in report. Dim mySubRepDoc As New _ĭim strParValPair() As String Dim strVal() As String Dim index As Integer Try ' Load the report ![]() ' Current parameter value object(collection) of crystal report parameters. ' Parameter value object of crystal report ' parameters used for adding the value to parameter. ![]() ' object of table Log on info of Crystal report Dim ConInfo As New CrystalDecisions. Optional ByVal param As String = " ") As Boolean ' Declaring variablesables Dim intCounter As Integer Dim intCounter1 As Integer ' Crystal Report's report document object Dim objReport As New _Ĭ Optional ByVal sSelectionFormula As String = " ", _ ![]() Friend Function ViewReport( ByVal sReportName As String, _ ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |