Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Assing Data to Report Field Post Reply Post New Topic
Author Message
lesponce
Newbie
Newbie


Joined: 01 Sep 2012
Online Status: Offline
Posts: 1
Quote lesponce Replybullet Topic: Assing Data to Report Field
    Posted: 01 Sep 2012 at 7:55am
I need to set value to my report fields.  If I open the .xsd file and assign "HELLO" to the DefaultValue field it gets displayed on the report.
 
My problem:
I'm using a C# program to assign the value, but I can't get it displayed when I run the program.
 
This is a sample of the code:
            ReportDocument rptCheck = new ReportDocument();
            dsCheck ds = new dsCheck(); // .xsd file name
            DataTable dt = new DataTable();

            // Just set the name of data table
            dt.TableName = "Crystal Report Checks";
            dt = getChecks(); //This function is located below this function
            ds.Tables[0].Merge(dt);
           
            // Your .rpt file path will be below
            rptCheck.Load(Server.MapPath("checkprt.rpt"));
 
            //set dataset to the report viewer.
            rptCheck.SetDataSource(ds);
            CrystalReportViewer1.ReportSource = rptCheck;
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 04 Sep 2012 at 4:29am
well....the first thing that I would do is save your ds to a file and check what is there.  the rest seems ok, so I would check that the ds being passed has the values that you think it does.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.048 seconds.