Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. problem with crystal reports

problem with crystal reports

Scheduled Pinned Locked Moved C#
questionhelpcsharpdatabase
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mridang Agarwalla
    wrote on last edited by
    #1

    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.

    N S 2 Replies Last reply
    0
    • M Mridang Agarwalla

      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.

      N Offline
      N Offline
      Nadeem Akhter
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • M Mridang Agarwalla

        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.

        S Offline
        S Offline
        sreenivasbukka
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups