problem with crystal reports
-
Hey guys, Im using Crystal Reports in my C# application for the first time. Im facing a small problem though. I created a Crystal Reports document and Dataset. Then I placed all the fields from Dataset into my Report. I populate the dataset using code and when I view the report I can see all the records but apart from mapping fields to a dataset there a few fields that I would like to populate from code directly. These fields have nothing to do with my Database, its just some information that i want to place in my Crystal Report. How do I do this? I couldn't find any resources specific to my question so I've come here for help.
-
Hey guys, Im using Crystal Reports in my C# application for the first time. Im facing a small problem though. I created a Crystal Reports document and Dataset. Then I placed all the fields from Dataset into my Report. I populate the dataset using code and when I view the report I can see all the records but apart from mapping fields to a dataset there a few fields that I would like to populate from code directly. These fields have nothing to do with my Database, its just some information that i want to place in my Crystal Report. How do I do this? I couldn't find any resources specific to my question so I've come here for help.
First of all you need to design a Report and then you will assign the data set to the report .. Importing thing all the report field name same as in the DataSet.. < CrystalReportViewer1.ReportSource = CrystalReportSource1 Dim ds As DataSet Dim objCMTransaction As New ForMerchantCard2Merchant ds = objCMTransaction.CardToMerchant(Session("fromDate").ToString, Session("toDate").ToString, Session("UserName")) ' Report Parameters Dim param1Fileds As New CrystalDecisions.Shared.ParameterFields Dim param1Field As New CrystalDecisions.Shared.ParameterField Dim param2Field As New CrystalDecisions.Shared.ParameterField Dim param1Range As New CrystalDecisions.Shared.ParameterDiscreteValue Dim param2Range As New CrystalDecisions.Shared.ParameterDiscreteValue param1Field.ParameterFieldName = "DateFrom" param1Range.Value = Session("fromDate").ToString param1Field.CurrentValues.Add(param1Range) param1Fileds.Add(param1Field) param2Field.ParameterFieldName = "DateTo" param2Range.Value = Session("toDate").ToString param2Field.CurrentValues.Add(param2Range) param1Fileds.Add(param2Field) Me.CrystalReportViewer1.ParameterFieldInfo = param1Fileds Me.CrystalReportSource1.ReportDocument.SetDataSource(ds.Tables(0)) > Rgds, Nadeem.
-
Hey guys, Im using Crystal Reports in my C# application for the first time. Im facing a small problem though. I created a Crystal Reports document and Dataset. Then I placed all the fields from Dataset into my Report. I populate the dataset using code and when I view the report I can see all the records but apart from mapping fields to a dataset there a few fields that I would like to populate from code directly. These fields have nothing to do with my Database, its just some information that i want to place in my Crystal Report. How do I do this? I couldn't find any resources specific to my question so I've come here for help.
here is the code i'm sending to your values to crystal reports as parameters to crystal reports call below montioned code into you application. void para(string fldName, string valName) { ParameterField paramfield1 = new ParameterField(); ParameterDiscreteValue disval1 = new ParameterDiscreteValue(); ParameterValues val1 = new ParameterValues(); paramfield1.ParameterFieldName = fldName; disval1.Value = valName; val1.Add(disval1); paramfield1.CurrentValues = val1; CrystalReportViewer1.ParameterFieldInfo.Add(paramfield1); } Happy coading......... B.Sriniva Ramco Systems Ltd Chennai 9940145626